RoundManager.cs 877 B

1234567891011121314151617181920212223242526272829303132333435
  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. {
  9. private List<Creature> combatants;
  10. int round;
  11. internal void startFirstRound(List<Creature> combatants)
  12. {
  13. this.combatants = combatants;
  14. round = 1;
  15. makeDecisions();
  16. }
  17. private void makeDecisions()
  18. {
  19. foreach (Creature creature in combatants)
  20. {
  21. if (creature.isHumanControlled())
  22. {
  23. CameraManager.getInstance().focusOnGameObject(creature.gameObject);
  24. // Wait for human decision
  25. }
  26. else
  27. {
  28. ((Skeleton)creature).decideActions(combatants);
  29. // AI make decision
  30. }
  31. }
  32. }
  33. }