public void FixedUpdate() { if (ShouldDisapear()) { ChopperFactory.ReturnChopper(this); } }
private void Awake() { if (Instance != null) { throw new ColdCry.Exception.SingletonException("There can be only one object of ChopperFactory on scene!"); } Instance = this; choppers = new ObjectPool <Chopper>(chopperPrefab, 5, "Choppers"); }
public IEnumerator DrawChopperEvent() //mainn function that draws new event and does it { while (true) { yield return(new WaitForSeconds(chopperTimer)); Chopper chopper = ChopperFactory.GetInstance(); chopper.StartMoving(); } }
public void OnCountdownEnd(long id, float overtime) { if (id == pigeonId) { Pigeon pigeon = PigeonFactory.GetInstance(); pigeon.StartMoving(); TimerManager.Reset(pigeonId, pigeonTimer); } else if (id == chopperId) { Chopper chopper = ChopperFactory.GetInstance(); chopper.StartMoving(); TimerManager.Reset(chopperId, chopperTimer); } }