コード例 #1
0
        protected virtual void Start()
        {
            m_projectView   = GetComponent <ProjectView>();
            m_projectTree   = m_projectView.ProjectTree.GetComponent <ProjectTreeViewImpl>();
            m_projectFolder = m_projectView.ProjectFolder.GetComponent <ProjectFolderViewImpl>();
            m_filterInput   = m_projectView.FilterInput;

            m_editor        = IOC.Resolve <IRuntimeEditor>();
            m_windowManager = IOC.Resolve <IWindowManager>();
            m_localization  = IOC.Resolve <ILocalization>();
            m_project       = IOC.Resolve <IProject>();
            if (m_project == null)
            {
                Debug.LogWarning("RTSLDeps.Get.Project is null");
                Destroy(gameObject);
                return;
            }

            m_resourcePreview = IOC.Resolve <IResourcePreviewUtility>();
            if (m_resourcePreview == null)
            {
                Debug.LogWarning("RTEDeps.Get.ResourcePreview is null");
            }

            DockPanel dockPanelsRoot = GetComponent <DockPanel>();

            if (dockPanelsRoot != null)
            {
                dockPanelsRoot.CursorHelper = Editor.CursorHelper;
            }

            UnityEventHelper.AddListener(m_filterInput, inputField => inputField.onValueChanged, OnFiltering);

            m_projectFolder.ItemDoubleClick  += OnProjectFolderItemDoubleClick;
            m_projectFolder.ItemRenamed      += OnProjectFolderItemRenamed;
            m_projectFolder.ItemsDeleted     += OnProjectFolderItemDeleted;
            m_projectFolder.SelectionChanged += OnProjectFolderSelectionChanged;

            m_projectTree.SelectionChanged += OnProjectTreeSelectionChanged;
            m_projectTree.ItemRenamed      += OnProjectTreeItemRenamed;
            m_projectTree.ItemsDeleted     += OnProjectTreeItemDeleted;

            m_project.OpenProjectCompleted    += OnProjectOpenCompleted;
            m_project.CloseProjectCompleted   += OnCloseProjectCompleted;
            m_project.ImportCompleted         += OnImportCompleted;
            m_project.BeforeDeleteCompleted   += OnBeforeDeleteCompleted;
            m_project.DeleteCompleted         += OnDeleteCompleted;
            m_project.RenameCompleted         += OnRenameCompleted;
            m_project.CreateCompleted         += OnCreateCompleted;
            m_project.MoveCompleted           += OnMoveCompleted;
            m_project.SaveCompleted           += OnSaveCompleted;
            m_project.DuplicateItemsCompleted += OnDuplicateCompleted;

            if (m_project.IsOpened)
            {
                m_projectTree.LoadProject(m_project.Root);
                m_projectTree.SelectedItem = m_project.Root;
            }
        }
コード例 #2
0
        private void Start()
        {
            m_impl = GetComponent <ProjectFolderViewImpl>();
            if (!m_impl)
            {
                m_impl = gameObject.AddComponent <ProjectFolderViewImpl>();
            }

            if (!GetComponent <ProjectFolderViewInput>())
            {
                gameObject.AddComponent <ProjectFolderViewInput>();
            }
        }