Ejemplo n.º 1
0
        public override void OnEnable()
        {
            //本单例生效
            _instance = this;

            Hotfix_LT.Messenger.AddListener <Hotfix_LT.Combat.CombatHitDamageEvent>(Hotfix_LT.EventName.CombatHitDamageEvent, OnHitCombatantListener);
        }
Ejemplo n.º 2
0
        public override void OnDisable()
        {
            //本单例失效
            _instance = null;

            Hotfix_LT.Messenger.RemoveListener <Hotfix_LT.Combat.CombatHitDamageEvent>(Hotfix_LT.EventName.CombatHitDamageEvent, OnHitCombatantListener);

            ClearTimer();
            StopAllCoroutines();

            var huds       = hudsPool.ToArray();
            var t          = mDMono.transform;
            var childCount = t.childCount;

            for (int i = 0; i < childCount; ++i)
            {
                var child = t.GetChild(i).GetMonoILRComponent <CombatDamagesHUD>();

                if (child != null && System.Array.Find(huds, hud => hud == child) == null)
                {
                    PutHUDInPool(child);
                }
            }
        }