private void ReadMovementSequenceFile() { string[] sequence = movementSequenceFile.text.Split(new string[] { Environment.NewLine, " " }, StringSplitOptions.None); for (int i = 0; i < sequence.Length; i++) { string word = sequence[i]; float x, y, t; switch (word) { case "SPAWN": EnemySpawnAction spawn = new EnemySpawnAction(); x = float.Parse(sequence[++i]); y = float.Parse(sequence[++i]); spawn.spawnPosition = new Vector3(x, y, 0); movementSequence.Add(spawn); break; case "MOVE": EnemyMovementAction move = new EnemyMovementAction(); x = float.Parse(sequence[++i]); y = float.Parse(sequence[++i]); move.targetPosition = new Vector3(x, y, 0); t = float.Parse(sequence[++i]); move.moveDuration = t; movementSequence.Add(move); break; case "IDLE": EnemyIdleAction idle = new EnemyIdleAction(); t = float.Parse(sequence[++i]); idle.idleDuration = t; movementSequence.Add(idle); break; } } }
// Start is called before the first frame update void Start() { CurrentAction = EnemyIdleAction.GetInstance(); }
// Start is called before the first frame update void Start() { Status.Hp = 1000000000f; Status.CurrentHp = Status.Hp; CurrentAction = EnemyIdleAction.GetInstance(); }