コード例 #1
0
        public ScenesWindow(Rect rect, GUIStyle style, params GUILayoutOption[] options)
            : base(rect, new GUIContent(TC.get("Element.Name1")), style, options)
        {
            var content = new GUIContent();

            // Button
            content.image = (Texture2D)Resources.Load("EAdventureData/img/icons/scenes", typeof(Texture2D));
            content.text  = TC.get("Element.Name1");
            ButtonContent = content;

            // Windows
            scenesWindowActiveAreas = new ScenesWindowActiveAreas(rect,
                                                                  new GUIContent(TC.get("ActiveAreasList.Title")), "Window");
            scenesWindowAppearance = new ScenesWindowAppearance(rect, new GUIContent(TC.get("Scene.LookPanelTitle")),
                                                                "Window");
            scenesWindowDocumentation = new ScenesWindowDocumentation(rect,
                                                                      new GUIContent(TC.get("Scene.DocPanelTitle")), "Window");
            scenesWindowElementReference = new ScenesWindowElementReference(rect,
                                                                            new GUIContent(TC.get("ItemReferencesList.Title")), "Window");
            scenesWindowExits = new ScenesWindowExits(rect, new GUIContent(TC.get("Element.Name3")), "Window");

            scenesWindowBarriers       = new ScenesWindowBarriers(rect, new GUIContent(TC.get("BarriersList.Title")), "Window");
            scenesWindowPlayerMovement = new ScenesWindowPlayerMovement(rect, new GUIContent(TC.get("Trajectory.Title")), "Window");


            selectedButtonSkin = (GUISkin)Resources.Load("Editor/ButtonSelected", typeof(GUISkin));

            GenerateToggleList();
        }
コード例 #2
0
        public void ShowItemWindowView(int s)
        {
            GameRources.GetInstance().selectedSceneIndex = s;
            isConcreteItemVisible = true;
            // Generate new toogle list - maybe user already created new scenes?
            GenerateToggleList();

            // Reload windows for newly selected scene
            scenesWindowActiveAreas = new ScenesWindowActiveAreas(m_Rect, new GUIContent(TC.get("ActiveAreasList.Title")),
                                                                  "Window");
            scenesWindowAppearance = new ScenesWindowAppearance(m_Rect, new GUIContent(TC.get("Scene.LookPanelTitle")),
                                                                "Window");
            scenesWindowDocumentation = new ScenesWindowDocumentation(m_Rect,
                                                                      new GUIContent(TC.get("Scene.DocPanelTitle")), "Window");
            scenesWindowElementReference = new ScenesWindowElementReference(m_Rect,
                                                                            new GUIContent(TC.get("ItemReferencesList.Title")), "Window");
            scenesWindowExits = new ScenesWindowExits(m_Rect, new GUIContent(TC.get("Element.Name3")), "Window");

            // Only visible for 3rd person
            if (Controller.getInstance().playerMode() == DescriptorData.MODE_PLAYER_3RDPERSON)
            {
                scenesWindowBarriers       = new ScenesWindowBarriers(m_Rect, new GUIContent(TC.get("BarriersList.Title")), "Window");
                scenesWindowPlayerMovement = new ScenesWindowPlayerMovement(m_Rect, new GUIContent(TC.get("Trajectory.Title")), "Window");
            }
        }
コード例 #3
0
        public override void Draw(int aID)
        {
            dataControlList.index = GameRources.GetInstance().selectedSceneIndex;
            // SceneEditor population
            if (GameRources.GetInstance().selectedSceneIndex != -1)
            {
                var scene = Controller.Instance.SelectedChapterDataControl.getScenesList().getScenes()[GameRources.GetInstance().selectedSceneIndex];

                sceneEditor.Components = EditorWindowBase.Components;
                var allElements = new List <DataControl>();
                allElements.AddRange(scene
                                     .getReferencesList()
                                     .getAllReferencesDataControl()
                                     .FindAll(elem => elem.getErdc() != null)
                                     .ConvertAll(elem => elem.getErdc() as DataControl));
                allElements.AddRange(scene.getActiveAreasList().getActiveAreas().Cast <DataControl>());
                allElements.AddRange(scene.getExitsList().getExits().Cast <DataControl>());

                var playerMode = ScenesWindowPlayerMovement.PlayerMode.NoPlayer;
                if (Controller.Instance.PlayerMode == Controller.FILE_ADVENTURE_3RDPERSON_PLAYER)
                {
                    allElements.AddRange(scene.getBarriersList().getBarriers().Cast <DataControl>());
                    playerMode = ScenesWindowPlayerMovement.GetScenePlayerMode(scene);
                }
                switch (playerMode)
                {
                case ScenesWindowPlayerMovement.PlayerMode.InitialPosition:
                    allElements.Add(Controller.Instance.SelectedChapterDataControl.getPlayer());
                    break;

                case ScenesWindowPlayerMovement.PlayerMode.Trajectory:
                    allElements.AddRange(scene.getTrajectory().getNodes().Cast <DataControl>());
                    allElements.AddRange(scene.getTrajectory().getSides().Cast <DataControl>());
                    allElements.Add(scene.getTrajectory());
                    break;
                }
                sceneEditor.Elements = allElements;
            }

            // Send the callback back
            base.Draw(aID);
        }