Esempio n. 1
0
 public void GetThrown(Vector3 direction)
 {
     if (beingCarried == CarriedState.CARRIED)
     {
         beenThrown = ThrownState.THROWN;
         beingCarried = CarriedState.NOT_CARRIED;
         transform.parent = null;
         rb.isKinematic = false;
         rb.AddForce(direction, ForceMode.VelocityChange);
     }
 }
Esempio n. 2
0
 public void BeInteractedWith(GameObject actor, Transform pos)
 {
     if (beingCarried == CarriedState.NOT_CARRIED)
     {
         // Being picked up
         beingCarried = CarriedState.CARRIED;
         rb.isKinematic = true;
         holder = actor;
         transform.position = pos.position;
         transform.rotation = actor.transform.rotation;
         transform.parent = pos;
     }
 }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        beingCarried = CarriedState.NOT_CARRIED;
        rb = GetComponent<Rigidbody>();
        audioSource = GetComponent<AudioSource>();

        if (leftIKHandle == null || rightIKHandle == null)
        {
            Debug.LogWarning("IK handles are not set for " + gameObject.name);
        }
    }