using UnityEngine; using System.Collections; /// /// Class to configure LeanTween more easily /// public class LeanTweenParams { /// /// /// public LeanTweenType easeType = LeanTweenType.linear; public LeanTweenType loopType = LeanTweenType.once; /// /// /// public AnimationCurve animationCurve; /// /// /// public string onComplete; /// /// /// public GameObject onCompleteTarget; /// /// /// public object onCompleteParams; /// /// /// public string onUpdate; /// /// /// public GameObject onUpdateTarget; /// /// /// public Hashtable onUpdateParams; /// /// /// public float delay = 0; /// /// /// public bool orientToPath = false; public LeanTweenParams () { } /// /// Convert to HashTable for use with LeanTween /// /// public Hashtable ToHash() { Hashtable hash = new Hashtable(); hash.Add("delay",delay); hash.Add("loopType", loopType); if(animationCurve != null) { hash.Add("ease", animationCurve); } else { hash.Add("ease", easeType); } hash.Add("orientToPath",orientToPath); if(onUpdate != null) { if (onUpdate != null) { hash.Add("onUpdate", onUpdate); } hash.Add("onUpdateTarget",onUpdateTarget); } if (onUpdateParams != null) { hash.Add("onUpdateParam", onUpdateParams); } if(onComplete != null) { hash.Add("onComplete",onComplete); hash.Add("onCompleteTarget",onCompleteTarget); hash.Add("onCompleteParam",onCompleteParams); } return hash; } }