예제 #1
0
파일: CollectorMain.cs 프로젝트: odbb/ggj16
		//----------------------------------------------------------------------------------
		// Methods ( Initialisation )
		//----------------------------------------------------------------------------------

		void Awake()
		{
			if( singletonInstance != null && singletonInstance != this )
			{
#if UNITY_EDITOR
				Debug.LogWarning("Singleton instance already exists within the scene. Destroying self but leaving the gameObject intact : " + this.gameObject.name );
#endif
				Destroy( this );
			}
			else
				singletonInstance = this;

			m_CoinFormat = coinDisplay.text;
			Coins = 10;
		}
예제 #2
0
파일: CollectorMain.cs 프로젝트: odbb/ggj16
		protected void OnApplicationQuit()
		{
			singletonInstance = null;
		}