public ShipActorController GetRandomActor() { int actorLength = this.actors.Length; int randomIndex = Random.Range(0, actorLength); ShipActorController actor = this.actors[randomIndex]; return(actor); }
private void SubscribeToActors(bool subscribe) { for (int i = 0; i < this.actors.Length; i++) { ShipActorController actor = this.actors[i]; if (subscribe) { actor.OnClicked += CheckInput; } else { actor.OnClicked -= CheckInput; } } }
private IEnumerator DisplaySequenceCoroutine(ShipActorController[] sequence, DisplayCallback callback) { float waitTime = GameManager.Instance.WaitTime; yield return(new WaitForSeconds(waitTime)); for (int i = 0; i < sequence.Length; i++) { int index = sequence[i].id; ShipActorController actor = this.actors[index]; actor.Show(true); yield return(new WaitForSeconds(waitTime)); actor.Show(false); yield return(new WaitForSeconds(waitTime / 2)); } callback(); }
public bool IsSameActor(int index, string otherName) { ShipActorController actor = this.GetActor(index); return(actor.name == otherName); }
public void AddActor(ShipActorController actor) { this.length++; this.list.Add(actor); }
private void IncrementSequence() { ShipActorController actor = ship.GetRandomActor(); sequence.AddActor(actor); }