Наследование: MonoBehaviour
Пример #1
0
	void Awake() 
	{
		if ( instance != null && instance != this ) 
		{
			Destroy( this.gameObject );
			return;
		} 
		else 
		{
			instance = this;
		}
		
		DontDestroyOnLoad( this.gameObject );
	}
Пример #2
0
    void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            instance = this;
        }

        DontDestroyOnLoad(this.gameObject);
    }
Пример #3
0
    void ChangeScene()
    {
        if (SceneName.Length == 0)
        {
            Debug.Log("Scene not found");
            return;
        }
        //mSound.playSound("click");
        mSound = GetComponent <MainMenuSound>();
        if (mSound != null)
        {
            mSound.playSound("click");
        }
        if (SoundClick != null)
        {
            SoundClick.Play();
        }
        preChangeScene();
//		Debug.Log ("ChangeScene OnReleaseEvent");
        SceneMgr.ChangeScene(SceneName);
    }