// 设置激活的窗口 public void setActiveWindow(dbwin.WindowBase window) { do { if (window == null) { this.active_window = null; break; } WindowResist resist = this.windows.Find(x => x.window == window); if (resist == null) { break; } if (this.active_window != null) { this.active_window.window.is_active = false; this.active_window = null; } this.active_window = resist; } while(false); }
void OnGUI() { //#if UNITY_EDITOR #if true do { if (!this.is_active) { break; } GUI.depth = GUI_DEPTH; // ウインドウ選択ボタン. float x, y; x = 10.0f; y = Screen.height - 20.0f; foreach (var resist in this.windows) { if (GUI.Button(new Rect(x, y, 100, 20), resist.window.title)) { if (resist == this.active_window) { this.active_window = null; } else { this.active_window = resist; } } x += 100.0f; } // if (this.active_window != null) { var window = this.active_window.window; window.win_rect = GUI.Window(window.id, window.win_rect, debug_window_function, window.title); } } while(false); #endif }
// 注册窗口 public void resisterWindow(dbwin.WindowBase window) { if (this.windows.Count > 0) { dbwin.WindowBase last_win = this.windows[this.windows.Count - 1].window; window.setPosition(last_win.win_rect.x, 20); } float x, y; x = 10.0f + 100.0f * this.windows.Count; y = Screen.height - 20.0f; WindowResist resist = new WindowResist(); resist.window = window; resist.hot_button_rect = new Rect(x, y, 100.0f, 20.0f); this.windows.Add(resist); }
// 윈도 등록. public void resisterWindow(dbwin.WindowBase window) { if(this.windows.Count > 0) { dbwin.WindowBase last_win = this.windows[this.windows.Count - 1].window; window.setPosition(last_win.win_rect.x, 20); } float x, y; x = 10.0f + 100.0f*this.windows.Count; y = Screen.height - 20.0f; WindowResist resist = new WindowResist(); resist.window = window; resist.hot_button_rect = new Rect(x, y, 100.0f, 20.0f); this.windows.Add(resist); }
// 액티브 윈도우를 설정=. public void setActiveWindow(dbwin.Window window) { do { if(window == null) { this.active_window = null; break; } WindowResist resist = this.windows.Find(x => x.window == window); if(resist == null) { break; } if(this.active_window != null) { this.active_window.window.is_active = false; this.active_window = null; } this.active_window = resist; } while(false); }
void OnGUI() { #if UNITY_EDITOR do { if(!this.is_active) { break; } GUI.depth = GUI_DEPTH; // 윈도우 선택 버튼. float x, y; x = 10.0f; y = Screen.height - 20.0f; foreach(var resist in this.windows) { if(GUI.Button(new Rect(x, y, 100, 20), resist.window.title)) { if(resist == this.active_window) { this.active_window = null; } else { this.active_window = resist; } } x += 100.0f; } // if(this.active_window != null) { var window = this.active_window.window; window.win_rect = GUI.Window(window.id, window.win_rect, debug_window_function, window.title); } } while(false); #endif }