void Awake() { if(instance == null) { instance = this; GameObject.DontDestroyOnLoad(this.gameObject); } else { GameObject.Destroy(this.gameObject); } }
//---------------------------------------------------------- // Unity calback methods //---------------------------------------------------------- void Start() { Application.runInBackground = true; if (globalSettings == null) { // First time launching globalSettings = Settings.Instance; // Initialize UI ipInput.text = Settings.ipAddress = Host; portInput.text = (Settings.port = TcpPort).ToString(); } else { // Load IP & TCP Port configuration from global Settings ipInput.text = Settings.ipAddress; portInput.text = Settings.port.ToString(); // Rotate camera to examples panel instantly cameraAnimator.SetBool("showExamples", true); cameraAnimator.speed = 1000; } }