Exemple #1
0
    public ShipActorController GetRandomActor()
    {
        int actorLength           = this.actors.Length;
        int randomIndex           = Random.Range(0, actorLength);
        ShipActorController actor = this.actors[randomIndex];

        return(actor);
    }
Exemple #2
0
 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;
         }
     }
 }
Exemple #3
0
    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();
    }
Exemple #4
0
    public bool IsSameActor(int index, string otherName)
    {
        ShipActorController actor = this.GetActor(index);

        return(actor.name == otherName);
    }
Exemple #5
0
 public void AddActor(ShipActorController actor)
 {
     this.length++;
     this.list.Add(actor);
 }
Exemple #6
0
    private void IncrementSequence()
    {
        ShipActorController actor = ship.GetRandomActor();

        sequence.AddActor(actor);
    }