Scorpio.Script.LoadString C# (CSharp) Method

LoadString() public method

public LoadString ( String strBuffer ) : ScriptObject
strBuffer String
return ScriptObject
        public ScriptObject LoadString(String strBuffer)
        {
            return LoadString("", strBuffer);
        }
        public ScriptObject LoadString(String strBreviary, String strBuffer)

Same methods

Script::LoadString ( String strBreviary, String strBuffer ) : ScriptObject
Script::LoadString ( String strBreviary, String strBuffer, ScriptContext context, bool clearStack ) : ScriptObject

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