protected virtual void Start()
 {
     UpdateFlags();
     m_commands           = GetCommands().ToArray();
     m_commandsList.Items = m_commands;
     m_commandsList.Expand(m_commands[0]);
 }
Exemplo n.º 2
0
        private void Start()
        {
            m_parentDialog                 = GetComponentInParent <Dialog>();
            m_parentDialog.Ok             += OnOk;
            m_parentDialog.OkText          = m_localization.GetString("ID_RTEditor_SaveAssetsDialog_Save", "Save");
            m_parentDialog.IsOkVisible     = true;
            m_parentDialog.CancelText      = m_localization.GetString("ID_RTEditor_SaveAssetsDialog_Cancel", "Cancel");
            m_parentDialog.IsCancelVisible = true;

            m_treeView      = GetComponentInChildren <VirtualizingTreeView>();
            m_windowManager = IOC.Resolve <IWindowManager>();

            m_treeView.ItemDataBinding  += OnItemDataBinding;
            m_treeView.ItemExpanding    += OnItemExpanding;
            m_treeView.SelectionChanged += OnSelectionChanged;
            m_treeView.ItemDoubleClick  += OnItemDoubleClick;
            m_treeView.CanDrag           = false;
            m_treeView.CanEdit           = false;
            m_treeView.CanUnselectAll    = false;
            m_treeView.CanRemove         = false;

            m_project = IOC.Resolve <IProject>();
            if (m_project == null)
            {
                Debug.LogError("ProjectManager.Instance is null");
                return;
            }

            m_treeView.Items        = new[] { m_project.Root };
            m_treeView.SelectedItem = m_project.Root;
            m_treeView.Expand(m_project.Root);

            Input.ActivateInputField();
        }
 private void UpdateFlagsAndDataBind()
 {
     UpdateFlags();
     m_commands           = GetCommands().ToArray();
     m_commandsList.Items = m_commands;
     if (m_commands.Length > 0)
     {
         m_commandsList.Expand(m_commands[0]);
     }
 }
Exemplo n.º 4
0
 private void Expand(ProjectItem item)
 {
     if (item == null)
     {
         return;
     }
     if (item.Parent != null && !m_treeView.IsExpanded(item.Parent))
     {
         Expand(item.Parent);
     }
     m_treeView.Expand(item);
 }
Exemplo n.º 5
0
        private void ExpandAll(ProjectItem item)
        {
            if (item.Children != null)
            {
                m_treeView.Expand(item);

                foreach (ProjectItem child in item.Children)
                {
                    ExpandAll(child);
                }
            }
        }
Exemplo n.º 6
0
        protected virtual void Expand(ExposeToEditor item)
        {
            if (item == null)
            {
                return;
            }
            ExposeToEditor parent = item.GetParent();

            if (parent != null && !m_treeView.IsExpanded(parent))
            {
                Expand(parent);
            }

            if (item.HasChildren())
            {
                m_treeView.Expand(item);
            }
        }
        private void ExpandAll(ProjectItem root)
        {
            Queue <ProjectItem> q = new Queue <ProjectItem>();

            q.Enqueue(root);
            while (q.Count > 0)
            {
                ProjectItem item = q.Dequeue();
                m_treeView.Expand(item);

                if (item.Children != null)
                {
                    for (int i = 0; i < item.Children.Count; ++i)
                    {
                        q.Enqueue(item.Children[i]);
                    }
                }
            }
        }