Beispiel #1
0
    private void RotateHolder(bool slideIsInPlace)
    {
        GetComponent <Animator>().enabled = false;
        Vector3 currentRotation = transform.localRotation.eulerAngles;
        float   angle;

        if (slideIsInPlace)
        {
            angle = sampleInPlaceRot;
            if (firstTouch)
            {
                helpController.NextInstruction();
                firstTouch = false;
                Debug.Log("SlideHolder - NextHelp");
            }
        }
        else
        {
            angle = noSampleRot;
        }

        if (currentRotation.z < angle - buffer)
        {
            transform.Rotate(Vector3.forward * rotationSpeed * Time.deltaTime);
        }
        else
        {
            atTarget = true;
        }
        //Debug.Log("Rotating holder");
    }
Beispiel #2
0
 public void Rotate(string direction)
 {
     if (firstTouch)
     {
         otherOcular.firstTouchUsed();
         firstTouch = false;
         helpController.NextInstruction();
         //Debug.Log($"OcularRotator{this.gameObject.name} - NextHelp");
     }
     if (direction == "UP")
     {
         rotUp   = true;
         rotDown = false;
     }
     else if (direction == "DOWN")
     {
         rotDown = true;
         rotUp   = false;
     }
     else if (direction == "NONE")
     {
         rotUp = rotDown = false;
     }
 }