private void CommanderEnteredHandler(SquareBehaviour s, Commander c) { if (s.getSerialNr() > highestNr) { highestNr = s.getSerialNr(); } }
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(); } }
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); }