예제 #1
0
 public void RemoveSystemReference(UTinySystem.Reference system)
 {
     if (s_SystemsProperty.Contains(this, system))
     {
         s_SystemsProperty.Remove(this, system);
     }
 }
        public static void RegisterSystemIdChange(string srcSystemFullName, string dstSystemFullName)
        {
            var name = dstSystemFullName.Substring(dstSystemFullName.LastIndexOf(".", StringComparison.Ordinal) + 1);
            var type = new UTinySystem.Reference(UTinyId.Generate(dstSystemFullName), name);

            Register(UTinyId.Generate(srcSystemFullName), new SystemIdChange(type));
        }
        private void DrawSystemListElement(Rect rect, UTinySystem.Reference reference)
        {
            var system = reference.Dereference(m_Registry);

            using (new GUIColorScope(null == system ? Color.red : !m_AvailableSystems.Contains(reference) ? Color.yellow : Color.white))
            {
                GUI.DrawTexture(new Rect(rect.x, rect.y, 20, 20), UTinyIcons.System);
                EditorGUI.LabelField(new Rect(rect.x + 20, rect.y, rect.width, rect.height), system?.Name ?? reference.Name, EditorStyles.label);
            }
        }
        public static UTinySystem.Reference UpdateReference(UTinySystem.Reference reference)
        {
            UTinyId id;

            do
            {
                var updater = GetSystemUpdater(reference.Id);

                if (null == updater)
                {
                    break;
                }

                id        = reference.Id;
                reference = updater.UpdateReference(reference);
            } while (!id.Equals(reference.Id));

            return(reference);
        }
 public UTinySystem.Reference UpdateReference(UTinySystem.Reference reference)
 {
     return(m_System);
 }
 public SystemIdChange(UTinySystem.Reference system)
 {
     m_System = system;
 }
        public static IEnumerable <UTinyModule> GetModules(IRegistry registry, UTinySystem.Reference reference)
        {
            var modules = registry.FindAllByType <UTinyModule>();

            return(modules.Where(module => module.Systems.Contains(reference)));
        }
예제 #8
0
 public void AddSystemReference(UTinySystem.Reference system)
 {
     s_SystemsProperty.Add(this, system);
 }