Пример #1
0
 public static void RepaintAll()
 {
     foreach (var window in s_ActiveWindows)
     {
         window.Repaint();
     }
     UTinyInspector.RepaintAll();
 }
Пример #2
0
        public static void InvalidateDataModel()
        {
            EntityGroupManager?.RecreateEntityGroupGraphs();

            foreach (var window in s_ActiveWindows)
            {
                window.m_TreeView.Invalidate();
                window.Repaint();
            }
            UTinyInspector.RepaintAll();
        }
 protected override void RenameEnded(RenameEndedArgs args)
 {
     if (args.acceptedRename)
     {
         var item      = FindItem(args.itemID, rootItem);
         var node      = item as IEntityTreeItem;
         var entityRef = node.EntityRef;
         var entity    = entityRef.Dereference(m_Context.Registry);
         entity.Name      = args.newName;
         node.EntityRef   = (UTinyEntity.Reference)entity;
         item.displayName = args.newName;
         UTinyInspector.RepaintAll();
     }
 }
Пример #4
0
        public static void InvalidateSceneGraph()
        {
            foreach (var entityGroup in LoadedEntityGroups)
            {
                var graph = EntityGroupManager.GetSceneGraph(entityGroup);
                graph.CommitChanges();
            }

            foreach (var window in s_ActiveWindows)
            {
                window.m_TreeView.Invalidate();
                window.Repaint();
            }
            UTinyInspector.RepaintAll();
        }
        protected override void OnItemClicked(UTinyType type)
        {
            var module = ValueToModules[type];

            foreach (var entity in Entities)
            {
                entity.GetOrAddComponent((UTinyType.Reference)type);
            }

            if (!IsIncluded(module))
            {
                Debug.Log($"{UTinyConstants.ApplicationName}: The '{module.Name}' module was included to the project because the '{type.Name}' component was added to an entity.");
            }
            MainModule.AddExplicitModuleDependency((UTinyModule.Reference)module);
            UTinyHierarchyWindow.InvalidateDataModel();
            UTinyInspector.RepaintAll();
        }
Пример #6
0
        private void ShowRemoveComponent(UTinyType.Reference typeRef)
        {
            var type = typeRef.Dereference(Registry);

            if ((null == type || type.TypeCode == UTinyTypeCode.Component) && TargetType == typeof(UTinyEntity))
            {
                var rect = EditorGUILayout.GetControlRect(false, GUILayout.Width(16.0f));
                if (GUI.Button(rect, UTinyIcons.X_Icon_8, UTinyStyles.MiddleCenteredLabel))
                {
                    var targets = Targets.Cast <UTinyEntity>().ToList();
                    EditorApplication.delayCall += () =>
                    {
                        foreach (var entity in targets.Cast <UTinyEntity>())
                        {
                            entity.RemoveComponent(typeRef);
                        }
                        UTinyHierarchyWindow.InvalidateDataModel();
                        UTinyInspector.RepaintAll();
                    };
                }
                GUILayout.Space(5.0f);
            }
        }
 public static void RepaintAllWindows()
 {
     UTinyProjectWindow.RepaintAll();
     UTinyInspector.RepaintAll();
     UTinyHierarchyWindow.RepaintAll();
 }
        private void DoLayout()
        {
            DoLayoutToolbar();

            if (UTinyEditorApplication.ContextType == EditorContextType.None)
            {
                // No project is open
                DoLayoutNoOpenProject();
            }
            else
            {
                DoLayoutTabs();

                IDrawable panel;

                switch (m_TabType)
                {
                case TabType.Settings:
                {
                    panel = UTinyEditorApplication.ContextType == EditorContextType.Project
                            ? (IDrawable)m_ProjectSettingsPanel
                            : m_ModuleSettingsPanel;
                }
                break;

                case TabType.Modules:
                {
                    panel = m_ModulePanel;
                }
                break;

                case TabType.Scenes:
                {
                    panel = m_EntityGroupPanel;
                }
                break;

                case TabType.Types:
                {
                    panel = m_TypePanel;
                }
                break;

                case TabType.Code:
                {
                    panel = m_CodePanel;
                }
                break;

                case TabType.Assets:
                {
                    panel = m_AssetPanel;
                }
                break;

                case TabType.BuildReport:
                {
                    panel = m_BuildReportPanel;
                }
                break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                if (null == panel)
                {
                    return;
                }

                if (panel.DrawLayout())
                {
                    UTinyInspector.RepaintAll();
                    Repaint();
                }
            }
        }