void OnGUI() { if (editorSetting == null) { editorSetting = (SE_SkillUIEditorSetting)Resources.Load <SE_SkillUIEditorSetting>("SkillEditorSetting/DarkKnight"); } //Check for null views if (propertyView == null || workView == null) { CreateViews(); return; } if (editorData == null) { editorData = (SE_SkillEditorData)Resources.Load <SE_SkillEditorData>("SkillEditorSetting/SkillEditorData"); workView.curWindow = this; propertyView.curWindow = this; } //get and process the current event Event e = Event.current; ProcessEvents(e); //Update views if (curSkillControl != null) { workView.UpdateView(position, new Rect(0f, 0f, viewPercentage, 1f), e, curSkillControl, editorSetting); propertyView.UpdateView(new Rect(position.width, position.y, position.width, position.height) , new Rect(viewPercentage, 0f, 1 - viewPercentage, 1f), e, curSkillControl, editorSetting); } Repaint(); }
public override void UpdateView(Rect editorRect, Rect percentageRect, Event e, SE_SkillControl curSkillControl, SE_SkillUIEditorSetting editorSetting) { base.UpdateView(editorRect, percentageRect, e, curSkillControl, editorSetting); GUI.Box(viewRect, viewTitle, viewSkin.GetStyle("PropertyViewBG")); GUILayout.BeginArea(viewRect); GUILayout.BeginHorizontal(); if (curSkillControl != null) { bool showProperty = curSkillControl.showProperties; if (!showProperty) { //EditorGUILayout.LabelField("None"); } else { GUILayout.BeginVertical(); curSkillControl.DrawnNodeProperties(inspectorSkin); GUILayout.EndVertical(); } } GUILayout.EndHorizontal(); GUILayout.EndArea(); ProcessEvents(e); }
public override void UpdateView(Rect editorRect, Rect percentageRect, Event e, SE_SkillControl curSkillControl, SE_SkillUIEditorSetting editorSetting) { base.UpdateView(editorRect, percentageRect, e, curSkillControl, editorSetting); GUI.Box(viewRect, viewTitle, viewSkin.GetStyle("ViewBG")); //draw grid SE_SkillUtils.DrawGrid(viewRect, 60f, .15f, Color.white, offset); SE_SkillUtils.DrawGrid(viewRect, 20f, .05f, Color.white, offset); GUILayout.BeginArea(viewRect); if (curSkillControl != null) { curSkillControl.UpdateEditorGUI(e, viewRect, offset, viewSkin, editorSetting); } GUILayout.EndArea(); ProcessEvents(e); }
public virtual void UpdateView(Rect editorRect, Rect percentageRect, Event e, SE_SkillControl curSkillControl, SE_SkillUIEditorSetting editorSetting) { this.skillControl = curSkillControl; viewTitle = curSkillControl != null ? curSkillControl.skillName : "No Graph"; //Update View Rectangle viewRect = new Rect(editorRect.x * percentageRect.x, editorRect.y * percentageRect.y, editorRect.width * percentageRect.width, editorRect.height * percentageRect.height); }