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());
}
}