Example #1
0
    public static iTweener MoveBy(this GameObject go, float yValue)
    {
        iTweener output = go.AddComponent <iTweener>();



        return(output);
    }
Example #2
0
    public static iTweener ScaleTo(this GameObject go, Vector3 targetScale)
    {
        iTweener output = go.AddComponent <iTweener>();

        output.Subject(go);
        output.type = iTweener.TweenType.ScaleTo;
        output.TargetScale(targetScale);

        return(output);
    }
Example #3
0
    public static iTweener MoveTo(this GameObject go, Vector3[] path)
    {
        iTweener output = go.AddComponent <iTweener>();

        output.Subject(go);
        output.type = iTweener.TweenType.MoveTo;
        output.TargetPositions(path);

        return(output);
    }
Example #4
0
    public static iTweener RotateTo(this GameObject go, Vector3 targetRotation)
    {
        iTweener output = go.AddComponent <iTweener>();

        output.Subject(go);
        output.type = iTweener.TweenType.RotateTo;
        output.TargetRotation(targetRotation);

        return(output);
    }
Example #5
0
    // Note: difference from iTween : rotationAmount here is NOT normalized, so values between [0,360] are expected
    public static iTweener RotateBy(this GameObject go, Vector3 rotationAmount)
    {
        iTweener output = go.AddComponent <iTweener>();

        // iTween itself expects normalized values for RotateBy
        if (rotationAmount.x > 1.0f || rotationAmount.y > 1.0f || rotationAmount.z > 1.0f ||
            rotationAmount.x < -1.0f || rotationAmount.y < -1.0f || rotationAmount.z < -1.0f)
        {
            rotationAmount /= 360.0f;
        }

        output.Subject(go);
        output.type = iTweener.TweenType.RotateBy;
        output.TargetRotation(rotationAmount);

        return(output);
    }
Example #6
0
    protected IEnumerator WaitForTweenFinishRoutine(GameObject subject, string id, iTweener originator)
    {
        GameObject.Destroy(originator);         // Once this coroutine is started on the iTween host game object, the iTween can now be disposed of.

        if (subject == null)
        {
            Debug.LogError("ITweener: Subject of iTween yield routine is null! Breaking immediately.");
            yield break;
        }

        iTween targetTween = null;

        // See commentary in YieldExecute().
        foreach (iTween tween in subject.GetComponents <iTween>())
        {
            if (tween.id == id)
            {
                targetTween = tween;
                break;
            }
        }

        if (targetTween == null)
        {
            Debug.LogWarning("Trying to yield to an iTween that immediately stopped existing. ID generation may have failed. Returned control immediately.");
        }

        // iTween deletes iTweens when they're done. We can use this to get a (slightly hackish) idea of whether they're still running.
        while (targetTween != null)
        {
            yield return(null);
        }

        //Debug.Log("Tween finished.");

        yield break;
    }
Example #7
0
 public iTweenerList( iTweener[] tweenerArray )
 {
     tweeners.AddRange( tweenerArray );
 }