Ejemplo n.º 1
0
 private void CommanderEnteredHandler(SquareBehaviour s, Commander c)
 {
     if (s.getSerialNr() > highestNr)
     {
         highestNr = s.getSerialNr();
     }
 }
Ejemplo n.º 2
0
    private void Update()
    {
        while (connectSquare.getSerialNr() < (highestNr + SquaresAhead))
        {
            connectSquare = GenerateSquare();
            levels.Enqueue(connectSquare);
        }

        while (levels.Count > SquaresTotal)
        {
            SquareBehaviour trail = levels.Dequeue();
            trail.Dissolve();
            levels.Peek().CloseStart();
        }
    }
Ejemplo n.º 3
0
 public void AddSquareFromTutorial(SquareBehaviour s)
 {
     if (s.getSerialNr() < connectSquare.getSerialNr())
     {
         Debug.LogError("squares from tutorial have been added in the wrong sequence; this would have them destroyed in the wrong order");
     }
     else
     {
         this.connectSquare = s;
     }
     s.CommanderEnteredEvent += CommanderEnteredHandler;
     levels.Enqueue(s);
 }