public void OnMonsterDie(Attacker monster) { //Debug.Log(monster.name); deadCount += 1; SoulPool += monster.SoulPoint;// * SoulRecycle; if (monster is HeroAttacker) { heroDie++; foreach (var item in monsters) { item.GetSoul((int)(monster.SoulPoint * SoulRecycle / monsters.Count)); } } else { monsters.Remove(monster); if (monster.transform == Camera.main.GetComponent <FollowTarget>().target) { Camera.main.GetComponent <FollowTarget>().target = monsters[0].transform; } } hero.GetComponent <skeleton>().OnKillDie(monster.transform); foreach (var item in monsters) { item.GetComponent <ChracterBase>().OnKillDie(monster.transform); } if (SoulPool > 1000 && monsters.Count < SpawnMonsterCount) { CreateMonster(monsterPrefabs[0]); } UpdateUIImmediate(); tarState.SetAttakcer(Camera.main.GetComponent <FollowTarget>().target.GetComponent <Attacker>().Target); }
public void OnMonsterCreate(Attacker monster) { SoulPool -= monster.SoulPoint; if (monster is HeroAttacker) { hero = monster; heroState.SetAttakcer(hero); } else { monsters.Add(monster); } if (SoulLevel > 1) { monster.GetSoul(SoulLevel * 100); SoulPool -= 100 * SoulLevel; } if (updateCor == null && monsters.Count == SpawnMonsterCount) { updateCor = StartCoroutine(UpdaetStatusUI()); } popCount += 1; }