public void draw(Condition c) { condition = c as VarCondition; EditorGUILayout.BeginHorizontal(); if (Available) { var vars = Controller.Instance.VarFlagSummary.getVars(); var index = Mathf.Max(0, Array.IndexOf(vars, c.getId())); condition.setId(vars[EditorGUILayout.Popup(index >= 0 ? index : 0, vars)]); } else { using (new GUILayout.HorizontalScope(GUILayout.Height(15))) { EditorGUILayout.HelpBox(TC.get("Condition.Var.Warning"), MessageType.Error); } } if (GUILayout.Button("New", collapseStyle, GUILayout.Width(35), GUILayout.Height(15))) { Controller.Instance.ShowInputDialog(TC.get("Vars.AddVar"), TC.get("Vars.AddVarMessage"), DEFAULT_VAR_ID, condition, this); } if (Available) { condition.setState(indexToState[EditorGUILayout.Popup(stateToIndex[condition.getState()], valueStrings)]); condition.setValue(int.Parse(EditorGUILayout.TextField(condition.getValue().ToString()))); } EditorGUILayout.EndHorizontal(); }
public void OnDialogOk(string message, object workingObject = null, object workingObjectSecond = null) { if (string.IsNullOrEmpty(message)) { return; } Controller.Instance.VarFlagSummary.addVar(message); if (condition == null) { condition = new VarCondition(message, 0, 0); } else { condition.setId(message); } }
public void draw(Condition c) { condition = c as VarCondition; EditorGUILayout.BeginHorizontal(); if (Available) { var vars = Controller.Instance.VarFlagSummary.getVars(); var index = Mathf.Max(0, Array.IndexOf(vars, c.getId())); condition.setId(vars[EditorGUILayout.Popup(index >= 0 ? index : 0, vars)]); condition.setState(indexToState[EditorGUILayout.Popup(stateToIndex[condition.getState()], valueStrings)]); condition.setValue(int.Parse(EditorGUILayout.TextField(condition.getValue().ToString()))); } else { EditorGUILayout.HelpBox(TC.get("Condition.Var.Warning"), MessageType.Error); } EditorGUILayout.EndHorizontal(); }
public void draw(Condition c) { condition = c as VarCondition; EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(TC.get("Condition.VarID")); if (Avaiable) { int index = Array.IndexOf(vars, c.getId()); condition.setId(vars[EditorGUILayout.Popup(index >= 0 ? index : 0, vars)]); condition.setState(EditorGUILayout.Popup(c.getState() - 4, types) + 4); condition.setValue(int.Parse(EditorGUILayout.TextField(condition.getValue().ToString()))); } else { EditorGUILayout.HelpBox(TC.get("Condition.Var.Warning"), MessageType.Error); } EditorGUILayout.EndHorizontal(); }
public void OnDialogOk(string message, object workingObject = null, object workingObjectSecond = null) { if (string.IsNullOrEmpty(message)) { return; } Controller.Instance.VarFlagSummary.addVar(message); if (condition == null) { condition = new VarCondition(message, 0, 0); } else { if (!string.IsNullOrEmpty(condition.getId())) { Controller.Instance.VarFlagSummary.deleteVarReference(condition.getId()); } condition.setId(message); } Controller.Instance.VarFlagSummary.addVarReference(message); Controller.Instance.DataModified(); }