public override void draw() { drawInOutPoint(); titleRect = rect; titleRect.height = 20f; extendedRect = rect; extendedRect.y = rect.y + titleRect.height - 1f; extendedRect.height = rect.height - titleRect.height; GUILayout.BeginArea(titleRect, title, GUI.skin.box); GUILayout.EndArea(); GUILayout.BeginArea(extendedRect, GUI.skin.box); GUILayout.BeginVertical(); GUILayout.Space(5f); GUILayout.BeginHorizontal(); GUILayout.Label("Type:", GUILayout.Width(60f)); actionType = (DSFloatToIntType)EditorGUILayout.EnumPopup(actionType); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("Target:", GUILayout.Width(60f)); if (GUILayout.Button(targetString)) { chooseTargetWithDropDown(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("Result:", GUILayout.Width(60f)); if (GUILayout.Button(resultString)) { chooseResultWithDropDown(); } GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.EndArea(); }
public override void load(string save) { string[] saveStrings = save.Split(DataSimulator.DS_SAVELOAD_SEPERATOR); actionType = (DSFloatToIntType)int.Parse(saveStrings [4]); targetString = saveStrings [5]; if (!string.IsNullOrEmpty(targetString)) { string[] splitTargetStrings = targetString.Split('/'); target = (DSFloat)ds.datas.Find(x => x.name.Equals(splitTargetStrings [0])).fields.Find(x => x.name.Equals(splitTargetStrings [1])); } resultString = saveStrings [6]; if (!string.IsNullOrEmpty(resultString)) { string[] splitResultStrings = resultString.Split('/'); result = (DSInt)ds.datas.Find(x => x.name.Equals(splitResultStrings [0])).fields.Find(x => x.name.Equals(splitResultStrings [1])); } }