少年修仙传客户端代码仓库
hch
2025-03-03 28785d6ddf9c08e49527ede9405c7b6c93c6ed32
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
using UnityEngine;
using System.Collections.Generic;
 
#if UNITY_EDITOR
using UnityEditor;
#endif
 
public class MissionTriggerView : MonoBehaviour
{
    /// <summary>
    /// 任务id
    /// </summary>
    public int id;
 
    /// <summary>
    /// 任务状态
    /// </summary>
    public int state;
 
    /// <summary>
    /// 任务触发事件列表
    /// </summary>
    public List<MapEventView> eventList = new List<MapEventView>();
 
}
 
#if UNITY_EDITOR
[CustomEditor(typeof(MissionTriggerView))]
public class MissionTriggerViewEditor : Editor
{
    public override void OnInspectorGUI()
    {
        serializedObject.Update();
 
        MissionTriggerView _target = target as MissionTriggerView;
        Transform _root = _target.transform;
 
        _target.id = EditorGUILayout.IntField("任务ID", _target.id);
        _target.state = EditorGUILayout.IntField("任务状态", _target.state);
        _target.name = string.Format("Mission_{0}", _target.id);
 
        if (GUILayout.Button("新建刷怪数据"))
        {
            RefreshNPCView _refreshNPCView = SoMapView.GeneralRefreshNpcView(_root);
 
            _target.eventList.Add(_refreshNPCView);
 
            Selection.activeGameObject = _refreshNPCView.gameObject;
        }
 
        if (GUILayout.Button("新建障碍点数据"))
        {
            CreateImpasseView _createImpasseView = SoMapView.GeneralCreateImpasseView(_root);
 
            _target.eventList.Add(_createImpasseView);
 
            Selection.activeGameObject = _createImpasseView.gameObject;
        }
 
        if (GUI.changed)
        {
            EditorUtility.SetDirty(target);
            serializedObject.ApplyModifiedProperties();
        }
    }
}
#endif