Exemple #1
0
 static void OpenWindow()
 {
     instance = GetWindow <MapEditorWindow>();
     instance.Initialize();
     MapPrefabSetUpdater.CheckMapPrefabForder();
     MapEditorWindowFunction.CreateMapScene();
 }
        //

        public MainWindow()
        {
            InitializeComponent();

            TheMainWindow = this;

            if (MainMenuWindow == null)
            {
                MainMenuWindow = new MainMenu();
            }

            if (GameWindow == null)
            {
                GameWindow = new GameWindow();
            }

            if (Drawer == null)
            {
                Drawer = new MapEditorWindow();
            }

            if (ScenarioWindow == null)
            {
                ScenarioWindow = new ScenarioSelectionWindow();
            }

            if (HelpWindow == null)
            {
                HelpWindow = new HelpWindow();
            }
        }
Exemple #3
0
 private void OnEnable()
 {
     MapManager.Clear();
     currentLoadMap = null;
     instance       = this;
     Initialize();
     CheckScenetMapRoot();
 }
Exemple #4
0
    private static void OpenEditor()
    {
//		MapEditorWindow window = EditorWindow.GetWindow<MapEditorWindow>();

        MapEditorWindow window = (MapEditorWindow)EditorWindow.GetWindow(typeof(MapEditorWindow));

        window.Init();
        window.Show();
        // Prevent the window from being destroyed when a new
        // scene is loaded into the editor.
//		UnityEngine.Object.DontDestroyOnLoad(window);
        //		MapEditorWindow.Create();
    }
Exemple #5
0
    /// <summary>
    /// Loads all the libraries for the editors.
    /// </summary>
    void LoadLibraries()
    {
        missionEditor    = new MissionEditorWindow(missionLibrary, missionContainer);
        mapEditor        = new MapEditorWindow(mapLibrary, mapContainer);
        characterEditor  = new CharacterEditorWindow(characterLibrary, characterContainer);
        classEditor      = new ClassEditorWindow(classLibrary, classContainer);
        itemEditor       = new ItemEditorWindow(itemLibrary, itemContainer);
        upgradeEditor    = new UpgradeEditorWindow(upgradeLibrary, upgradeContainer);
        skillEditor      = new SkillEditorWindow(skillLibrary, skillContainer);
        backgroundEditor = new BackgroundEditorWindow(backgroundLibrary, backgroundContainer);
        portraitEditor   = new PortraitEditorWindow(portraitLibrary, portraitContainer, poseList);

        InitializeWindow();
    }
    public static void ShowWindow()
    {
        window = EditorWindow.GetWindow <MapEditorWindow>("Map editor", true);
        window.outlineTexture         = AssetDatabase.LoadAssetAtPath <Texture2D>("Assets/MapEditor/Editor/Textures/outline.png");
        window.selectedOutlineTexture = AssetDatabase.LoadAssetAtPath <Texture2D>("Assets/MapEditor/Editor/Textures/selectedOutline.png");

        window.normalStyle = new GUIStyle
        {
            alignment     = TextAnchor.LowerCenter,
            imagePosition = ImagePosition.ImageAbove,
            fixedHeight   = 115,
            fixedWidth    = 100,
            margin        = new RectOffset(10, 10, 10, 10),
            padding       = new RectOffset(5, 5, 10, 5),
            hover         = new GUIStyleState {
                background = window.outlineTexture
            }
        };

        window.selectedStyle = new GUIStyle
        {
            alignment     = TextAnchor.LowerCenter,
            imagePosition = ImagePosition.ImageAbove,
            fixedHeight   = 115,
            fixedWidth    = 100,
            margin        = new RectOffset(10, 10, 10, 10),
            padding       = new RectOffset(5, 5, 10, 5),
            fontStyle     = FontStyle.Bold,
            normal        = new GUIStyleState {
                background = window.selectedOutlineTexture
            }
        };

        window.prefabs = getPrefabs("Location", PrefabType.Location)
                         .Concat(getPrefabs("Proops", PrefabType.Proop))
                         .Concat(getPrefabs("Characters", PrefabType.Character))
                         .Concat(getPrefabs("Other", PrefabType.Other));

        var location = GameObject.Find("LocationContainer");

        if (location)
        {
            window.existReplaceablePrefabs = location.GetComponentsInChildren <Transform>()
                                             .Skip(1)
                                             .Select(t => t.gameObject)
                                             .ToList();
        }

        SceneView.duringSceneGui += window.onSceneViewGUI;
    }
        //
        public MainWindow()
        {
            InitializeComponent();

            TheMainWindow = this;

            if (MainMenuWindow == null)
                MainMenuWindow = new MainMenu();

            if (GameWindow == null)
                GameWindow = new GameWindow();

            if (Drawer == null)
                Drawer = new MapEditorWindow();

            if (ScenarioWindow == null)
                ScenarioWindow = new ScenarioSelectionWindow();

            if (HelpWindow == null)
                HelpWindow = new HelpWindow();
        }
Exemple #8
0
        private void StartMapEditorClick(object sender, RoutedEventArgs e)
        {
            MapEditorWindow mapEditor = new MapEditorWindow();

            mapEditor.Show();
        }
Exemple #9
0
 static void CreateNewMap()
 {
     MapEditorWindow.ShowWindow();
 }
Exemple #10
0
 static void Init()
 {
     MapEditorWindow mapEditorWindow = (MapEditorWindow)EditorWindow.GetWindow(typeof(MapEditorWindow));
 }
Exemple #11
0
    static void Init()
    {
        MapEditorWindow window = EditorWindow.GetWindow <MapEditorWindow>();

        window.Show();
    }
Exemple #12
0
    public static void EditMapList()
    {
        MapEditorWindow window = EditorWindow.GetWindow <MapEditorWindow>();

        window.Show();
    }
    static void Init()
    {
        MapEditorWindow window = (MapEditorWindow)EditorWindow.GetWindow(typeof(MapEditorWindow));

        window.Show();
    }