Scorpio.Script.PushAssembly C# (CSharp) Method

PushAssembly() public method

public PushAssembly ( Assembly assembly ) : void
assembly Assembly
return void
        public void PushAssembly(Assembly assembly)
        {
            if (assembly == null) return;
            if (!m_Assembly.Contains(assembly))
                m_Assembly.Add(assembly);
        }
        public Type GetType(string str) {

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::PushAssembly