Beispiel #1
0
    public void Throw(Grabbable grabbable)
    {
        grabbable.transform.SetParent(null);
        grabbable.transform.eulerAngles = new Vector3(0, 0, 0);
        grabbable.SetSortDistance(grabbable.GetPrevSortDistance());

        float throwVelocityX = 10.0f;

        if (this.transform.localScale.x > 0.0f)
        {
            throwVelocityX = -throwVelocityX;
        }
        grabbable.Throw(new Vector2(throwVelocityX, 3), this.transform.position.y);
    }
Beispiel #2
0
 public void Drop(Grabbable grabbable)
 {
     grabbable.transform.SetParent(null);
     grabbable.transform.eulerAngles = new Vector3(0, 0, 0);
     grabbable.SetSortDistance(grabbable.GetPrevSortDistance());
 }