Exemple #1
0
 public void DespawnAll()
 {
     if (spawned)
     {
         spawned = false;
         foreach (GameObject g in activeGuards)
         {
             alarmGuardPool.DevolveInstance(g);
         }
         activeGuards.Clear();
     }
 }
Exemple #2
0
    void Update()
    {
        seconds += Time.deltaTime;

        if (seconds >= time)
        {
            //Debug.Log("devolvido");
            pooling.DevolveInstance(gameObject);
            seconds = 0;
        }
    }
Exemple #3
0
    void Update()
    {
        seconds += Time.deltaTime;

        if (seconds >= time)
        {
            UnityEngine.Rigidbody rb = GetComponent <Rigidbody>();
            rb.velocity        = Vector3.zero;
            rb.angularVelocity = Vector3.zero;
            pooler.DevolveInstance(gameObject);
            seconds = 0;
        }
    }