public void DeactivateObject(ICanBePooled car) { if (gameObjectPools.ContainsKey(car.Id)) { gameObjectPools[car.Id].DeactivateObject(car); } }
public void UnlockObject(ICanBePooled car) { if (!gameObjectPools.ContainsKey(car.Id)) { return; } gameObjectPools[car.Id].UnlockObject(car); }
public void DeactivateObject(ICanBePooled car) { if (!allPoolObjects.ContainsKey(car.Name) || !car.IsActive) { //Debug.Log("object doesn't exists"); return; } car.SetActive(false); inactiveObjects.Enqueue(car); }
public void UnlockObject(ICanBePooled car) { if (!allPoolObjects.ContainsKey(car.Name)) { //Debug.Log("object doesn't exists"); return; } if (!waitingObjects.TryDequeue(out car)) { return; } inactiveObjects.Enqueue(car); }