public void OnDamage(Event e) { DamageEvent ee = e as DamageEvent; DamageNumItem itemPrefab = null; if (ee.damageInfo.isHeal) { itemPrefab = healItemPrefab; } else if (ee.damageInfo.isCrit) { itemPrefab = critItemPrefab; } else { itemPrefab = normalItemPrefab; } var item = Instantiate(itemPrefab); item.transform.parent = itemPrefab.transform.parent; item.transform.localScale = Vector3.one; item.gameObject.SetActive(true); item.SetData(ee.receiver, (int)ee.damageInfo.damage); items.Add(item); }
public void OnCharacterBorn(Event e) { CharacterBornEvent ee = e as CharacterBornEvent; CharacterMoveBarData d = new CharacterMoveBarData(); d.characer = ee.characer; d.pos = 0; moveBarDatas.Add(d); }
public void OnRoundStart(Event e) { fireRecoverLabel.text = "+" + BattleManager.instance.FireRecovery.ToString(); int n = BattleManager.instance.UserRoundTimes; for (int i = 0; i < 5; i++) { roundTimeMarks[i].SetActive(i < n - 1); } }
public void OnCharacterDead(Event e) { CharacterDeadEvent ee = e as CharacterDeadEvent; var item = items.Find(d => d.data.characer == ee.characer); if (item != null) { items.Remove(item); GameObject.Destroy(item.gameObject); } }
public void OnCharacterBorn(Event e) { CharacterBornEvent ee = e as CharacterBornEvent; var item = Instantiate(itemPrefab); item.transform.parent = itemPrefab.transform.parent; item.transform.localScale = Vector3.one; item.gameObject.SetActive(true); item.SetData(BattleProgress.instance.GetCharacerData(ee.characer)); items.Add(item); }
public void OnCharacterDead(Event e) { CharacterDeadEvent ee = e as CharacterDeadEvent; foreach (var d in moveBarDatas) { if (d.characer == ee.characer) { moveBarDatas.Remove(d); return; } } }
public void OnWaveStart(Event e) { string[] texts = { "一回合", "二回合", "三回合", }; roundLabel.gameObject.SetActive(true); roundLabel.text = texts[BattleManager.instance.CurRound]; var tween = roundLabel.GetComponent <UIPlayTween>(); tween.Play(true); Invoke("HideRoundLabel", 2); }
public void OnChangeFire(Event e) { fireCounLabel.text = BattleManager.instance.FireCount.ToString(); }
public void OnRemoveBuff(Event e) { RemoveBuffEvent ee = e as RemoveBuffEvent; OnBuffChanged(ee.characer); }
public void OnAddBuff(Event e) { AddBuffEvent ee = e as AddBuffEvent; OnBuffChanged(ee.characer); }