public override void execute(int frameRate, float delay) { if (!obj) { return; } if (endFrame == -1) { return; } if (hasCustomEase()) { AMTween.RotateTo(obj.gameObject, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "rotation", endRotation.eulerAngles, "easecurve", easeCurve)); } else { AMTween.RotateTo(obj.gameObject, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "rotation", endRotation.eulerAngles, "easetype", (AMTween.EaseType)easeType)); } }
private static bool parseRotateTo(JSONAction a) { Hashtable hash = new Hashtable(); hash.Add("disable", true); hash.Add("delay", a.delay); hash.Add("time", a.time); setupHashEase(hash, a); if (a.path.Length >= 1) { hash.Add("rotation", a.path[0].toVector3()); // rotate to eulerAngle } else { Debug.LogWarning("Animator: RotateTo missing 'rotation'."); return(false); } AMTween.RotateTo(getGO(a.go), hash); return(true); }
IEnumerator StoryRoutine() { Camera.main.GetComponent <CameraController>().FadeScreen(true, Color.black, 3f); yield return(new WaitForSeconds(5f)); yield return(StartCoroutine(DisplayCaption("Up until that day, nobody suspected a thing.", 5f))); yield return(new WaitForSeconds(1f)); yield return(StartCoroutine(DisplayCaption("The seabed was only explored by madmen..", 5f))); yield return(new WaitForSeconds(1f)); yield return(StartCoroutine(DisplayCaption("..Who never returned from their voyage.", 5f))); yield return(new WaitForSeconds(1f)); yield return(StartCoroutine(DisplayCaption("On that day, everything changed..", 5f))); yield return(new WaitForSeconds(1f)); yield return(StartCoroutine(DisplayCaption("..When THEY attacked.", 5f))); // yield return new WaitForSeconds(7f); StopCoroutine("TweenBoat"); LeanTween.cancel(boatObject); boatTweening = false; // TentacleTake // Track1 (Translation) GameObject track2OBJ = GameObject.Find("spr_Tentacle"); track2OBJ.transform.position = new Vector3(3.967498f, -3.840069f, 0f); // Set Initial Position AMTween.MoveTo(track2OBJ, AMTween.Hash("delay", 0f, "time", 2.041667f, "position", new Vector3(3.162237f, -2.531516f, 0f), "easetype", "easeInOutQuad")); AMTween.MoveTo(track2OBJ, AMTween.Hash("delay", 2.041667f, "time", 2.083333f, "position", new Vector3(-2.45f, 1.24f, 0f), "easetype", "easeInOutQuad")); AMTween.MoveTo(track2OBJ, AMTween.Hash("delay", 4.125f, "time", 0.4166667f, "position", new Vector3(-4.714787f, -0.3956867f, 0f), "easetype", "easeInOutQuad")); AMTween.MoveTo(track2OBJ, AMTween.Hash("delay", 4.541667f, "time", 0.2083333f, "position", new Vector3(-4.714782f, -5.977065f, 0f), "easetype", "linear")); // Track2 (Rotation) GameObject track3OBJ = track2OBJ; // or use GameObject.Find("spr_Tentacle"); track3OBJ.transform.rotation = new Quaternion(0f, 0f, 0f, 1f); // Set Initial Rotation AMTween.RotateTo(track3OBJ, AMTween.Hash("delay", 4.125f, "time", 0.4166667f, "rotation", new Vector3(0f, 0f, 40.79998f), "easetype", "linear")); // Track3 (Translation) GameObject track4OBJ = GameObject.Find("spr_Boat"); track4OBJ.transform.position = new Vector3(-5.402687f, -0.8655984f, 0f); // Set Initial Position AMTween.MoveTo(track4OBJ, AMTween.Hash("delay", 4.625f, "time", 0.125f, "position", new Vector3(-5.402687f, -3.73f, 0f), "easetype", "linear")); yield return(new WaitForSeconds(6f)); Camera.main.GetComponent <CameraController>().FadeScreen(false, Color.black, 6f); yield return(new WaitForSeconds(8f)); Application.LoadLevel("MainScene"); yield return(0); }