Example #1
0
    public void ReleaseAllObjects(Vector2 velocity)
    {
        for (int i = 0; i < objectsToStack.Count; i++)
        {
            objectsToStack[i].SetParent(null, true);

            if (objectsToStack[i].GetComponent <Throwable>() != null)
            {
                Throwable throwable = objectsToStack[i].GetComponent <Throwable>();
                throwable.TogglePhysics(true);
                throwable.SetVelocity(velocity);
            }

            objectsToStack.Remove(objectsToStack[i]);
        }
    }