private void Update() { for (int i = 0; i < m_listSOFile_MonsterSpawn.Count; i++) { SOFile_MonsterSpawn p_SOFile_MonsterSpawn = m_listSOFile_MonsterSpawn[i]; if (p_SOFile_MonsterSpawn.f_SpawnTime <= m_listPresentTimeCheck[i]) { m_listPresentTimeCheck[i] = 0f; SpawnMoster(i, false); continue; } else { m_listPresentTimeCheck[i] += Time.deltaTime; } } }
public override void SpawnMoster(int nIndex, bool bFlagMyTeam) { SOFile_MonsterSpawn p_SOFile_MonsterSpawn = m_listSOFile_MonsterSpawn[nIndex]; GameObject p_SpawnMonster = Instantiate(p_SOFile_MonsterSpawn.characterCtrl.gameObject); Vector3 p_VecCharScale = p_SpawnMonster.transform.localScale; p_VecCharScale.x *= -1; p_SpawnMonster.transform.localScale = p_VecCharScale; p_SpawnMonster.tag = bFlagMyTeam ? "Player" : "Enemy"; p_SpawnMonster.transform.position = spawnPos.position; CharactorCtrl nCharacterCtrl = p_SpawnMonster.GetComponent <CharactorCtrl>(); if (nCharacterCtrl != null) { nCharacterCtrl.SetupSpawnBase(this, m_SpawnBaseOtherSide); nCharacterCtrl.SetStat(p_SOFile_MonsterSpawn.characterCtrl.gameObject.name); m_listCharCtrl_Use.Add(nCharacterCtrl); } }