Esempio n. 1
0
		//----------------------------------------------------------------------------------
		// 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;
		}
Esempio n. 2
0
		protected void OnApplicationQuit()
		{
			singletonInstance = null;
		}