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

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

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

        sequence.AddActor(actor);
    }