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); }
public void Drop(Grabbable grabbable) { grabbable.transform.SetParent(null); grabbable.transform.eulerAngles = new Vector3(0, 0, 0); grabbable.SetSortDistance(grabbable.GetPrevSortDistance()); }