You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.0 KiB
62 lines
1.0 KiB
using UnityEngine; |
|
using System.Collections; |
|
|
|
namespace Fungus |
|
{ |
|
|
|
public abstract class iTweenCommand : Command |
|
{ |
|
public GameObject target; |
|
public float duration = 1f; |
|
public iTween.EaseType easeType = iTween.EaseType.easeInOutQuad; |
|
public iTween.LoopType loopType = iTween.LoopType.none; |
|
public bool waitUntilFinished; |
|
|
|
public override void OnEnter() |
|
{ |
|
if (target == null) |
|
{ |
|
Continue(); |
|
return; |
|
} |
|
|
|
DoTween(); |
|
|
|
if (!waitUntilFinished) |
|
{ |
|
Continue(); |
|
} |
|
} |
|
|
|
public virtual void DoTween() |
|
{} |
|
|
|
protected virtual void OnComplete(object param) |
|
{ |
|
Command command = param as Command; |
|
if (command != null && command.Equals(this)) |
|
{ |
|
if (waitUntilFinished) |
|
{ |
|
Continue(); |
|
} |
|
} |
|
} |
|
|
|
public override string GetSummary() |
|
{ |
|
if (target == null) |
|
{ |
|
return "Error: No target object selected"; |
|
} |
|
|
|
return target.gameObject.name + " over " + duration + " seconds"; |
|
} |
|
|
|
public override Color GetButtonColor() |
|
{ |
|
return new Color32(233, 163, 180, 255); |
|
} |
|
} |
|
|
|
} |