public void InitMonsters(List <MotionBase> monsters) { UIFightBox.ShowOptMask(); foreach (var monster in _MonsterShowDict.Values) { ResourcePool.Instance.RecvIldeModelItem(monster._MonsterModel.gameObject); } _MonsterShowDict.Clear(); for (int i = 0; i < _HPItem.Count; ++i) { _HPItem[i].gameObject.SetActive(false); if (monsters.Count > i) { MonsterShowInfo monShowInfo = new MonsterShowInfo(); monShowInfo._MonsterInfo = monsters[i]; monShowInfo._UIHPItem = _HPItem[i]; _MonsterShowDict.Add(monsters[i], monShowInfo); } } for (int i = 0; i < monsters.Count; ++i) { Hashtable hash = new Hashtable(); hash.Add("motion", monsters[i]); hash.Add("posIdx", i); hash.Add("posCnt", monsters.Count); ResourcePool.Instance.LoadModel(monsters[i]._MonsterRecord.Model, LoadMonsterFinish, hash); } int waveIdx = BattleField.Instance.StageLogic._Waves.Count - BattleField.Instance._CurWave; _WaveText.text = waveIdx.ToString(); }
public IEnumerator ShowDisappearAnim(MonsterShowInfo monsterInfo) { yield return(new WaitForSeconds(0.3f)); monsterInfo._DeadAnim.transform.position = monsterInfo._MonsterModel.transform.position; monsterInfo._DeadAnim.transform.localPosition += new Vector3(0, 50, 0); monsterInfo._DeadAnim.gameObject.SetActive(true); monsterInfo._DeadAnim.PlayEffect(); PlayerUISound(_DiedSound, 1); yield return(new WaitForSeconds(0.4f)); monsterInfo._MonsterModel.gameObject.SetActive(false); monsterInfo._MonsterModel.PlayIdle(); monsterInfo._UIHPItem.gameObject.SetActive(false); }