Beispiel #1
0
            internal void Notify(string key)
            {
#if LOG_DEBUG
                Debug.Log(string.Format("OBSERVER:{0}", key));
#endif// LOG_DEBUG
                BroadcastTunnel <string, object> .Notify(key, null, this.group);
            }
Beispiel #2
0
        void OnActive(bool value)
        {
            //Debug.Log("ONACTIVE:" + value + ", OLD:" + this.activate + ", GEN:" + this.generation);
            this.activate     = value;
            this.waitForDelay = 0;
            ++this.generation;
            BroadcastTunnel <int, bool> .Notify(LoadingIndicator.SCREEN_LOCK, value);

            //this.LockInputGuides(value);

            if (this.introOutro && this.introOutro.Animation)
            {
                float startTime = 0;
                if (this.inOutAction && this.introOutro.Animation.isPlaying)
                {
                    startTime = 1 - this.introOutro.CurrentAnimState.normalizedTime;

                    if (value)
                    {
                        if (null != this.outroDone)
                        {
                            this.outroDone();
                        }
                    }
                    else
                    {
                        if (null != this.introDone)
                        {
                            this.introDone();
                        }
                    }
                }

                this.introOutro.SetCurrentAnimPair(value ? 0 : 1);
                this.introOutro.Animation.ForcePlay(true);
                if (0 < startTime)
                {
                    this.introOutro.CurrentAnimState.normalizedTime = startTime;
                    this.introOutro.Animation.Sample();
                }
                this.inOutAction = true;
                if (value)
                {
                    this.gameObject.SetActive(true);
                }
            }
            else
            {
                this.inOutAction = false;
                this.gameObject.SetActive(value);
            }

            if (value)
            {
                this.objectAnim.ForcePlay(true);
            }
        }
Beispiel #3
0
        void IncreaseLock()
        {
            ++this.lockCount;

            if (!this.lockObject.enabled)
            {
                this.lockObject.enabled = true;
                BroadcastTunnel <int, bool> .Notify(Wait.SCREEN_LOCK, true);
            }
        }
Beispiel #4
0
        void ClearLock()
        {
            this.lockCount = 0;

            if (this.lockObject.enabled)
            {
                this.lockObject.enabled = false;
            }

            BroadcastTunnel <int, bool> .Notify(Wait.SCREEN_LOCK, false);
        }
Beispiel #5
0
            bool DoRemove(string key, int hash)
            {
                Action <object> wrappedReceiver;

                if (this.wrappedReceiverMap.TryGetValue(hash, out wrappedReceiver))
                {
                    this.wrappedReceiverMap.Remove(hash);
                    return(BroadcastTunnel <string, object> .Remove(key, wrappedReceiver, this.group));
                }

                return(false);
            }
Beispiel #6
0
            internal void Notify <V>(string key, V value, Action <V> setFunc = null)
            {
                if (null != setFunc)
                {
                    setFunc(value);
                }

#if LOG_DEBUG
                if ("ticketcharger.updatedms" != key)// TODO: Ignore List
                {
                    Debug.Log(string.Format("OBSERVER:{0}, VALUE:{1}, SET?:{2}", key, value, (null != setFunc)));
                }
#endif// LOG_DEBUG
                BroadcastTunnel <string, object> .Notify(key, value, this.group);
            }
Beispiel #7
0
            internal bool TryNotify <V>(string key, V value, V oldValue, Action <V> setFunc = null)
            {
                if (value.Equals(oldValue))
                {
                    return(false);
                }

                if (null != setFunc)
                {
                    setFunc(value);
                }

#if LOG_DEBUG
                Debug.Log(string.Format("OBSERVER_TRY_SUCCEED:{0}, VALUE:{1}, SET?:{2}", key, value, (null != setFunc)));
#endif// LOG_DEBUG
                BroadcastTunnel <string, object> .Notify(key, value, this.group);

                return(true);
            }
Beispiel #8
0
        static void UpdateScreenLock(bool value)
        {
            if (value == Popup.ScreenLocked)
            {
                return;
            }

            if (value)
            {
                if (Popup.IsShownPop)
                {
                    Popup.ScreenLocked = true;
                    BroadcastTunnel <int, bool> .Notify(Popup.SCREEN_LOCK, true);
                }
            }
            else
            {
                if (!Popup.IsShownPop)
                {
                    Popup.ScreenLocked = false;
                    BroadcastTunnel <int, bool> .Notify(Popup.SCREEN_LOCK, false);
                }
            }
        }
Beispiel #9
0
 public void CloseSingleton()
 {
     BroadcastTunnel <string, object> .RemoveAllByGroup(this.group);
 }
Beispiel #10
0
 internal void Clear()
 {
     this.wrappedReceiverMap.Clear();
     BroadcastTunnel <string, object> .RemoveAllByGroup(this.group);
 }
Beispiel #11
0
 void DoAdd(string key, int hash, Action <object> wrappedReceiver)
 {
     this.wrappedReceiverMap[hash] = wrappedReceiver;
     BroadcastTunnel <string, object> .Add(key, wrappedReceiver, this.group);
 }