Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class SafeHandle : MonoBehaviour {
- public bool GOGOGO = false;
- private bool OverrideSafe = false;
- private Safe_Script SafeRef;
- private float LerpSpeed = 2.5f;
- private float LerpJuice = 0f;
- StoryController storymanager;
- void Start () {
- SafeRef = GameObject.Find("SafeDial").GetComponent<Safe_Script>();
- storymanager = GameObject.Find ("StoryManager").GetComponent<StoryController> ();
- }
- void Update () {
- if (GOGOGO == false) {
- if(SafeRef.EYYSafeIsNowUnlocked || OverrideSafe)
- {
- transform.localRotation = Quaternion.Lerp(Quaternion.Euler(0f, 0f, 0f), Quaternion.Euler(0f, 40f, 0f), LerpJuice);
- if (LerpJuice < 1)
- {
- LerpJuice = LerpJuice + (LerpSpeed * Time.deltaTime);
- }
- else
- {
- GOGOGO = true;
- storymanager.incrementStage ();
- }
- }
- if(Input.GetKeyDown(KeyCode.Alpha6))
- {
- OverrideSafe = true;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement