少年修仙传客户端代码仓库
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
using UnityEngine;
using System.Collections.Generic;
 
public class SoMapView : MonoBehaviour
{
    public Transform m_MissionTriggerRoot;
    public Transform m_AreaTriggerRoot;
 
    public int mapID;
 
    public List<MissionTriggerView> m_MissionTriggerViewList = new List<MissionTriggerView>();
    public List<AreaTriggerView> m_AreaTriggerViewList = new List<AreaTriggerView>();
 
    public static RefreshNPCView GeneralRefreshNpcView(SoMap.RefreshNPC source, Transform parent)
    {
        GameObject _refreshNpcGo = GameObject.CreatePrimitive(PrimitiveType.Cube);
        _refreshNpcGo.transform.localScale = .5f * Vector3.one;
        _refreshNpcGo.name = string.Format("RefreshNPC: {0}", source.NpcID);
 
        RefreshNPCView _refreshNPCView = _refreshNpcGo.AddComponent<RefreshNPCView>();
 
        _refreshNPCView.NpcID = source.NpcID;
        _refreshNPCView.npcType = source.npcType;
        _refreshNPCView.randomPostion = source.randomPostion;
        _refreshNPCView.randomDist = source.randomDist;
        _refreshNPCView.count = source.count;
        _refreshNPCView.refreshInterval = source.refreshInterval;
        _refreshNPCView.waveCount = source.waveCount;
        _refreshNPCView.waveInterval = source.waveInterval;
 
        _refreshNPCView.transform.position = source.position;
        _refreshNPCView.transform.eulerAngles = source.eulerAngles;
 
        _refreshNPCView.transform.SetParent(parent);
 
        return _refreshNPCView;
    }
 
    public static RefreshNPCView GeneralRefreshNpcView(Transform parent)
    {
        GameObject _refreshNpcGo = GameObject.CreatePrimitive(PrimitiveType.Cube);
        _refreshNpcGo.name = "RefreshNPC: -";
        _refreshNpcGo.transform.localScale = .5f * Vector3.one;
        RefreshNPCView _refreshNPCView = _refreshNpcGo.AddComponent<RefreshNPCView>();
 
        _refreshNPCView.evenType = SoMap.E_EventType.RefreshNpc;
        _refreshNPCView.NpcID = 0;
        _refreshNPCView.randomPostion = false;
        _refreshNPCView.randomDist = 0;
        _refreshNPCView.count = 1;
        _refreshNPCView.refreshInterval = 0;
        _refreshNPCView.waveCount = 1;
        _refreshNPCView.waveInterval = 0;
 
        _refreshNPCView.transform.position = Vector3.zero;
        _refreshNPCView.transform.eulerAngles = Vector3.zero;
 
        _refreshNPCView.transform.SetParent(parent);
 
        return _refreshNPCView;
    }
 
    public static CreateImpasseView GeneralCreateImpasseView(SoMap.CreateImpasse source, Transform parent)
    {
        GameObject _createImpasseGo = GameObject.CreatePrimitive(PrimitiveType.Cube);
        _createImpasseGo.name = string.Format("Impasse: {0}", source.id);
 
        CreateImpasseView _createImpasseView = _createImpasseGo.AddComponent<CreateImpasseView>();
        _createImpasseView.id = source.id;
        _createImpasseView.effectID = source.effectID;
        _createImpasseView.transform.position = source.position;
        _createImpasseView.transform.eulerAngles = source.eulerAngles;
        _createImpasseView.transform.localScale = source.localScale;
 
        _createImpasseView.transform.SetParent(parent);
 
        return _createImpasseView;
    }
 
    public static CreateImpasseView GeneralCreateImpasseView(Transform parent)
    {
        GameObject _createImpasseGo = GameObject.CreatePrimitive(PrimitiveType.Cube);
        _createImpasseGo.name = "Impasse: -";
        _createImpasseGo.transform.localScale = .5f * Vector3.one;
        CreateImpasseView _createImpasseView = _createImpasseGo.AddComponent<CreateImpasseView>();
 
        _createImpasseView.id = 0;
        _createImpasseView.evenType = SoMap.E_EventType.CreateImpasse;
 
        _createImpasseView.transform.SetParent(parent);
 
        return _createImpasseView;
    }
 
    public static SoMap.RefreshNPC GeneralRefreshNpc(RefreshNPCView data)
    {
        SoMap.RefreshNPC _refreshNpc = new SoMap.RefreshNPC
        {
            position = data.transform.position,
            npcType = data.npcType,
            eulerAngles = data.transform.eulerAngles,
            NpcID = data.NpcID,
            randomPostion = data.randomPostion,
            randomDist = data.randomDist,
            count = data.count,
            refreshInterval = data.refreshInterval,
            waveCount = data.waveCount,
            waveInterval = data.waveInterval
        };
 
        return _refreshNpc;
 
    }
 
    public static SoMap.CreateImpasse GeneralCreateImpasse(CreateImpasseView source)
    {
        SoMap.CreateImpasse _soCreateImpasse = new SoMap.CreateImpasse
        {
            id = source.id,
            effectID = source.effectID,
            position = source.transform.position,
            eulerAngles = source.transform.eulerAngles,
            localScale = source.transform.localScale,
        };
 
        return _soCreateImpasse;
    }
}