protected void Start() { nestManager = GameObject.FindObjectOfType <NestManager>(); if (CurrentOrder == null) { NestInstance potentialNest = nestManager.RandomNest(); if (potentialNest != null) { CurrentInstruction = new Goto(potentialNest.nestPosition + Vector3.forward, 0, this); Instructions.Push(new CreateNest(nestPrefab, potentialNest, protectionTimer, this)); } } }
protected override void RanOutOfInstructions() { NestInstance potentialNest = nestManager.RandomNest(); if (potentialNest != null) { Instructions.Push(new CreateNest(nestPrefab, potentialNest, protectionTimer, this)); CurrentInstruction = new Goto(potentialNest.nestPosition + Vector3.forward, 0, this); } else { CurrentInstruction = new Goto(homeNest.transform.position + Vector3.forward, 0, this); Instructions.Push(new Goto(nestManager.OccupiedNests().nestPosition, protectionTimer, this)); } }