Exemplo n.º 1
0
 public void NextTurn()
 {
     actorIndex   = (actorIndex + 1) % ActorsWithTurn.Count;
     currentActor = ActorsWithTurn[actorIndex];
     UIManager.Instance.SetActiveTurnMsg(currentActor.Allegiance);
     currentActor.StartTurn();
     currentActor.OnTurnStart();
 }
    void Awake()
    {
        animator = GetComponentInChildren <Animator>();
        Assert.AreNotEqual(animator, null, "Character Movement could not find Animator");

        actor = GetComponent <TurnActor>();
        Assert.AreNotEqual(actor, null, "Character Movement could not find Actor");
    }
Exemplo n.º 3
0
 public void AddActor(TurnActor a)
 {
     actors.Add(a);
     for (int i = actors.Count - 1; i >= 1 && actors[i].initiative < actors[i - 1].initiative; i--)
     {
         Swap(i, i - 1);
     }
 }
Exemplo n.º 4
0
 public void ContinueTurn()
 {
     currentActor = ActorsWithTurn[actorIndex];
     UIManager.Instance.SetActiveTurnMsg(currentActor.Allegiance);
     currentActor.IsActorsTurn = true;
     currentActor.IsInAction   = false;
     CyberonCamera.Instance.SetTarget(currentActor.gameObject);
     CyberonCamera.Instance.Follow();
     currentActor.OnTurnStart();
 }
Exemplo n.º 5
0
    public void CycleActor()
    {
        if (actors.Count < 2)
        {
            return;
        }
        TurnActor a = actors[0];

        RemoveActor(a);
        AddActor(a);
    }
Exemplo n.º 6
0
    public void Swap(int one, int two)
    {
        TurnActor[] backup = new TurnActor[actors.Count];
        actors.CopyTo(backup);

        try
        {
            TurnActor temp = actors[one];
            actors[one] = actors[two];
            actors[two] = temp;
        }
        catch (System.IndexOutOfRangeException)
        {
            actors = new List <TurnActor>(backup);
            Debug.LogWarning("Attempted to Swap two turn actors when there was less than two");
        }
    }
Exemplo n.º 7
0
 public void RemoveActor(TurnActor a)
 {
     actors.RemoveActor(a);
 }
Exemplo n.º 8
0
 public void AddActor(TurnActor a)
 {
     actors.AddActor(a);
 }
Exemplo n.º 9
0
 public void AddActorTurn(TurnActor actor)
 {
     // Use when a new actor appears in the scene or enabling an actor
 }
Exemplo n.º 10
0
 public void RemoveActorTurn(TurnActor actor)
 {
     // Use when disabling an actor
 }
Exemplo n.º 11
0
 public void SwitchActorTurn(TurnActor actor, Allegiance allegiance)
 {
     // Use to switch an actor's turn, for example when turret gets hacked to be ally!
 }
Exemplo n.º 12
0
 void Awake()
 {
     characterMovement = GetComponent <CharacterMovement>();
     turnActor         = GetComponent <TurnActor>();
 }
Exemplo n.º 13
0
 void Awake()
 {
     actor        = GetComponent <TurnActor>();
     charMovement = GetComponent <CharacterMovement>();
     commDetection.SetActive(false);
 }