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>(); }
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); }); }
private CombatDamagesHUD GetHUDFromPool() { CombatDamagesHUD hud = null; if (hudsPool.Count > 0) { hud = hudsPool.Pop(); } else { hud = CreateHUD(); } return(hud); }
private void PutHUDInPool(CombatDamagesHUD hud) { hud.Clean(); hud.mDMono.transform.localPosition = new Vector3(2000, 2000, 0); hudsPool.Push(hud); }