Esempio n. 1
0
            protected override void RenderWindow()
            {
                var old_skin = UnityEngine.GUI.skin;

                UnityEngine.GUI.skin = null;
                if (show_planner_)
                {
                    window_rectangle_ = UnityEngine.GUILayout.Window(
                        id: this.GetHashCode(),
                        screenRect: window_rectangle_,
                        func: RenderPlanner,
                        text: "Flight plan",
                        options: UnityEngine.GUILayout.MinWidth(500));
                    const float min_width_on_screen  = 50;
                    const float min_height_on_screen = 50;
                    window_rectangle_.x =
                        UnityEngine.Mathf.Clamp(
                            window_rectangle_.x,
                            -window_rectangle_.width + min_width_on_screen,
                            UnityEngine.Screen.width - min_width_on_screen);
                    window_rectangle_.y =
                        UnityEngine.Mathf.Clamp(
                            window_rectangle_.y,
                            -window_rectangle_.height + min_height_on_screen,
                            UnityEngine.Screen.height - min_height_on_screen);
                    window_rectangle_.InputLock(this);
                }
                else
                {
                    WindowUtilities.ClearLock(this);
                }
                UnityEngine.GUI.skin = old_skin;
            }
            protected override void RenderWindow()
            {
                var old_skin = UnityEngine.GUI.skin;

                UnityEngine.GUI.skin = null;
                if (show_selector_)
                {
                    window_rectangle_ = UnityEngine.GUILayout.Window(
                        id: this.GetHashCode(),
                        screenRect: window_rectangle_,
                        func: RenderSelector,
                        text: name_ + " selection (" + Name() +
                        ")");
                    window_rectangle_.InputLock(this);
                }
                else
                {
                    WindowUtilities.ClearLock(this);
                }
                UnityEngine.GUI.skin = old_skin;
            }
Esempio n. 3
0
            protected override void RenderWindow()
            {
                var old_skin = UnityEngine.GUI.skin;

                UnityEngine.GUI.skin = null;
                if (show_planner_)
                {
                    window_rectangle_ = UnityEngine.GUILayout.Window(
                        id: this.GetHashCode(),
                        screenRect: window_rectangle_,
                        func: RenderPlanner,
                        text: "Flight plan",
                        options: UnityEngine.GUILayout.MinWidth(500));
                    WindowUtilities.EnsureOnScreen(ref window_rectangle_);
                    window_rectangle_.InputLock(this);
                }
                else
                {
                    WindowUtilities.ClearLock(this);
                }
                UnityEngine.GUI.skin = old_skin;
            }
Esempio n. 4
0
 public void Dispose()
 {
     manager_.render_windows -= RenderWindow;
     WindowUtilities.ClearLock(this);
     GC.SuppressFinalize(this);
 }