Skip to content
Snippets Groups Projects
Select Git revision
  • 4a4e91b5680c001466102edf07c33e54451bcb2f
  • master default
  • JS-based-scroll-rendering
  • Paul_Marius_Level
  • Paul_Marius_2
  • Paul_Marius
  • Andi_Mark
  • be-UnityWebView
  • gitignoreFrameitServer
  • ZimmerBSc
  • Bugfix_StageLoading
  • stages
  • MAZIFAU_Experimental
  • tsc/coneworld
  • tsc/fact-interaction
  • marcel
  • MaZiFAU_TopSort
  • mergeHelper
  • zwischenSpeichern
  • tempAndrToMaster
  • SebBranch
  • 3.0
  • v2.1
  • v2.0
  • v1.0
25 results

EditLoader.cs

Blame
  • StartServer.cs 6.10 KiB
    using System.Collections;
    using System.Diagnostics;
    using UnityEngine;
    using UnityEngine.Networking;
    using UnityEngine.SceneManagement;
    using static UIconfig;
    using static CommunicationEvents;
    
    public class StartServer : MonoBehaviour
    {
        [SerializeField]
        TMPro.TextMeshProUGUI WaitingText;
    
        public static Process process;
        public static ProcessStartInfo processInfo;
        public int autostart = 0; //when 1 in Start() will be ServerRoutine() launched. 
        public int autoend = 0; //Update() also affected
        public int autoprepareGame = 0;
        public int autocheckIfServerIsRunning = 0;
    
    
        // Start is called before the first frame update
        void Start()
        {
            CommunicationEvents.ServerRunning = false;
            
            if (ServerAutoStart==true && autostart == 1 )
            {
                StartCoroutine(ServerRoutine());
            }
            if (ServerAutoStart == true && autostart == 2 )
            {
                StartCoroutine(ServerRoutine1());
            }
        }
        // Update is called once per frame
        void Update()
        {
            if (autoend == 1)
            {
                if (CommunicationEvents.ServerRunning && Input.anyKey)
                {
                    SceneManager.LoadScene(1);
                }
    
                //if(!ServerRunning) UnityEngine.Debug.Log("waiting " + ServerRunning);
            }
        }
    
    
    
    
        void PrepareGame()
        {
            if (autoprepareGame !=0)
            {
                WaitingText.text = "Press any key to start the game";
                CommunicationEvents.ServerRunning = true;
                UnityEngine.Debug.Log("server fin");
            }
    
    
        }