Example #1
0
    // Throws the rock
    public override void fling(WandController wand)
    {
        // Only throw if the wand is interacting with the rock and not paused
        if (wand == attachedWand && !Pause_Menu.isPaused)
        {
            isHolding = false;

            mBody.velocity = wand.GetComponent <WandController> ().
                             controller.velocity *Constants.ROCK_SPEED;
            mBody.angularVelocity = wand.GetComponent <WandController> ().
                                    controller.angularVelocity;
        }
    }
Example #2
0
    // pick up / drop  AND  openable behavior
    private Rigidbody GetControllerRigidbody()
    {
        Rigidbody controllerRB = currentInteractor.GetComponent <Rigidbody>();

        if (controllerRB == null)
        {
            Debug.Log("Controller " + currentInteractor + " didn't have a Rigidbody, so adding one. Is that really what we want?");
            controllerRB             = currentInteractor.gameObject.AddComponent <Rigidbody>();
            controllerRB.isKinematic = true;
        }

        return(controllerRB);
    }
Example #3
0
 public void setWand(WandController newWand)
 {
     wand = newWand;
     interactionPoint.position = wand.GetComponent <Transform>().position;
 }