public static ActionBase Create(IAEScriptContext ctx) { var cube = ctx.GetTransform("$cube"); var sphere = ctx.GetTransform("$sphere"); var secondAEX = ctx.GetAEScript("$second_aex"); return (AE.Sequence( // Basic Tween sphere.AEScale(2f, 1f).SetEasing(Easings.BounceOut), AE.Parallel( cube.AEMove(new Vector3(0, -3, 0), 3.5f).SetEasing(Easings.BounceInOut), sphere.AEMove(new Vector3(0, 3, 0), 4.5f).SetEasing(Easings.ElasticOut) ), AE.Parallel( cube.AEMove(new Vector3(0, 3, 0), 2.5f).SetRelative(true).SetEasing(Easings.BackOut), sphere.AEMove(new Vector3(0, -3, 0), 3.5f).SetRelative(true).SetEasing(Easings.QuadOut) ), sphere.AEScale(1f, 1f).SetEasing(Easings.BounceOut), // Coroutine AE.WaitCoroutine(() => DelayCoroutine()), // Play another AEX secondAEX.Create(new Dictionary <string, object> { { "$duration", 10f } }), AE.Debug("All Completed!") )); }
private ActionBase CallAEScript(IAEScriptContext context) { EnsureAEScriptMethod(); if (aeScriptFunc_ != null) { return(aeScriptFunc_(context)); } return(null); }
private static ActionBase CreateActionFromScript(TextAsset script, IAEScriptContext context) { try { var assembly = LoadAssembly(script); var className = script.name; var createMethod = assembly.GetType(className).GetMethod("Create"); return(createMethod.Invoke(null, new object[] { context }) as ActionBase); } catch (Exception) { // Consume it } return(null); }
public IAEScriptContext GetContext(Dictionary <string, object> overrideData = null) { if (overrideData != null) { return(new AEScriptContext(this, overrideData)); } if (defaultContext_ == null) { defaultContext_ = new AEScriptContext(this); } return(defaultContext_); }
public static ActionBase Create(IAEScriptContext ctx) { var sphere2 = ctx.GetTransform("$sphere_2"); var duration = ctx.GetFloat("$duration"); Debug.Log(duration); return (AE.Repeat( AE.Sequence( AE.Debug("playing SecondAEX"), sphere2.AEMove(new Vector3(-5, 0, 0), 1.5f).SetEasing(Easings.BackOut), sphere2.AEPath(duration, new Vector3(0, 5, 0), new Vector3(-5, 0, 0), new Vector3(-3, 2, 0), new Vector3(3, -2, 0), new Vector3(5, 0, 0), new Vector3(0, -5, 0) ) ) ).SetLoops(3)); }