An easy to use Unity 3D library for creating illustrated Interactive Fiction games and more.
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.
|
|
|
using UnityEngine;
|
|
|
|
using System.Collections;
|
|
|
|
|
|
|
|
namespace Fungus
|
|
|
|
{
|
|
|
|
public enum iTweenAxis
|
|
|
|
{
|
|
|
|
None,
|
|
|
|
X,
|
|
|
|
Y,
|
|
|
|
Z
|
|
|
|
}
|
|
|
|
|
|
|
|
public abstract class iTweenCommand : Command
|
|
|
|
{
|
|
|
|
public GameObject target;
|
|
|
|
public string tweenName;
|
|
|
|
public float duration = 1f;
|
|
|
|
public iTween.EaseType easeType = iTween.EaseType.easeInOutQuad;
|
|
|
|
public iTween.LoopType loopType = iTween.LoopType.none;
|
|
|
|
public bool waitUntilFinished = true;
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|