Esempio n. 1
0
    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();
    }
Esempio n. 2
0
    public CharacterActionBuffData Clone(bool forPlay, Character self)
    {
        CharacterActionBuffData action = new CharacterActionBuffData();

        action.AnimationName  = this.AnimationName;
        action.TweenName      = this.TweenName;
        action.Freeze         = this.Freeze;
        action.StateColorName = this.StateColorName;

        action.loop = new CharacterAction_Effect[loop.Length];
        for (int i = 0; i < loop.Length; ++i)
        {
            action.loop[i] = loop[i].Clone(forPlay == true?action:null, self);
        }

        action.hit = this.hit;

        return(action);
    }
Esempio n. 3
0
    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);
            }
        }
    }
Esempio n. 4
0
 public ActionEffectHitList(CharacterActionBuffData data)
     : base(s_Util, "Hit", false)
 {
     this.data = data;
 }
Esempio n. 5
0
 public ActionEffectLoopList(CharacterActionBuffData data)
     : base(s_Util, "Loop", false)
 {
     this.data = data;
 }