Scorpio.Script.LoadLibrary C# (CSharp) Method

LoadLibrary() public method

public LoadLibrary ( ) : void
return void
        public void LoadLibrary() {
            LibraryBasis.Load(this);
            LibraryArray.Load(this);
            LibraryString.Load(this);
            LibraryTable.Load(this);
            LibraryJson.Load(this);
            LibraryMath.Load(this);
            LibraryFunc.Load(this);
        }
        public ScriptObject LoadFile(String strFileName)

Usage Example

Example #1
0
 void Start()
 {
     try
     {
         DefaultScriptUserdataDelegateType.SetFactory(new DelegateFactory());
         List<string> scripts = new List<string>();
         scripts.Add("window");
         Script script = new Script();
         Launch.Script = script;
         script.LoadLibrary();
         script.PushAssembly(typeof(int).Assembly);
         script.PushAssembly(typeof(GameObject).Assembly);
         script.PushAssembly(GetType().Assembly);
         script.SetObject("print", new ScorpioFunction(Print));
         for (int i = 0; i < scripts.Count; ++i)
         {
             script.LoadString(scripts[i], (Resources.Load(scripts[i]) as TextAsset).text);
         }
         Util.AddComponent(obj, (ScriptTable)script.GetValue("window"));
     }
     catch (System.Exception ex)
     {
         Debug.LogError("Stack : " + Script.GetStackInfo());
         Debug.LogError("Start is error " + ex.ToString());
     }
 }
All Usage Examples Of Scorpio.Script::LoadLibrary