少年修仙传客户端基础资源
dabaoji
2023-11-13 0a23e1b83f8fda8ab9f9e32fe71c26c431faf63a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using UnityEngine;
using UnityEditor;
 
[CustomEditor(typeof(SoConfigBase))]
public class SoConfigBaseEditor : Editor
{
    private GUIContent m_LabelCurve;
    private SerializedProperty m_Curve;
 
    private void OnEnable()
    {
        m_Curve = serializedObject.FindProperty("curve");
        m_LabelCurve = new GUIContent("速度曲线");
    }
 
    public override void OnInspectorGUI()
    {
        serializedObject.Update();
 
        OnDrawInspectorGUI();
 
        if (GUI.changed)
        {
            EditorUtility.SetDirty(target);
            serializedObject.ApplyModifiedProperties();
        }
    }
 
    protected virtual void OnDrawInspectorGUI()
    {
        SoConfigBase _target = target as SoConfigBase;
 
        _target.floodPercent = EditorGUILayout.IntField("血量(万分率)", _target.floodPercent);
        GUILayout.Space(5);
        EditorGUILayout.LabelField("[技能位移]");
        EditorGUILayout.HelpBox("1. 坐标系定义: 横轴为时间,纵轴为速度.\r\n2. 配置的时间尽量把握不要有2次位移的重叠,以免相互干扰,也不要超过总的动画时间.", MessageType.Info);
        _target.curve = AnimationCurveGUI.CurveField("速度曲线", _target.curve);
 
        if (_target.curve == null || _target.curve.keys.Length == 0)
        {
            _target.moveDuration = 0;
        }
        else
        {
            int _length = _target.curve.keys.Length;
            Keyframe _keyFrame = _target.curve.keys[_length - 1];
            _target.moveDuration = _keyFrame.time;
        }
 
        EditorGUILayout.LabelField("位移时间", _target.moveDuration.ToString());
 
        _target.moveThrougthEnable = EditorGUILayout.Toggle("位移是否穿透目标", _target.moveThrougthEnable);
        _target.forceMoveThrougthEnable = EditorGUILayout.Toggle("位移是否强制穿透目标(重量为0)", _target.forceMoveThrougthEnable);
 
        EditorGUILayout.LabelField("[镜头控制]");
 
        _target.cameraSfxId = EditorGUILayout.IntField("摄像机控制配置", _target.cameraSfxId);
 
        EditorGUILayout.LabelField("[技能效果]");
 
        _target.bodyControlId = EditorGUILayout.IntField("控制配置Id", _target.bodyControlId);
        _target.hitType = (E_HitType)EditorGUILayout.EnumPopup("目标被击类型", _target.hitType);
        _target.deadFlyId = EditorGUILayout.IntField("死亡击飞配置Id", _target.deadFlyId);
        _target.hitEffectId = EditorGUILayout.IntField("击中特效", _target.hitEffectId);
        _target.hitPauseTime = EditorGUILayout.IntField("使对方停顿(毫秒)", _target.hitPauseTime);
 
    }
}