Example #1
0
        private IEnumerator RotateXTo(GameObject go, float from, float to, float time, GameObject ui, SceneOrientation orientation)
        {
            Vector3 rot = new Vector3(from, go.transform.rotation.y, go.transform.rotation.z);

            float t     = 0.0f; // initialize a zero time
            float tConf = 0.1f; // confidence interval for time comparison

            while (t <= time + tConf)
            {
                rot.x = Mathf.Lerp(from, to, t / time);
                go.transform.localEulerAngles = rot;
                t += Time.deltaTime;
                yield return(null);
            }
            currentSceneOrientation = orientation;
            ui.SetActive(true);
            yield return(null);
        }
Example #2
0
 // Use this for initialization
 void Start()
 {
     if (Application.platform == RuntimePlatform.Android && aRCoreParent != null)
     {
         aRKitParent.SetActive(false);
         aRCoreParent.SetActive(true);
     }
     else if (aRKitParent != null)
     {
         aRKitParent.SetActive(true);
         aRCoreParent.SetActive(false);
     }
     if (goEnlarge != null && goMinimize != null)
     {
         goEnlarge.SetActive(false);
         goMinimize.SetActive(true);
     }
     if (goVertical != null && goHorizontal != null)
     {
         goVertical.SetActive(false);
         goHorizontal.SetActive(true);
     }
     currentSceneOrientation = SceneOrientation.Vertical;
 }