// 소환 딜레이 지나면 몬스터 소환 public void UpdateFrame(float dt) { currentSummonDelay += dt; currentGoldDelay += dt * supplyGold; if (currentGoldDelay > 1) { currentGoldDelay = 0; Gold++; goldText.text = Gold.ToString(); } if (currentSummonDelay >= summonDelay) { currentSummonDelay = 0; if (summonMonsterIndex < currentStageMonsterCount) { GameManager.Instance.EffectSystem.CreateEffect("BeamUpPurple", TileManager.Instance.GetMonsterCastlePos(), new Vector3(0.5f, 0.5f, 0.5f), Quaternion.Euler(new Vector3(-90, 0, 0)), 1); MonsterData monsterInfo = currentStageMonsterData[summonMonsterIndex]; string type = monsterInfo.MonsterType; List <Vector3Int> monsterPath = monsterPathList[UnityEngine.Random.Range(0, monsterPathList.Count)]; MonsterUnit monster = (MonsterUnit)FieldObjectManager.Instance.CreateUnit(monsterInfo.MonsterType); monster.Init(monsterInfo.MonsterHP, monsterInfo.MonsterDamage, monsterPath); stageMonsterList.Add(monster); summonMonsterIndex++; SetSummonDelay(); } } }
public static MonsterDeadEvent Create(MonsterUnit unit, Vector3Int deadPos) { MonsterDeadEvent e = new MonsterDeadEvent(); e.DeadUnit = unit; e.DeadPos = deadPos; return(e); }