Exemplo n.º 1
0
    public static AnimationController AnimateRigidbody(Rigidbody animatedRigidbody, Vector3 newPosition, Vector3 newAngle, float duration, EaseInOutType type, AnimateObjectCompleted animationDelegate, object delegateParameter)
    {
        AnimationController newAnimation = null;
        if (animatedRigidbody != null)
        {
            newAnimation = AnimateObject(animatedRigidbody.gameObject, newPosition, newAngle, duration, type, animationDelegate, delegateParameter);
            newAnimation.m_AnimatedRigidbody = animatedRigidbody;
        }

        return newAnimation;
    }
Exemplo n.º 2
0
    public static AnimationController AnimateCamera(Camera animatedCamera, Vector3 newPosition, Vector3 newAngle, float newOrthographicSize, float duration, EaseInOutType type, AnimateObjectCompleted animationDelegate, object delegateParameter)
    {
        AnimationController newAnimation = null;
        if (animatedCamera != null)
        {
            newAnimation = AnimateObject(animatedCamera.gameObject, newPosition, newAngle, duration, type, animationDelegate, delegateParameter);
            newAnimation.m_AnimatedCamera = animatedCamera;
            newAnimation.m_NewOrthographicSize = Mathf.Clamp(newOrthographicSize, 1, newOrthographicSize);
        }

        return newAnimation;
    }
Exemplo n.º 3
0
    public static AnimationController AnimateObject(GameObject animatedObject, Vector3 newPosition, Vector3 newAngle, float duration, EaseInOutType type, AnimateObjectCompleted animationDelegate, object delegateParameter)
    {
        GameObject newAnimationObj = new GameObject(animatedObject + "_animation");
        //newAnimationObj.transform.parent = animatedObject.transform;

        AnimationController newAnimation = newAnimationObj.AddComponent<AnimationController>();

        newAngle = MathfPlus.GetClosestAngle(animatedObject.transform.eulerAngles, newAngle);

        newAnimation.m_AnimationDelegate = animationDelegate;
        newAnimation.m_DelegateParameter = delegateParameter;

        newAnimation.m_AnimatedObject = animatedObject;
        newAnimation.m_NewPosition = newPosition;
        newAnimation.m_NewAngle = newAngle;
        newAnimation.m_Duration = duration;
        newAnimation.m_Type = type;

        return newAnimation;
    }
Exemplo n.º 4
0
    public static AnimationController AnimateRigidbody(Rigidbody animatedRigidbody, Vector3 newPosition, Vector3 newAngle, float duration, EaseInOutType type, AnimateObjectCompleted animationDelegate, object delegateParameter)
    {
        AnimationController newAnimation = null;

        if (animatedRigidbody != null)
        {
            newAnimation = AnimateObject(animatedRigidbody.gameObject, newPosition, newAngle, duration, type, animationDelegate, delegateParameter);
            newAnimation.m_AnimatedRigidbody = animatedRigidbody;
        }

        return(newAnimation);
    }
Exemplo n.º 5
0
    public static AnimationController AnimateCamera(Camera animatedCamera, Vector3 newPosition, Vector3 newAngle, float newOrthographicSize, float duration, EaseInOutType type, AnimateObjectCompleted animationDelegate, object delegateParameter)
    {
        AnimationController newAnimation = null;

        if (animatedCamera != null)
        {
            newAnimation = AnimateObject(animatedCamera.gameObject, newPosition, newAngle, duration, type, animationDelegate, delegateParameter);
            newAnimation.m_AnimatedCamera      = animatedCamera;
            newAnimation.m_NewOrthographicSize = Mathf.Clamp(newOrthographicSize, 1, newOrthographicSize);
        }

        return(newAnimation);
    }
Exemplo n.º 6
0
    public static AnimationController AnimateObject(GameObject animatedObject, Vector3 newPosition, Vector3 newAngle, float duration, EaseInOutType type, AnimateObjectCompleted animationDelegate, object delegateParameter)
    {
        GameObject newAnimationObj = new GameObject(animatedObject + "_animation");
        //newAnimationObj.transform.parent = animatedObject.transform;

        AnimationController newAnimation = newAnimationObj.AddComponent <AnimationController>();

        newAngle = MathfPlus.GetClosestAngle(animatedObject.transform.eulerAngles, newAngle);

        newAnimation.m_AnimationDelegate = animationDelegate;
        newAnimation.m_DelegateParameter = delegateParameter;

        newAnimation.m_AnimatedObject = animatedObject;
        newAnimation.m_NewPosition    = newPosition;
        newAnimation.m_NewAngle       = newAngle;
        newAnimation.m_Duration       = duration;
        newAnimation.m_Type           = type;

        return(newAnimation);
    }