예제 #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();
    }
예제 #2
0
        override protected void OnInspectorItem(int index, CharacterAction_EffectTarget selected)
        {
            selected.OnInspectorItem(index, selected);

            EditorGUILayout.BeginHorizontal();
//            GUILayout.Space(40f);
            EditorGUIUtility.labelWidth = 40f;
            selected.time_tick          = EditorGUILayout.FloatField("Tick", selected.time_tick, GUILayout.Width(80f));
            selected.count                    = EditorGUILayout.IntField("Count", selected.count, GUILayout.Width(80f));
            selected.AttachParticle           = (eAttachParticle)EditorGUILayout.EnumPopup("Attach", selected.AttachParticle, GUILayout.Width(100f));
            selected.TweenName                = HFX_TweenSystemInspector.OnInspectorTween(character.GetComponent <HFX_TweenSystem>(), selected.TweenName);
            selected.FinishParticleAfterTween = (CharacterAction_EffectTarget.eFinishParticle)EditorGUILayout.EnumPopup("Finish", selected.FinishParticleAfterTween, GUILayout.Width(100f));
            EditorGUILayout.EndHorizontal();
            EditorGUIUtility.labelWidth = 0f;
        }
    public override void OnInspectorGUI()
    {
        CharacterActionHitComponent component = ((CharacterActionHitComponent)target);
        CharacterActionHitData      data      = component.data;

        list.data = data;

        data.AnimationName = EditorGUILayout.TextField("Animation", data.AnimationName);
        data.TweenTarget   = (eCharacterTweenTarget)EditorGUILayout.EnumPopup("Tween Target", data.TweenTarget);
        data.TweenName     = HFX_TweenSystemInspector.OnInspectorTween(component.GetComponent <HFX_TweenSystem>(), data.TweenName);
        list.OnInspectorGUI();

        if (GUI.changed)
        {
            EditorUtility.SetDirty(target);
        }
    }