コード例 #1
0
 public void Despawn()
 {
     while (spawnedList.Count > 0)
     {
         GameObjectContainer toDespawn = spawnedList[0];
         spawnedList.RemoveAt(0);
         GameObjUtil.Destroy(toDespawn.gameObject);
     }
 }
コード例 #2
0
 public virtual void despawnAll()
 {
     foreach (string s in spawned.Keys)
     {
         if (spawned[s] != null)
         {
             GameObjUtil.Destroy(spawned[s]);
         }
     }
     spawned.Clear();
     count = 0;
 }
コード例 #3
0
 // Update is called once per frame
 void FixedUpdate()
 {
     if (collisionState.colliderStatus[starPickup])
     {
         Collider2D[] collArr = collisionState.collidingMembers[starPickup];
         foreach (Collider2D coll in collArr)
         {
             GameObjUtil.Destroy(coll.gameObject);
             currentCollected++;
         }
     }
 }
コード例 #4
0
 public void Despawn(string name)
 {
     for (int i = 0; i < spawnedList.Count; i++)
     {
         GameObjectContainer goc = spawnedList[i];
         if (string.Compare(goc.name, name) == 0)
         {
             spawnedList.RemoveAt(i);
             GameObjUtil.Destroy(goc.gameObject);
             i--;
         }
     }
 }
コード例 #5
0
 public virtual bool despawn(string objstr)
 {
     Debug.Log(objstr);
     if (spawned.ContainsKey(objstr))
     {
         if (spawned[objstr] != null)
         {
             GameObjUtil.Destroy(spawned[objstr]);
         }
         spawned.Remove(objstr);
         count--;
         return(true);
     }
     return(false);
 }
コード例 #6
0
    public void Despawn(GameObject go)
    {
        int removeIndex = -1;

        for (int i = 0; i < spawnedList.Count; i++)
        {
            GameObjectContainer goc = spawnedList[i];
            if (go == goc.gameObject)
            {
                removeIndex = i;
            }
        }
        if (removeIndex >= 0)
        {
            GameObjectContainer toRemove = spawnedList[removeIndex];
            spawnedList.RemoveAt(removeIndex);
            GameObjUtil.Destroy(toRemove.gameObject);
        }
    }