Exemplo n.º 1
0
 public void FixedUpdate()
 {
     if (ShouldDisapear())
     {
         PigeonFactory.ReturnPigeon(this);
     }
 }
Exemplo n.º 2
0
    public IEnumerator DrawPigeonEvent() //mainn function that draws new event and does it
    {
        while (true)
        {
            yield return(new WaitForSeconds(pigeonTimer));

            Pigeon pigeon = PigeonFactory.GetInstance();
            pigeon.StartMoving();
        }
    }
Exemplo n.º 3
0
 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);
     }
 }
Exemplo n.º 4
0
    private void Awake()
    {
        if (Instance != null)
        {
            throw new ColdCry.Exception.SingletonException("There can be only one object of PigeonFactory on scene!");
        }
        Instance = this;

        pigeons    = new ObjectPool <Pigeon>(pigeon, 6, "Pigeons");
        bodies     = new GeneralObjectPool(8, "BodyParts");
        frontWings = new GeneralObjectPool(8, "FrontWingsPart");
        backWings  = new GeneralObjectPool(8, "BackWingsPart");

        for (var i = 0; i < eachPart; i++)
        {
            bodies.Add(Instantiate(ColdCry.Utility.Random.FromArray(bodiesPrefabs)));
            frontWings.Add(Instantiate(ColdCry.Utility.Random.FromArray(frontWingsPrefabs)));
            backWings.Add(Instantiate(ColdCry.Utility.Random.FromArray(backWingsPrefabs)));
        }
    }