示例#1
0
    void Update()
    {
        if (isMoving)
        {
            moveTimer += Time.deltaTime;

            if (moveTimer >= changeTime)
            {
                moveTimer = 0;
                isMoving  = false;

                transform.localRotation            = Quaternion.Euler(endAngle, 0, 0);
                leverGears.transform.localRotation = transform.localRotation;

                float tmp = startAngle;
                startAngle = endAngle;
                endAngle   = tmp;

                controlledObject.InteractWithSound();
            }

            float t = moveTimer / changeTime;
            transform.localRotation            = Quaternion.Euler(startAngle * (1 - t) + endAngle * t, 0, 0);
            leverGears.transform.localRotation = transform.localRotation;
        }
    }
示例#2
0
 void Update()
 {
     if (!Solved && AllLit())
     {
         platform.InteractWithSound();
         Solved = true;
     }
 }
示例#3
0
    private void OnPointerClick(BaseEventData eventData)
    {
        if (!enabled)
        {
            return;
        }

        if (FloorController.IsJumpingStatic)
        {
            return;
        }

        if (GvrPointerInputModule.CurrentRaycastResult.distance <= maxDistance &&
            interactiveObject.CanInteract())
        {
            interactiveObject.InteractWithSound();
        }
    }
示例#4
0
    void Update()
    {
        if (hasInteracted)
        {
            return;
        }

        foreach (LogicBoolean logicBoolean in logicBooleans)
        {
            if (!logicBoolean.Value)
            {
                return;
            }
        }

        interactee.InteractWithSound();
        hasInteracted = true;
    }
示例#5
0
    void Update()
    {
        if (isMoving)
        {
            moveTimer += Time.deltaTime;

            if (moveTimer >= moveTime)
            {
                moveTimer = 0;
                isMoving  = false;

                transform.localPosition = Vector3.zero;

                controlledObject.InteractWithSound();
            }

            float t = moveTimer / moveTime;
            transform.localPosition = new Vector3(0, 0, amplitude * Mathf.Sin(t * Mathf.PI));
        }
    }