// *********************************************************************************** // CONSTRUCTOR + PARMS CREATOR // *********************************************************************************** /// <summary> /// Called by HOTween each time a new tween is generated via <c>To</c> or similar methods. /// </summary> internal Tweener(object p_target, float p_duration, TweenParms p_parms) { _target = p_target; _duration = p_duration; p_parms.InitializeObject(this, _target); if (plugins != null && plugins.Count > 0) { // Valid plugins were added: mark this as not empty anymore. _isEmpty = false; } SetFullDuration(); }
/// <summary> /// Completely resets the Tweener except its target, /// and applies a new <see cref="TweenType"/>, duration, and <see cref="TweenParms"/>. /// </summary> /// <param name="p_tweenType">New tween type (to/from)</param> /// <param name="p_newDuration">New duration</param> /// <param name="p_newParms">New parameters</param> public void ResetAndChangeParms(TweenType p_tweenType, float p_newDuration, TweenParms p_newParms) { if (_destroyed) { TweenWarning.Log("ResetAndChangeParms can't run because the tween was destroyed - set AutoKill or autoKillOnComplete to FALSE if you want to avoid destroying a tween after completion"); return; } Reset(); _duration = p_newDuration; if (p_tweenType == TweenType.From) { p_newParms = p_newParms.IsFrom(); } p_newParms.InitializeObject(this, _target); if (plugins != null && plugins.Count > 0) { // Valid plugins were added: mark this as not empty anymore. _isEmpty = false; } SetFullDuration(); }
/// <summary> /// Completely resets the Tweener except its target, /// and applies a new <see cref="TweenType"/>, duration, and <see cref="TweenParms"/>. /// </summary> /// <param name="p_tweenType">New tween type (to/from)</param> /// <param name="p_newDuration">New duration</param> /// <param name="p_newParms">New parameters</param> public void ResetAndChangeParms(TweenType p_tweenType, float p_newDuration, TweenParms p_newParms) { if (_destroyed) { TweenWarning.Log("ResetAndChangeParms can't run because the tween was destroyed - set AutoKill or autoKillOnComplete to FALSE if you want to avoid destroying a tween after completion"); return; } Reset(); _duration = p_newDuration; if (p_tweenType == TweenType.From) p_newParms = p_newParms.IsFrom(); p_newParms.InitializeObject(this, _target); if (plugins != null && plugins.Count > 0) { // Valid plugins were added: mark this as not empty anymore. _isEmpty = false; } SetFullDuration(); }