/// <summary> /// Initializes a new instance of the <see cref="MoreMountains.MMInterface.MMFadeInEvent"/> struct. /// </summary> /// <param name="duration">Duration.</param> public FadeInEvent(float duration, TweenType tween, int id = 0, bool ignoreTimeScale = true, Vector3 worldPosition = new Vector3()) { ID = id; Duration = duration; Curve = tween; IgnoreTimeScale = ignoreTimeScale; WorldPosition = worldPosition; }
public static void Trigger(float duration, TweenType tween, int id = 0, bool ignoreTimeScale = true, Vector3 worldPosition = new Vector3()) { e.ID = id; e.Duration = duration; e.Curve = tween; e.IgnoreTimeScale = ignoreTimeScale; e.WorldPosition = worldPosition; EventManager.TriggerEvent(e); }
protected virtual void StartFading(float initialAlpha, float endAlpha, float duration, TweenType curve, int id, bool ignoreTimeScale) { if (id != ID) { return; } IgnoreTimescale = ignoreTimeScale; EnableFader(); _fading = true; _initialAlpha = initialAlpha; _currentTargetAlpha = endAlpha; _fadeStartedAt = IgnoreTimescale ? Time.unscaledTime : Time.time; _currentCurve = curve; _currentDuration = duration; }
public static Quaternion TweenConstructor(float currentTime, float initialTime, float endTime, Quaternion startValue, Quaternion endValue, TweenType tweenType) { if (tweenType.TweenDefinitionType == TweenDefinitionTypes.MMTween) { return(TweenConstructor(currentTime, initialTime, endTime, startValue, endValue, tweenType.TweenCurve)); } if (tweenType.TweenDefinitionType == TweenDefinitionTypes.AnimationCurve) { return(TweenConstructor(currentTime, initialTime, endTime, startValue, endValue, tweenType.Curve)); } return(Quaternion.identity); }
public static Vector3 TweenConstructor(float currentTime, float initialTime, float endTime, Vector3 startValue, Vector3 endValue, TweenType tweenType) { if (tweenType.TweenDefinitionType == TweenDefinitionTypes.MMTween) { return(TweenConstructor(currentTime, initialTime, endTime, startValue, endValue, tweenType.TweenCurve)); } if (tweenType.TweenDefinitionType == TweenDefinitionTypes.AnimationCurve) { return(TweenConstructor(currentTime, initialTime, endTime, startValue, endValue, tweenType.Curve)); } return(Vector3.zero); }