private void PerformActionClipEvent(AvatarController avatar, EditorClipEvent clipEvent) { string type = clipEvent.name; string[] args = GHelper.UF_SplitStringWithCount(clipEvent.GetParam("param"), EditorActionClipTool.GetParamCount(type), '\n'); switch (type) { case "Hit": Action_Hit(avatar, args); break; case "Dip": Action_Dip(avatar, args); break; case "Link": Action_Link(avatar, args); break; case "Efx": Action_Efx(avatar, args); break; case "Sound": Action_Sound(avatar, args); break; case "Efx_Follow": Action_Efx_Follow(avatar, args); break; case "Efx_Target": Action_Efx_Target(avatar, args); break; case "Efx_Range": Action_Efx_Range(avatar, args); break; } }
private void DrawClipEventDetial(EditorClipEvent node) { EditorTools.BeginContents(false); var tempval = string.IsNullOrEmpty(node.name) ? AvatarClipEventType.Null.ToString() : node.name; AvatarClipEventType eventType = (AvatarClipEventType)System.Enum.Parse(typeof(AvatarClipEventType), tempval); // GUI.backgroundColor = Color.cyan; GUILayout.BeginHorizontal(); if (GUILayout.Button(EditorGUIUtility.IconContent("ViewToolOrbit"), GUILayout.Width(25), GUILayout.Height(14))) { if (selectClip != null) { EditorClipEvent target = selectClip.SetAtFirst(node); if (target != null) { SetSelectClipEvent(target); } this.Repaint(); } } GUI.backgroundColor = this.GetColorSet(eventType.ToString()); eventType = (AvatarClipEventType)EditorGUILayout.EnumPopup("", eventType, GUILayout.Height(16)); var scolor = GUI.backgroundColor; GUI.backgroundColor = Color.red; if (GUILayout.Button("x", GUILayout.Height(14), GUILayout.Width(20))) { if (selectClip != null) { selectClip.BeginChange(); selectClip.ListClipEvent.Remove(selectClipEvent); selectClip.EndChange(); this.ClearSelectClipEvent(); this.MarkModified(); if (selectListClipEvent.Count > 0) { mSelectClipEvent = selectListClipEvent[0]; } } } GUI.backgroundColor = scolor; GUILayout.EndHorizontal(); GUI.contentColor = Color.yellow; GUILayout.Label("事件描述: " + EditorActionClipTool.GetDeafultDesc(eventType.ToString())); GUI.contentColor = Color.white; GUILayout.BeginHorizontal(); GUI.backgroundColor = Color.white; string param = node.GetParam("param"); if (param == "") { param = EditorActionClipTool.GetDefaultParams(eventType.ToString()); } if (GUILayout.Button("默认值")) { param = (EditorActionClipTool.GetDefaultParams(node.name)); } GUILayout.EndHorizontal(); GUILayout.Space(2); GUILayout.BeginHorizontal(); // GUI.backgroundColor = Color.clear; GUILayout.TextArea(EditorActionClipTool.GetDefaultDescParam(eventType.ToString()), GUILayout.Width(60)); // GUI.backgroundColor = Color.cyan; param = EditorGUILayout.TextArea(param); GUILayout.EndHorizontal(); EditorTools.EndContents(); if (GUI.changed) { node.name = eventType.ToString(); node["param"] = param; this.MarkModified(); } }