예제 #1
0
    public void path(int x, int y, bool wait = false)
    {
        var routine = mapEvent.PathToRoutine(new Vector2Int(x, y));

        if (wait)
        {
            var context = Global.Instance().Maps.Lua;
            context.RunRoutineFromLua(routine);
        }
        else
        {
            mapEvent.StartCoroutine(routine);
        }
    }
예제 #2
0
    public void Run(string eventName, Action callback = null)
    {
        DynValue function = LuaValue.Table.Get(eventName);

        if (function == DynValue.Nil)
        {
            if (callback != null)
            {
                callback();
            }
        }
        else
        {
            LuaScript script = new LuaScript(context, function);
            mapEvent.StartCoroutine(CoUtils.RunWithCallback(script.RunRoutine(), callback));
        }
    }