Example #1
0
 private void OnTriggerEnter(Collider other)
 {
     //base.OnTriggerEnter(other);
     if (other.GetComponent <shipWheelOffStraightedge>() != null && !(other.GetComponent <AnchorableBehaviour>().isAttached))
     {
         WheelType = other.GetComponent <shipWheelOffStraightedge>().thisWheelType;
     }
 }
Example #2
0
        private void spindleToggle(shipWheelOffStraightedge.wheelType wheelType)
        {
            Transform shipsWheel = null;

            Transform[] wheelsArray = new Transform[3] {
                shipsWheel_revolve, shipsWheel_hoist, shipsWheel_rotate
            };
            switch (wheelType)
            {
            case shipWheelOffStraightedge.wheelType.revolve:
                shipsWheel = shipsWheel_revolve;
                GetComponent <Leap.Unity.Interaction.InteractionBehaviour>().ignoreGrasping = true;
                break;

            //the hoist case should be depreciated.
            case shipWheelOffStraightedge.wheelType.hoist:
                shipsWheel = shipsWheel_hoist;
                break;

            case shipWheelOffStraightedge.wheelType.rotate:
                shipsWheel = shipsWheel_rotate;
                break;

            case shipWheelOffStraightedge.wheelType.off:
                spindleOff();
                return;
            }
            foreach (Transform wheel in wheelsArray)
            {
                wheel.gameObject.SetActive(false);
            }
            shipsWheel.gameObject.SetActive(true);
            //shipWCollider.enabled = true;
            //gameObject.GetComponent<CapsuleCollider>().enabled = false;
            spindle = true;

            shipsWheel.transform.position = center;
            shipsWheel.transform.rotation = Quaternion.FromToRotation(Vector3.forward, normalDir);
        }