private void CreateCodeBlock() { var module = m_MainModule.Dereference(m_Registry); var script = m_Registry.CreateScript(UTinyId.New(), UTinyUtility.GetUniqueName(module.EnumerateDependencies().ScriptRefs(), "NewScript")); module.AddScriptReference((UTinyScript.Reference)script); m_TreeView.Reload(); m_TreeView.SetSelection(script.Id); script.TextAsset = CreateTextAsset(script.Name); }
private static void AcceptScript(IDictionary <string, object> dictionary, IRegistry registry) { var scriptId = ParseId(GetValue(dictionary, "Id")); var scriptName = GetValue <string>(dictionary, "Name"); var script = registry.CreateScript(scriptId, scriptName); ParseRegistryObjectBase(script, dictionary); script.Included = ParseBoolean(GetValue(dictionary, "Included")); script.TextAsset = ParseUnityObject(GetValue(dictionary, "TextAsset")) as TextAsset; }