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"); }
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); } }
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(); }
public void CycleActor() { if (actors.Count < 2) { return; } TurnActor a = actors[0]; RemoveActor(a); AddActor(a); }
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"); } }
public void RemoveActor(TurnActor a) { actors.RemoveActor(a); }
public void AddActor(TurnActor a) { actors.AddActor(a); }
public void AddActorTurn(TurnActor actor) { // Use when a new actor appears in the scene or enabling an actor }
public void RemoveActorTurn(TurnActor actor) { // Use when disabling an actor }
public void SwitchActorTurn(TurnActor actor, Allegiance allegiance) { // Use to switch an actor's turn, for example when turret gets hacked to be ally! }
void Awake() { characterMovement = GetComponent <CharacterMovement>(); turnActor = GetComponent <TurnActor>(); }
void Awake() { actor = GetComponent <TurnActor>(); charMovement = GetComponent <CharacterMovement>(); commDetection.SetActive(false); }