예제 #1
0
    void Update()
    {
        if (clickable.IsClicked())
        {
            forward = !forward;
            audioSource.Play();
        }

        float deltaAngle = speed * myDeltaTime;

        if (forward)
        {
            if (angle + deltaAngle > maxAngle)
            {
                deltaAngle = maxAngle - angle;
            }
        }
        else
        {
            deltaAngle *= -1;
            if (angle + deltaAngle < minAngle)
            {
                deltaAngle = minAngle - angle;
            }
        }

        transform.RotateAround(realHinge, axis, deltaAngle);
        angle += deltaAngle;
    }
예제 #2
0
 void Update()
 {
     if (clickable.IsClicked())
     {
         active = !active;
     }
     radiusSphere.gameObject.SetActive(active);
 }
예제 #3
0
 void Update()
 {
     if (clickable.IsClicked())
     {
         if (narration != null)
         {
             FindObjectOfType <Narrator> ().PlayNext(narration);
         }
     }
 }
예제 #4
0
 void Update()
 {
     if (clickable.IsClicked())
     {
         primed = true;
     }
     if (primed)
     {
         life += myDeltaTime / lifeSpan;
     }
     UpdateMaterial();
 }