Beispiel #1
0
        public override void Awake()
        {
            base.Awake();

            var t = mDMono.transform;

            HUDTemplate             = (mDMono.ObjectParamList[0] as GameObject).GetMonoILRComponent <CombatDamagesHUD>();
            NewFloatFontHUDTemplate = (mDMono.ObjectParamList[1] as GameObject).GetMonoILRComponent <CombatFloatFontUIHUD>();

            cachedTransform       = mDMono.transform;
            DamageEventTimeRecord = new Dictionary <GameObject, float>();
        }
Beispiel #2
0
        private void ShowDamagesFunc(Transform spawn_point, Vector3 offset, int damage, CombatDamagesHUD.eDamageTextType text_type)
        {
            if (_instance == null || spawn_point == null)
            {
                return;
            }

            CombatDamagesHUD hud = GetHUDFromPool();

            hud.ShowDamage(damage, spawn_point, offset, text_type, delegate()
            {
                PutHUDInPool(hud);
            });
        }
Beispiel #3
0
        private CombatDamagesHUD GetHUDFromPool()
        {
            CombatDamagesHUD hud = null;

            if (hudsPool.Count > 0)
            {
                hud = hudsPool.Pop();
            }
            else
            {
                hud = CreateHUD();
            }

            return(hud);
        }
Beispiel #4
0
 private void PutHUDInPool(CombatDamagesHUD hud)
 {
     hud.Clean();
     hud.mDMono.transform.localPosition = new Vector3(2000, 2000, 0);
     hudsPool.Push(hud);
 }