Exemplo n.º 1
0
 public void OnDestroy()
 {
     if (Instance != null && Instance == this)
     {
         Instance = null;
     }
 }
Exemplo n.º 2
0
        // ================================================================================
        //  base methods
        // --------------------------------------------------------------------------------

        protected bool Init()
        {
            if (Instance != null && Instance != this)
            {
                return(false);
            }

            Instance = this;
            DontDestroyOnLoad(gameObject);

            sceneFader = new SceneFader();

            InitStates();

            // get references to image display, which is used in sequences
            if (imageDisplay != null)
            {
                _imageDisplayAnimator = imageDisplay.GetComponentInChildren <Animator>();
                HideImage();
            }

            return(true);
        }
		// ================================================================================
		//  base methods
		// --------------------------------------------------------------------------------

		protected bool Init()
		{
			if (Instance != null && Instance != this)
			{
				return false;
			}

			Instance = this;
			DontDestroyOnLoad(gameObject);

			sceneFader = new SceneFader();

			InitStates();

			// get references to image display, which is used in sequences
			if (imageDisplay != null)
			{
				_imageDisplayAnimator = imageDisplay.GetComponentInChildren<Animator>();
				HideImage();
			}

			return true;
		}
		public void OnDestroy()
		{
			if (Instance != null && Instance == this)
				Instance = null;
		}