RoundManager.cs 825 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using RPG_Fight_Test.Assets.Scripts.Creatures;
  6. using UnityEngine;
  7. public class RoundManager : MonoBehaviour {
  8. private List<Creature> combatants;
  9. int round;
  10. internal void StartFirstRound(List<Creature> combatants) {
  11. this.combatants = combatants;
  12. round = 1;
  13. MakeDecisions();
  14. }
  15. private void MakeDecisions() {
  16. foreach (Creature creature in combatants) {
  17. if (creature.IsHumanControlled()) {
  18. CameraManager.GetInstance().FocusOnGameObject(creature.gameObject);
  19. // Wait for human decision
  20. } else {
  21. ((Skeleton)creature).DecideActions(combatants);
  22. // AI make decision
  23. }
  24. }
  25. }
  26. }