/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: Add your initialization logic here Win1 = new Applications.TestApp1(spriteBatch, Content); Win2 = new Applications.TestApp2(spriteBatch, Content); ClassicWindow Test1 = new ClassicWindow(spriteBatch, Content, GraphicsDevice, Win1); ClassicWindow Test2 = new ClassicWindow(spriteBatch, Content, GraphicsDevice, Win2); Components.Add(Test2); Components.Add(Win2); Components.Add(Test1); Components.Add(Win1); title = new MonoHackTitleScreen(spriteBatch, Content, GraphicsDevice); title.Initialize(); Components.Add(title); base.Initialize(); Console.Title = "MonoHack Engine Console"; Console.WriteLine("[" + DateTime.Now.ToString("MM/dd/yyyy H:mm:ss") + "] MonoHack Engine Initialized."); }
void OnGUI() { if (AlignEditor.editorPath == null) { AlignEditor.editorPath = System.IO.Path.GetDirectoryName(AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this))); } title = "AllIn v" + AlignEditor.VERSION; ImagePosition wasPosition = AlignEditor.ButtonStyle; // v2.0 : automatic layout from ratio width/height if (this.position.width > this.position.height) { EditorGUILayout.BeginHorizontal(); this.minSize = new Vector2(292, 58); } else { // Force image above for vertical layout if (wasPosition == ImagePosition.ImageLeft) { AlignEditor.ButtonStyle = ImagePosition.ImageAbove; } this.minSize = new Vector2(52, 256); } ClassicWindow.DetectAlignAxis(); ClassicWindow.AlignButtonGUI(Selection.transforms, true); GridWindow.GridButtonGUI(Selection.transforms); CameraWindow.CameraButtonGUI(Selection.transforms); AlignEditor.SettingsButtonGUI(); if (this.position.width > this.position.height) { EditorGUILayout.EndHorizontal(); } else { AlignEditor.ButtonStyle = wasPosition; } // Restore the previous state of button style }