// // Create console window, register callbacks // void Awake() { DontDestroyOnLoad(gameObject); console.Initialize(); console.SetTitle("UDynNet POC Server"); input.OnInputText += OnInputText; networkManager = gameObject.GetComponent <NakNetworkManager>(); Application.logMessageReceived += HandleLog; Debug.Log("Console Started"); }
// Use this for initialization void Awake() { manager = gameObject.GetComponent <NakNetworkManager>(); #if SERVER && !CLIENT StartServer(); GameObject gObj = Instantiate(serverPrefab); gObj.name = serverPrefab.name; NetworkServer.Spawn(gObj); #endif #if CLIENT && !SERVER Debug.Log("Connection to server..."); StartClient(); #endif #if CLIENT && SERVER Debug.Log("Connection to server..."); StartLocalClient(); GameObject gObj = Instantiate(serverPrefab); gObj.name = serverPrefab.name; NetworkServer.Spawn(gObj); #endif }