From 0bae48932eb458eff5efca9a811df6f1ccc96798 Mon Sep 17 00:00:00 2001 From: Shaun M Reed Date: Mon, 4 Sep 2017 13:55:53 -0400 Subject: [PATCH] Excluded file from last commit Forgot one! - Adds rotationPerSec & secPerRotation --- Assets/Scripts/SpinningCube.cs | 37 ++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/SpinningCube.cs b/Assets/Scripts/SpinningCube.cs index 009451a..f16aea7 100644 --- a/Assets/Scripts/SpinningCube.cs +++ b/Assets/Scripts/SpinningCube.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.UI; using System.Collections; public class SpinningCube : MonoBehaviour @@ -6,7 +7,9 @@ public class SpinningCube : MonoBehaviour //Playerdata -- Needs saved public float currentSpeed = 20f; - public float currentIncrement = 10f; + public float currentIncrement = 20f; + public float rotationPerSec = 0.0f; + private string RotationDirection = "Up"; private Vector3 m_RotationDirection = Vector3.up; @@ -17,12 +20,29 @@ public class SpinningCube : MonoBehaviour private float angledif, angle1; private float angleSum = 0; + [SerializeField] + private float secPerRotation = 0.0f; + + [SerializeField] + private float lastRPS = 0.0f; + + + [SerializeField] + private float secondsPassed = 0.0f; + [SerializeField] private int rotations; - public void OnDestroy() + public void Start() { - GameObject.FindGameObjectWithTag("GameController").GetComponent().Save(); + + /* + if(GameObject.Find("Rotation Panel").activeSelf) + { + GameObject.Find("Rotation Direction Button").GetComponent