Exemple #1
0
		void Awake()
		{
			if(instance == null)
			{ 	
				instance = this;
				GameObject.DontDestroyOnLoad(this.gameObject);
			} 
			else 
			{					
				GameObject.Destroy(this.gameObject);
			}
		}
Exemple #2
0
		//----------------------------------------------------------
		// 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;
			}
		}