protected override void proceedAnimating() { base.proceedAnimating(); Vector3 newScale = transform.localScale; newScale.Scale(TransformTweener.GetInverseVectorForTweenerType(tweenerType)); newScale += currentValue * TransformTweener.GetVectorForTweenerType(tweenerType); transform.localScale = newScale; }
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); }
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; } }
private void Awake() { instance = this; }