Пример #1
0
        public override void OnInspectorGUI()
        {
            // Draw default inspector and add a button
            DrawDefaultInspector();
            Rotator rotator = (Rotator)target;

            if (GUILayout.Button("Rotators Mass Setter"))
            {
                RotatorEditorWindow.Init(); // Pop the editor
            }
        }
Пример #2
0
        public static void Init()
        {
            // Get existing open window or if none, make a new one:
            RotatorEditorWindow window = GetWindow <RotatorEditorWindow>("Rotators Mass Setter");

            // Changing position and resolution of the window
            const int width  = 500;
            const int height = 700;

            var x = (Screen.currentResolution.width - width) / 2;
            var y = (Screen.currentResolution.height - height) / 2;

            window.position = new Rect(x, y, width, height);
        }