Пример #1
0
 void OnDestroy()
 {
     if (mSingleton == this)
     {
         mSingleton = null;
     }
 }
Пример #2
0
 static void Init()
 {
     if (mSingleton != null)
     {
         Destroy(mSingleton);
         mSingleton = null;
     }
 }
Пример #3
0
 void Awake()
 {
     if (mSingleton == null)
     {
         mSingleton = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     if (mSingleton != this)
     {
         Destroy(gameObject);
     }
 }
Пример #4
0
        protected void OnDisable()
        {
            TextAnimationsManager.UnregisterAnimation(this);

                        #if I2_NGUI
            OnDisableNGUI();
                        #endif
                        #if I2_TMPro
            OnDisableTMPro();
                        #endif
            OnDisableUGUI();

            // If component was disabled, but not the GO, then retrieve the old material and recreate the vertices
            if (gameObject.activeSelf)
            {
                MarkWidgetAsChanged(true, true);
            }
        }
Пример #5
0
        [NonSerialized][XmlIgnore] public int mNumElements; // Num elements in the TextAnimation component (used to know when the InitTime should be executed again if the text changes)



        #endregion

        public void Play(TextAnimation se)
        {
            if (se != null)
            {
                if (!se.mPlayingAnimations.Contains(this))
                {
                    se.mPlayingAnimations.Add(this);
                    TextAnimationsManager.RegisterAnimation(se);
                }
                se.MarkWidgetAsChanged();
                _OnFinished += (anim) => { se._OnAnimation_Finished.Invoke(anim); };
            }

            IsPlaying    = true;
            mTime        = mRealTime = 0;
            mNumElements = -1;
            mRandomSeed  = -1;
            InitTimes(se, true);
        }