Ejemplo n.º 1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Drill" /*&& player.rotateVelocity.magnitude > keySpeed*/)
        {
            if (!RC.enabled)
            {
                RC.enabled = true;

                foreach (GameObject obj in connectedObjects)
                {
                    obj_RC = obj.GetComponent <RotateContinuously>();
                    if (obj_RC != null)
                    {
                        obj_RC.enabled = true;
                    }
                }
            }
            else
            {
                RC.enabled = false;

                foreach (GameObject obj in connectedObjects)
                {
                    obj_RC = obj.GetComponent <RotateContinuously>();
                    if (obj_RC != null)
                    {
                        obj_RC.enabled = false;
                    }
                }
            }

            //player.rotateVelocity = Vector3.zero;
        }
    }
Ejemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     RC = GetComponent <RotateContinuously>();
 }