示例#1
0
    protected virtual void OnUpdate(float dt)
    {
        JSONArray onUpdate = data["on_update"]?.AsArray;

        if (onUpdate != null)
        {
            InterpreterBridge.RunCommands(onUpdate, context);
        }
    }
示例#2
0
    protected virtual void OnExecute(UnitEntity owner, UnitEntity[] targets)
    {
        JSONArray onExecute = data["on_execute"]?.AsArray;

        context                    = new Dictionary <string, object>();
        context["entity"]          = owner;
        owner.variables["targets"] = targets;
        if (onExecute != null)
        {
            InterpreterBridge.RunCommands(onExecute, context);
        }
    }