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; } }
void Update() { if (!Solved && AllLit()) { platform.InteractWithSound(); Solved = true; } }
private void OnPointerClick(BaseEventData eventData) { if (!enabled) { return; } if (FloorController.IsJumpingStatic) { return; } if (GvrPointerInputModule.CurrentRaycastResult.distance <= maxDistance && interactiveObject.CanInteract()) { interactiveObject.InteractWithSound(); } }
void Update() { if (hasInteracted) { return; } foreach (LogicBoolean logicBoolean in logicBooleans) { if (!logicBoolean.Value) { return; } } interactee.InteractWithSound(); hasInteracted = true; }
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)); } }