|
|
@ -4,6 +4,7 @@ using UnityEngine.Serialization; |
|
|
|
|
|
|
|
|
|
|
|
namespace Fungus |
|
|
|
namespace Fungus |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
public enum iTweenAxis |
|
|
|
public enum iTweenAxis |
|
|
|
{ |
|
|
|
{ |
|
|
|
None, |
|
|
|
None, |
|
|
@ -12,12 +13,16 @@ namespace Fungus |
|
|
|
Z |
|
|
|
Z |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public abstract class iTweenCommand : Command |
|
|
|
public abstract class iTweenCommand : Command, IUpdateable |
|
|
|
{ |
|
|
|
{ |
|
|
|
[Tooltip("Target game object to apply the Tween to")] |
|
|
|
// Obsolete: Use _targetObject instead. |
|
|
|
|
|
|
|
[HideInInspector] |
|
|
|
[FormerlySerializedAs("target")] |
|
|
|
[FormerlySerializedAs("target")] |
|
|
|
public GameObject targetObject; |
|
|
|
public GameObject targetObject; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Tooltip("Target game object to apply the Tween to")] |
|
|
|
|
|
|
|
public GameObjectData _targetObject; |
|
|
|
|
|
|
|
|
|
|
|
[Tooltip("An individual name useful for stopping iTweens by name")] |
|
|
|
[Tooltip("An individual name useful for stopping iTweens by name")] |
|
|
|
public string tweenName; |
|
|
|
public string tweenName; |
|
|
|
|
|
|
|
|
|
|
@ -38,7 +43,7 @@ namespace Fungus |
|
|
|
|
|
|
|
|
|
|
|
public override void OnEnter() |
|
|
|
public override void OnEnter() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (targetObject == null) |
|
|
|
if (_targetObject.Value == null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Continue(); |
|
|
|
Continue(); |
|
|
|
return; |
|
|
|
return; |
|
|
@ -47,7 +52,7 @@ namespace Fungus |
|
|
|
if (stopPreviousTweens) |
|
|
|
if (stopPreviousTweens) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Force any existing iTweens on this target object to complete immediately |
|
|
|
// Force any existing iTweens on this target object to complete immediately |
|
|
|
iTween[] tweens = targetObject.GetComponents<iTween>(); |
|
|
|
iTween[] tweens = _targetObject.Value.GetComponents<iTween>(); |
|
|
|
foreach (iTween tween in tweens) { |
|
|
|
foreach (iTween tween in tweens) { |
|
|
|
tween.time = 0; |
|
|
|
tween.time = 0; |
|
|
|
tween.SendMessage("Update"); |
|
|
|
tween.SendMessage("Update"); |
|
|
@ -79,18 +84,33 @@ namespace Fungus |
|
|
|
|
|
|
|
|
|
|
|
public override string GetSummary() |
|
|
|
public override string GetSummary() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (targetObject == null) |
|
|
|
if (_targetObject.Value == null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return "Error: No target object selected"; |
|
|
|
return "Error: No target object selected"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return targetObject.name + " over " + duration + " seconds"; |
|
|
|
return _targetObject.Value.name + " over " + duration + " seconds"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public override Color GetButtonColor() |
|
|
|
public override Color GetButtonColor() |
|
|
|
{ |
|
|
|
{ |
|
|
|
return new Color32(233, 163, 180, 255); |
|
|
|
return new Color32(233, 163, 180, 255); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
// IUpdateable implementation |
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual void UpdateToVersion(int oldVersion, int newVersion) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (oldVersion == 0 && |
|
|
|
|
|
|
|
targetObject != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
_targetObject.gameObjectVal = targetObject; |
|
|
|
|
|
|
|
_targetObject.gameObjectRef = null; |
|
|
|
|
|
|
|
targetObject = null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |