|
|
|
@ -4,6 +4,7 @@ using UnityEngine.Serialization;
|
|
|
|
|
|
|
|
|
|
namespace Fungus |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
public enum iTweenAxis |
|
|
|
|
{ |
|
|
|
|
None, |
|
|
|
@ -12,12 +13,16 @@ namespace Fungus
|
|
|
|
|
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")] |
|
|
|
|
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")] |
|
|
|
|
public string tweenName; |
|
|
|
|
|
|
|
|
@ -38,7 +43,7 @@ namespace Fungus
|
|
|
|
|
|
|
|
|
|
public override void OnEnter() |
|
|
|
|
{ |
|
|
|
|
if (targetObject == null) |
|
|
|
|
if (_targetObject.Value == null) |
|
|
|
|
{ |
|
|
|
|
Continue(); |
|
|
|
|
return; |
|
|
|
@ -47,7 +52,7 @@ namespace Fungus
|
|
|
|
|
if (stopPreviousTweens) |
|
|
|
|
{ |
|
|
|
|
// 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) { |
|
|
|
|
tween.time = 0; |
|
|
|
|
tween.SendMessage("Update"); |
|
|
|
@ -79,18 +84,33 @@ namespace Fungus
|
|
|
|
|
|
|
|
|
|
public override string GetSummary() |
|
|
|
|
{ |
|
|
|
|
if (targetObject == null) |
|
|
|
|
if (_targetObject.Value == null) |
|
|
|
|
{ |
|
|
|
|
return "Error: No target object selected"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return targetObject.name + " over " + duration + " seconds"; |
|
|
|
|
return _targetObject.Value.name + " over " + duration + " seconds"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override Color GetButtonColor() |
|
|
|
|
{ |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |