AddSearchPath() public method

public AddSearchPath ( string path ) : void
path string
return void
コード例 #1
0
ファイル: ScriptsFromFile.cs プロジェクト: benbon/tolua
	void Start () 
    {        
        LuaState lua = new LuaState();
        lua.Start();        
        
        string fullPath = Application.dataPath + "/ToLua/Examples/02_ScriptsFromFile";
        lua.AddSearchPath(fullPath);         
        lua.DoFile("ScriptsFromFile.lua");        
        //lua.DoString("require 'ScriptsFromFile'");                             
        //lua.Require("ScriptsFromFile");                

        lua.Dispose();
	}
コード例 #2
0
 void Start()
 {
     #if UNITY_5
     Application.logMessageReceived += Log;
     #else
     Application.RegisterLogCallback(Log);
     #endif
     lua = new LuaState();
     lua.Start();
     //如果移动了ToLua目录,自己手动修复吧,只是例子就不做配置了
     string fullPath = Application.dataPath + "\\ToLua/Examples/02_ScriptsFromFile";
     lua.AddSearchPath(fullPath);
 }
コード例 #3
0
 void Start()
 {
     #if UNITY_5
     Application.logMessageReceived += Log;
     #else
     Application.RegisterLogCallback(Log);
     #endif
     lua = new LuaState();
     lua.Start();
     //移动了ToLua路径,自己手动修复吧,只是例子就不做配置了
     Debug.Log("Application.dataPath = " + Application.dataPath);
     string fullPath = Application.dataPath + "/LuaFramework/ToLua/Examples/02_ScriptsFromFile";
     lua.AddSearchPath(fullPath);
 }
コード例 #4
0
ファイル: LuaEnv.cs プロジェクト: wwwsosokk/FunSleep
    public static void Init(string mainScript)
    {
        if (string.IsNullOrEmpty(mainScript))
            throw new System.NullReferenceException("Can't found the main script.");

        State = new LuaState();

        // 增加搜索路径
        for (int i = 0; i < globalSearchPaths.Count; ++i)
            State.AddSearchPath(globalSearchPaths[i]);

        State.OpenLibs(LuaDLL.luaopen_pb);
        LuaBinder.Bind(State);
        State.Start();
        State.DoFile(mainScript);
    }