public void Draw(List <SkillHsmConfigHSMParameter> parameterList) { EditorGUILayout.BeginHorizontal(); { EditorGUILayout.LabelField("全部变量"); GUILayout.Space(50); if (GUILayout.Button("导入变量")) { HSMFileHandle.ImportParameter(); } } EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginVertical("box", GUILayout.ExpandWidth(true)); { EditorGUILayout.LabelField("条件参数"); scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandHeight(true)); { GUI.backgroundColor = new Color(0.85f, 0.85f, 0.85f, 1f); for (int i = 0; i < parameterList.Count; ++i) { SkillHsmConfigHSMParameter hsmParameter = parameterList[i]; Action DelCallBack = () => { if (null != HSMManager.hSMNodeAddDelParameter) { HSMManager.parameterChange(hsmParameter, false); } }; EditorGUILayout.BeginVertical("box"); { hsmParameter = HSMDrawParameter.Draw(hsmParameter, HSMDrawParameterType.HSM_PARAMETER, DelCallBack); } EditorGUILayout.EndVertical(); } GUI.backgroundColor = Color.white; } EditorGUILayout.EndScrollView(); } EditorGUILayout.EndVertical(); GUILayout.Space(10); EditorGUILayout.BeginVertical("box"); { DrawAddParameter(); } EditorGUILayout.EndVertical(); }
private void DrawAddParameter() { if (null == newAddParameter) { newAddParameter = new SkillHsmConfigHSMParameter(); } EditorGUILayout.BeginVertical("box"); { newAddParameter = HSMDrawParameter.Draw(newAddParameter, HSMDrawParameterType.HSM_PARAMETER_ADD, null); } EditorGUILayout.EndVertical(); GUILayout.Space(5); if (GUILayout.Button("添加条件")) { if (null != HSMManager.hSMNodeAddDelParameter) { HSMManager.parameterChange(newAddParameter, true); } } }