public override void OnInspectorGUI() { serializedObject.Update(); CharacterActionBuffComponent component = ((CharacterActionBuffComponent)target); CharacterActionBuffData data = component.data; loop_list.data = data; hit_list.data = data; data.AnimationName = EditorGUILayout.TextField("Animation", data.AnimationName); data.Freeze = EditorGUILayout.Toggle("Freeze", data.Freeze); EditorGUILayout.BeginHorizontal(); int select_index = EditorGUILayout.Popup("State Color", color_container.GetSelectedIndex(data.StateColorName), Names); ColorData new_color; if (select_index == Names.Length - 1) { var color_list = new List <ColorData>(color_container.Colors); new_color = new ColorData(); new_color.name = "New"; color_list.Add(new_color); color_container.Colors = color_list.ToArray(); RefreshNames(); } new_color = color_container.Colors[select_index]; data.StateColorName = new_color.name; Color32 change_color = EditorGUILayout.ColorField(new_color.color); if (change_color.Equals(new_color.color) == false) { new_color.color = change_color; EditorUtility.SetDirty(color_container); } EditorGUILayout.EndHorizontal(); data.TweenName = HFX_TweenSystemInspector.OnInspectorTween(component.GetComponent <HFX_TweenSystem>(), data.TweenName); if (component.sub_components == null) { component.sub_components = new CharacterActionBuffComponent[0]; EditorUtility.SetDirty(target); } SerializedProperty sp = serializedObject.FindProperty("sub_components"); EditorGUILayout.PropertyField(sp, new GUIContent(string.Format("Sub Actions ({0})", component.sub_components.Length)), true); loop_list.OnInspectorGUI(); hit_list.OnInspectorGUI(); if (GUI.changed) { EditorUtility.SetDirty(target); } serializedObject.ApplyModifiedProperties(); }
public CharacterActionBuff(CharacterActionBuffComponent component, float playback_time, Character self, float buff_time, bool is_lighting, float move_scale) { this.m_Name = component.name; this.Data = component.data.Clone(true, self); this.self = self; StartTime = playback_time; m_BuffTime = buff_time; PlaybackTime = playback_time; if (Data.Freeze == true) { self.SetFreeze(); } if (string.IsNullOrEmpty(Data.AnimationName) == false) { m_Length = self.PlayAnimation(Data.AnimationName); } foreach (var effect in Data.loop) { if (self.CharacterAnimation.DummyMode == eCharacterDummyMode.Hidden) { effect.SetHidden(true); } effect.Play(is_lighting, 0f); effect.Update(0f); } if (string.IsNullOrEmpty(Data.TweenName) == false) { HFX_TweenSystem tween_system = component.GetComponent <HFX_TweenSystem>(); if (tween_system != null) { m_TweenBundle = tween_system.Play(Data.TweenName, null, self.GetComponent <HFX_TweenSystem>(), self.transform.GetChild(0), move_scale); } } }