private void CreateSystem()
        {
            var module = m_MainModule.Dereference(m_Registry);
            var system = m_Registry.CreateSystem(UTinyId.New(), UTinyUtility.GetUniqueName(module.EnumerateDependencies().SystemRefs(), "NewSystem"));

            module.AddSystemReference((UTinySystem.Reference)system);
            m_TreeView.Reload();
            m_TreeView.SetSelection(system.Id);
            system.TextAsset = CreateTextAsset(system.Name);
        }
Beispiel #2
0
        private void CreateSystem()
        {
            var module = m_MainModule.Dereference(m_Registry);
            var system = m_Registry.CreateSystem(UTinyId.New(), UTinyUtility.GetUniqueName(module.EnumerateDependencies().SystemRefs(), "NewSystem"));

            system.AddExecuteAfterReference((UTinySystem.Reference)module.Registry.FindByName <UTinySystem>("UserCodeStart"));
            system.AddExecuteBeforeReference((UTinySystem.Reference)module.Registry.FindByName <UTinySystem>("UserCodeEnd"));
            system.TextAsset = CreateTextAsset(system.Name);
            module.AddSystemReference((UTinySystem.Reference)system);

            m_TreeView.Reload();
            m_TreeView.SetSelection(system.Id);
        }
Beispiel #3
0
        private static void AcceptSystem(IDictionary <string, object> dictionary, IRegistry registry)
        {
            var systemId   = ParseId(GetValue(dictionary, "Id"));
            var systemName = GetValue <string>(dictionary, "Name");

            var system = registry.CreateSystem(systemId, systemName);

            ParseRegistryObjectBase(system, dictionary);

            system.Options   = (UTinySystemOptions)ParseInt(GetValue(dictionary, "Options"));
            system.TextAsset = ParseUnityObject(GetValue(dictionary, "TextAsset")) as TextAsset;

            IList <object> componentList;

            if (TryGetValue(dictionary, "Components", out componentList))
            {
                foreach (var obj in componentList)
                {
                    system.AddComponentReference(ParseTypeReference(obj));
                }
            }

            IList <object> executeAfterList;

            if (TryGetValue(dictionary, "ExecuteAfter", out executeAfterList))
            {
                foreach (var obj in executeAfterList)
                {
                    system.AddExecuteAfterReference(ParseSystemReference(obj));
                }
            }

            IList <object> executeBeforeList;

            if (TryGetValue(dictionary, "ExecuteBefore", out executeBeforeList))
            {
                foreach (var obj in executeBeforeList)
                {
                    system.AddExecuteBeforeReference(ParseSystemReference(obj));
                }
            }
        }