void OnSceneLoaded(Scene scene, LoadSceneMode mode) { Debug.Log(string.Format("Scene {0} loaded.", scene.name)); if (scene.name == "HUD") { GameObject[] rootObj = scene.GetRootGameObjects(); foreach (GameObject go in rootObj) { if (go.transform.Find("JoystickContainer") != null) { joystickMovement = go.transform.Find("JoystickContainer").GetComponent <JoyHandler> (); } } } }
/// <summary> /// Start the net joy client /// </summary> /// <returns></returns> public async Task Start() { //log that we want an address Logger.Log("Enter the IP address to connect to"); var host = Console.ReadLine(); //Enter the port to connect to Logger.Log("Enter the port to connect to: "); //create the boolean for whether the int is valid var port = GetValidInt(); //create a new joystick handler using the given joystick port _joyHandler = new JoyHandler(); //connect to the entered server await Connect(host, port).ConfigureAwait(false); }