Example #1
0
 public override void execute(int frameRate, float delay)
 {
     if (!obj)
     {
         return;
     }
     if (path.Length <= 1)
     {
         return;
     }
     if (getNumberOfFrames() <= 0)
     {
         return;
     }
     // if line
     if (path.Length == 2)
     {
         if (hasCustomEase())
         {
             AMTween.MoveTo(obj.gameObject, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "position", path[1], "easecurve", easeCurve));
         }
         else
         {
             AMTween.MoveTo(obj.gameObject, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "position", path[1], "easetype", (AMTween.EaseType)easeType));
         }
         return;
     }
     // if curve
     if (hasCustomEase())
     {
         AMTween.MoveTo(obj.gameObject, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "path", path, "easecurve", easeCurve));
     }
     else
     {
         AMTween.MoveTo(obj.gameObject, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "path", path, "easetype", (AMTween.EaseType)easeType));
     }
 }
    private static bool parseMoveTo(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("path", a.getVector3Path());                          // move to position
        }
        else if (a.path.Length == 1)
        {
            hash.Add("position", a.path[0].toVector3());                                 // move with path
        }
        else
        {
            Debug.LogWarning("Animator: MoveTo missing 'position' or 'path'.");
            return(false);
        }
        AMTween.MoveTo(getGO(a.go), hash);
        return(true);
    }
Example #3
0
    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);
    }