Esempio n. 1
0
    public void Throw()
    {
        Vector2 lookDir = Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position;

        grabbing.GetComponent <Rigidbody2D>().velocity = lookDir.normalized * throwForce;
        grabbing = null;
    }
Esempio n. 2
0
 public void Drop()
 {
     grabbing = null;
 }
Esempio n. 3
0
 public void GrabBox(GrabbyBox toGrab)
 {
     toGrab.transform.parent        = grabbedBoxPos;
     toGrab.transform.localPosition = Vector3.zero;
     grabbing = toGrab;
 }