Ejemplo n.º 1
0
    protected override void proceedAnimating()
    {
        base.proceedAnimating();

        Vector3 newScale = transform.localScale;

        newScale.Scale(TransformTweener.GetInverseVectorForTweenerType(tweenerType));
        newScale += currentValue * TransformTweener.GetVectorForTweenerType(tweenerType);

        transform.localScale = newScale;
    }
Ejemplo n.º 2
0
    public RotationTweener(GameObject gameObject, float duration, TweenerType tweenerType,
                           float targetValue, InterpolationType tweenerInterpolationType = InterpolationType.LINEAR, bool local = false)
    {
        this.local     = local;
        this.transform = gameObject.transform;
        Vector3 rotation = transform.eulerAngles;

        if (local)
        {
            rotation = transform.localEulerAngles;
        }

        float startValue = TransformTweener.GetValueForTweenerType(rotation, tweenerType);

        setup(gameObject, duration, targetValue, startValue, tweenerType, tweenerInterpolationType);
    }
Ejemplo n.º 3
0
    protected override void proceedAnimating()
    {
        base.proceedAnimating();

        if (local)
        {
            Vector3 newPosition = transform.localPosition;
            newPosition.Scale(TransformTweener.GetInverseVectorForTweenerType(tweenerType));
            newPosition += currentValue * TransformTweener.GetVectorForTweenerType(tweenerType);

            transform.localPosition = newPosition;
        }
        else
        {
            Vector3 newPosition = transform.position;
            newPosition.Scale(TransformTweener.GetInverseVectorForTweenerType(tweenerType));
            newPosition += currentValue * TransformTweener.GetVectorForTweenerType(tweenerType);;

            transform.position = newPosition;
        }
    }
Ejemplo n.º 4
0
 private void Awake()
 {
     instance = this;
 }