├── README.md
└── Unity3DFSM
├── Assembly-CSharp-vs.csproj
├── Assembly-CSharp.csproj
├── Assets
├── New Terrain.asset
├── New Terrain.asset.meta
├── Scripts.meta
├── Scripts
│ ├── GFX.meta
│ ├── GFX
│ │ ├── CAnimation.cs
│ │ ├── CAnimation.cs.meta
│ │ ├── CTransform.cs
│ │ ├── CTransform.cs.meta
│ │ ├── GFXControl.meta
│ │ ├── GFXControl
│ │ │ ├── AIControl.cs
│ │ │ ├── AIControl.cs.meta
│ │ │ ├── CmdControl.cs
│ │ │ ├── CmdControl.cs.meta
│ │ │ ├── CmdState.meta
│ │ │ └── CmdState
│ │ │ │ ├── CmdStateBase.cs
│ │ │ │ └── CmdStateBase.cs.meta
│ │ ├── GfxObject.cs
│ │ ├── GfxObject.cs.meta
│ │ ├── State.meta
│ │ ├── State
│ │ │ ├── AttackState.cs
│ │ │ ├── AttackState.cs.meta
│ │ │ ├── DieState.cs
│ │ │ ├── DieState.cs.meta
│ │ │ ├── HurtState.cs
│ │ │ ├── HurtState.cs.meta
│ │ │ ├── IdleState.cs
│ │ │ ├── IdleState.cs.meta
│ │ │ ├── MoveBackState.cs
│ │ │ ├── MoveBackState.cs.meta
│ │ │ ├── MoveState.cs
│ │ │ ├── MoveState.cs.meta
│ │ │ ├── SkillState.cs
│ │ │ ├── SkillState.cs.meta
│ │ │ ├── StateBase.cs
│ │ │ └── StateBase.cs.meta
│ │ ├── StateControl.cs
│ │ └── StateControl.cs.meta
│ ├── Role.cs
│ └── Role.cs.meta
├── test.unity
└── test.unity.meta
├── Library
├── AnnotationManager
├── AssetImportState
├── AssetServerCacheV3
├── AssetVersioning.db
├── BuildPlayer.prefs
├── BuildSettings.asset
├── CurrentLayout.dwlt
├── EditorUserBuildSettings.asset
├── EditorUserSettings.asset
├── FailedAssetImports.txt
├── InspectorExpandedItems.asset
├── MonoManager.asset
├── ProjectSettings.asset
├── ScriptAssemblies
│ ├── Assembly-CSharp.dll
│ ├── Assembly-CSharp.dll.mdb
│ └── CompilationCompleted.txt
├── ScriptMapper
├── ShaderCache.db
├── assetDatabase3
├── expandedItems
├── guidmapper
└── metadata
│ ├── 18
│ └── 18c2a8574c8e24593b60cc78d98d0caf
│ ├── 44
│ └── 440a6de95f30347f0a9c939a67d8df0d
│ ├── 83
│ └── 83f8538afef2144d99904ac9df56a7c5
│ ├── 90
│ └── 9032fef241d6f47fabb5446e93f9de68
│ ├── 00
│ ├── 00000000000000001000000000000000
│ ├── 00000000000000002000000000000000
│ ├── 00000000000000003000000000000000
│ ├── 00000000000000004000000000000000
│ ├── 00000000000000004100000000000000
│ ├── 00000000000000005000000000000000
│ ├── 00000000000000005100000000000000
│ ├── 00000000000000006000000000000000
│ ├── 00000000000000006100000000000000
│ ├── 00000000000000007000000000000000
│ ├── 00000000000000008000000000000000
│ ├── 00000000000000009000000000000000
│ ├── 0000000000000000a000000000000000
│ ├── 0000000000000000b000000000000000
│ └── 0000000000000000c000000000000000
│ ├── 02
│ └── 02fca1b5f0d914abfb27f4c0e03619f8
│ ├── 2f
│ └── 2f988097313f447b0abee038147e9358
│ ├── 3e
│ └── 3e21b45f5857049c98ff8a4b8a249307
│ ├── 8b
│ └── 8b7fe1b3809b64581a8840d5a0477c01
│ ├── 8d
│ └── 8dd6e30a011624fb6986aa1227f155c5
│ ├── 8f
│ └── 8f86814775cd34c69a014d4ea66d5fa4
│ ├── 9e
│ └── 9ec810f1515594d12953885587c74510
│ ├── ad
│ └── ad6f395c822d24ca3b0f8ade16fcbc76
│ ├── ae
│ └── ae76310935e6746f680a0d8f072c737e
│ ├── af
│ └── af4d57bdb8d3a44f1a245fdcee8f51de
│ ├── b6
│ └── b63be112a0956484f94971b2094aa9a3
│ ├── b9
│ └── b998dcd2dea674c1ea9246dc24a24e3b
│ ├── c1
│ └── c1556887adc574a1bb86dd3c0f032720
│ ├── cb
│ └── cbe2b26e849d1473abee09c1748f670c
│ ├── d6
│ └── d6d6227a8e0cd4604976a8570cec2633
│ ├── d7
│ └── d7f7478a0d6244eaca8e7ac21d6dff26
│ ├── da
│ └── da0b6ebb3abaa4a1f9534c1c6516cf85
│ ├── ef
│ └── efdbc9837ece342638106cbceda4b302
│ └── f5
│ └── f51ec8c8149a049b9b877779f6bc7ec9
├── ProjectSettings
├── AudioManager.asset
├── DynamicsManager.asset
├── EditorBuildSettings.asset
├── EditorSettings.asset
├── GraphicsSettings.asset
├── InputManager.asset
├── NavMeshLayers.asset
├── NetworkManager.asset
├── Physics2DSettings.asset
├── ProjectSettings.asset
├── QualitySettings.asset
├── TagManager.asset
└── TimeManager.asset
├── Temp
├── UnityLockfile
└── UnityTempFile-aedb297b1a7c94f5f9d4c1cd2166a708
├── Unity3DFSM-csharp.sln
├── Unity3DFSM.sln
└── Unity3DFSM.userprefs
/README.md:
--------------------------------------------------------------------------------
1 | Unity3DFSM
2 | ==========
3 |
4 | 为Unity3D打造的角色渲染和行为有限状态机。
5 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assembly-CSharp-vs.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 10.0.20506
7 | 2.0
8 | {9A93F800-DAED-310C-D69A-9F541F6DBD11}
9 | Library
10 | Properties
11 |
12 | Assembly-CSharp
13 | v3.5
14 | 512
15 | Assets
16 |
17 |
18 | true
19 | full
20 | false
21 | Temp\bin\Debug\
22 | DEBUG;TRACE;UNITY_4_5_0;UNITY_4_5;UNITY_STANDALONE_OSX;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_GAMECENTER;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_OSX;UNITY_TEAM_LICENSE;UNITY_PRO_LICENSE
23 | prompt
24 | 4
25 | 0169
26 |
27 |
28 | pdbonly
29 | true
30 | Temp\bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 | 0169
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll
43 |
44 |
45 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assembly-CSharp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 10.0.20506
7 | 2.0
8 | {9A93F800-DAED-310C-D69A-9F541F6DBD11}
9 | Library
10 | Properties
11 |
12 | Assembly-CSharp
13 | v3.5
14 | 512
15 | Assets
16 |
17 |
18 | true
19 | full
20 | false
21 | Temp\bin\Debug\
22 | DEBUG;TRACE;UNITY_4_5_0;UNITY_4_5;UNITY_STANDALONE_OSX;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_GAMECENTER;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_OSX;UNITY_TEAM_LICENSE;UNITY_PRO_LICENSE
23 | prompt
24 | 4
25 | 0169
26 |
27 |
28 | pdbonly
29 | true
30 | Temp\bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 | 0169
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll
43 |
44 |
45 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/New Terrain.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Assets/New Terrain.asset
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/New Terrain.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ae76310935e6746f680a0d8f072c737e
3 | NativeFormatImporter:
4 | userData:
5 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8b7fe1b3809b64581a8840d5a0477c01
3 | folderAsset: yes
4 | DefaultImporter:
5 | userData:
6 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c1556887adc574a1bb86dd3c0f032720
3 | folderAsset: yes
4 | DefaultImporter:
5 | userData:
6 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/CAnimation.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | using System.Collections;
4 | using System.Collections.Generic;
5 | using UnityEngine;
6 |
7 |
8 | // CAnimation.cs
9 | // Auth: Lu Zexi
10 | // 2013-11-21
11 |
12 |
13 | namespace Game.Gfx
14 | {
15 | public enum PLAY_MODE
16 | {
17 | NONE = 0,
18 | CROSS_FADE = 1,
19 | PLAY = 2,
20 | BLEND = 3,
21 | }
22 |
23 | ///
24 | /// U3d动作封装类
25 | ///
26 | public class CAnimation
27 | {
28 | private Animation m_cAnimation = null; //U3D动作组件
29 | public delegate float FuncTime();
30 | private FuncTime m_delGetTime; //获取时间方法
31 | private float m_fScale = 1f; //缩放比率
32 |
33 | private string m_strCurrentAni = ""; //当前动作名
34 | private float m_fTime = -0xFFFF; //当前动作所进行的时间
35 |
36 | private float m_fSpeed = 1f; //当前动作的速度
37 | private WrapMode m_eWrap = WrapMode.Once; //当前动作的循环模式
38 |
39 | private const float DEFAULT_MAX_TIME = 50f; //默认的最长时间
40 |
41 | public WrapMode wrapMode
42 | {
43 | get { return this.m_cAnimation.wrapMode; }
44 | }
45 |
46 | public CAnimation(Animation ani, FuncTime timeFunc)
47 | {
48 | this.m_cAnimation = ani;
49 | this.m_cAnimation.cullingType = AnimationCullingType.BasedOnUserBounds;
50 | this.m_delGetTime = timeFunc;
51 | }
52 |
53 | ///
54 | /// 重置
55 | ///
56 | ///
57 | public void Reset(Animation ani)
58 | {
59 | this.m_cAnimation = ani;
60 | this.m_cAnimation.cullingType = AnimationCullingType.BasedOnUserBounds;
61 |
62 | if (this.m_cAnimation != null)
63 | {
64 | if (this.m_cAnimation[this.m_strCurrentAni] != null)
65 | {
66 | this.m_cAnimation.Play(this.m_strCurrentAni);
67 | this.m_cAnimation[this.m_strCurrentAni].speed = this.m_fSpeed*this.m_fScale;
68 | this.m_cAnimation[this.m_strCurrentAni].wrapMode = this.m_eWrap;
69 | this.m_cAnimation[this.m_strCurrentAni].time = (this.m_delGetTime() - this.m_fTime)*this.m_fSpeed*this.m_fScale;
70 | }
71 | }
72 | }
73 |
74 | ///
75 | /// 设置播放比例
76 | ///
77 | ///
78 | public void SetScale(float scale)
79 | {
80 | if (this.m_cAnimation != null)
81 | {
82 | if (this.m_cAnimation[this.m_strCurrentAni] != null)
83 | {
84 | this.m_cAnimation[this.m_strCurrentAni].speed = scale * this.m_fSpeed;
85 | }
86 | }
87 | this.m_fScale = scale;
88 | }
89 |
90 | ///
91 | /// 渲染更新
92 | ///
93 | ///
94 | public bool Render()
95 | {
96 | return true;
97 | }
98 |
99 | ///
100 | /// 初始化
101 | ///
102 | public void Init()
103 | {
104 | }
105 |
106 | ///
107 | /// 销毁
108 | ///
109 | public void Destory()
110 | {
111 | this.m_cAnimation = null;
112 | }
113 |
114 | ///
115 | /// 逻辑更新
116 | ///
117 | ///
118 | public bool Update()
119 | {
120 | return true;
121 | }
122 |
123 | ///
124 | /// 是否在播放指定动作
125 | ///
126 | ///
127 | ///
128 | public bool IsPlay(string name)
129 | {
130 | if (this.m_cAnimation != null)
131 | {
132 | return this.m_cAnimation.IsPlaying(name);
133 | }
134 | else
135 | {
136 | if (this.m_eWrap == WrapMode.Loop || this.m_eWrap == WrapMode.PingPong)
137 | return true;
138 |
139 | if ( (this.m_delGetTime() - this.m_fTime) * this.m_fSpeed * this.m_fScale > DEFAULT_MAX_TIME)
140 | {
141 | return false;
142 | }
143 | return true;
144 | }
145 | return false;
146 | }
147 |
148 | ///
149 | /// 是否正在播放
150 | ///
151 | ///
152 | public bool IsPlay()
153 | {
154 | if (this.m_cAnimation != null)
155 | {
156 | return this.m_cAnimation.isPlaying;
157 | }
158 | else
159 | {
160 | if (this.m_eWrap == WrapMode.Loop || this.m_eWrap == WrapMode.PingPong)
161 | return true;
162 |
163 | if ((this.m_delGetTime() - this.m_fTime)*this.m_fSpeed * this.m_fScale > DEFAULT_MAX_TIME)
164 | {
165 | return false;
166 | }
167 | return true;
168 | }
169 | return false;
170 | }
171 |
172 | ///
173 | /// 是否包含指定动作
174 | ///
175 | ///
176 | ///
177 | public bool IsContainAni(string name)
178 | {
179 | if (this.m_cAnimation == null)
180 | return false;
181 | if (this.m_cAnimation[name] == null)
182 | return false;
183 | return true;
184 | }
185 |
186 | ///
187 | /// 播放动作
188 | ///
189 | ///
190 | ///
191 | public bool Play(string name, WrapMode wrap, float speed)
192 | {
193 | if (this.m_cAnimation != null)
194 | {
195 | if (this.m_cAnimation[name] != null)
196 | {
197 | this.m_strCurrentAni = name;
198 | this.m_fTime = this.m_delGetTime();
199 | this.m_eWrap = wrap;
200 | this.m_fSpeed = speed;
201 |
202 | this.m_cAnimation[name].speed = speed * this.m_fScale;
203 | this.m_cAnimation[name].wrapMode = wrap;
204 | this.m_cAnimation.Play(name);
205 |
206 | return true;
207 | }
208 | return false;
209 | }
210 | else
211 | {
212 | this.m_strCurrentAni = "";
213 | this.m_fTime = this.m_delGetTime();
214 | this.m_eWrap = wrap;
215 | this.m_fSpeed = speed;
216 | return false;
217 | }
218 | return false;
219 | }
220 |
221 | ///
222 | /// 融合播放动作
223 | ///
224 | ///
225 | public bool CrossFade(string name, WrapMode wrap, float speed)
226 | {
227 | if (this.m_cAnimation != null)
228 | {
229 | if (this.m_cAnimation[name] != null)
230 | {
231 | this.m_strCurrentAni = name;
232 | this.m_fTime = this.m_delGetTime();
233 | this.m_eWrap = wrap;
234 | this.m_fSpeed = speed;
235 |
236 | this.m_cAnimation[name].speed = speed * this.m_fScale;
237 | this.m_cAnimation[name].wrapMode = wrap;
238 | this.m_cAnimation.CrossFade(name);
239 |
240 | return true;
241 | }
242 |
243 | return false;
244 | }
245 | else
246 | {
247 | this.m_strCurrentAni = "";
248 | this.m_fTime = this.m_delGetTime();
249 | this.m_eWrap = wrap;
250 | this.m_fSpeed = speed;
251 | return false;
252 | }
253 | return false;
254 | }
255 |
256 | ///
257 | /// 骨骼融合播放动作
258 | ///
259 | ///
260 | public bool Blend(string name, WrapMode wrap, float speed)
261 | {
262 | if (this.m_cAnimation != null)
263 | {
264 | if (this.m_cAnimation[name] != null)
265 | {
266 | this.m_strCurrentAni = name;
267 | this.m_fTime = this.m_delGetTime();
268 | this.m_eWrap = wrap;
269 | this.m_fSpeed = speed;
270 |
271 | this.m_cAnimation[name].speed = speed * this.m_fScale;
272 | this.m_cAnimation[name].wrapMode = wrap;
273 | this.m_cAnimation.Blend(name);
274 |
275 | return true;
276 | }
277 | return false;
278 | }
279 | else
280 | {
281 | this.m_strCurrentAni = "";
282 | this.m_fTime = this.m_delGetTime();
283 | this.m_eWrap = wrap;
284 | this.m_fSpeed = speed;
285 | return false;
286 | }
287 | return false;
288 | }
289 |
290 | ///
291 | /// 停止所有动作
292 | ///
293 | public void Stop()
294 | {
295 | if (this.m_cAnimation != null)
296 | {
297 | this.m_cAnimation.Stop();
298 |
299 | }
300 | this.m_fTime = DEFAULT_MAX_TIME + 1f;
301 | return;
302 | }
303 |
304 | ///
305 | /// 获取动作时间长度
306 | ///
307 | ///
308 | ///
309 | public float GeLength(string name)
310 | {
311 | if (this.m_cAnimation == null)
312 | return DEFAULT_MAX_TIME;
313 | if (this.m_cAnimation[name] == null)
314 | return 0;
315 | return this.m_cAnimation[name].length;
316 | }
317 |
318 | ///
319 | /// 获取所有动作名称
320 | ///
321 | ///
322 | public List GetAnimationNames()
323 | {
324 | List aniNames = new List();
325 | if (this.m_cAnimation == null)
326 | return aniNames;
327 |
328 | foreach (AnimationState item in this.m_cAnimation)
329 | {
330 | aniNames.Add(item.name);
331 | }
332 | return aniNames;
333 | }
334 |
335 | }
336 |
337 |
338 |
339 |
340 | }
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/CAnimation.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d7f7478a0d6244eaca8e7ac21d6dff26
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/CTransform.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | using System.Collections;
4 | using System.Collections.Generic;
5 | using UnityEngine;
6 |
7 | // CTransform.cs
8 | // Auth: Lu Zexi
9 | // 2013-11-21
10 |
11 |
12 | namespace Game.Gfx
13 | {
14 |
15 | ///
16 | /// U3D的Transforms封装类
17 | ///
18 | public class CTransform
19 | {
20 | protected CTransform m_cParent = null; //父节点
21 |
22 | protected Transform m_cTrans; //实体
23 |
24 | protected string m_strName; //实体名
25 | protected string m_strTag; //标签
26 | protected Vector3 m_vecPos; //位置
27 | protected Vector3 m_vecLocalPos; //相对位置
28 | protected Quaternion m_quaRot; //朝向
29 | protected Quaternion m_quaLoaclRot; //相对朝向
30 | protected Vector3 m_vecLocalScale = new Vector3(1, 1, 1); //相对比率
31 | protected bool m_bActive; //是否激活
32 |
33 | public CTransform()
34 | {
35 | }
36 |
37 | public CTransform(Transform trans)
38 | {
39 | this.m_cTrans = trans;
40 | this.m_vecPos = trans.position;
41 | this.m_quaRot = trans.rotation;
42 | this.m_strTag = trans.tag;
43 | this.m_strName = trans.name;
44 | this.m_vecLocalPos = trans.localPosition;
45 | this.m_quaLoaclRot = trans.localRotation;
46 | this.m_vecLocalScale = trans.localScale;
47 | this.m_bActive = trans.active;
48 | }
49 |
50 | public CTransform(CTransform trans)
51 | {
52 | this.m_vecPos = trans.position;
53 | this.m_quaRot = trans.rotation;
54 | this.m_strTag = trans.tag;
55 | this.m_strName = trans.name;
56 | this.m_vecLocalPos = trans.localPosition;
57 | this.m_quaLoaclRot = trans.localRotation;
58 | this.m_vecLocalScale = trans.localScale;
59 | this.m_bActive = trans.active;
60 |
61 | this.m_cTrans.position = this.m_vecPos;
62 | this.m_cTrans.rotation = this.m_quaRot;
63 |
64 | this.m_cTrans.localScale = this.m_vecLocalScale;
65 |
66 | }
67 |
68 | ///
69 | /// 克隆
70 | ///
71 | ///
72 | public CTransform Clone()
73 | {
74 | return new CTransform(this);
75 | }
76 |
77 | ///
78 | /// 父节点
79 | ///
80 | public Transform Parent
81 | {
82 | get { return this.m_cTrans.parent; }
83 | set { this.m_cTrans.parent = value; }
84 | }
85 |
86 |
87 | ///
88 | /// 世界位置
89 | ///
90 | public Vector3 position
91 | {
92 | get
93 | {
94 | if (this.m_cTrans != null)
95 | return this.m_cTrans.position;
96 | return this.m_vecPos;
97 | }
98 | set
99 | {
100 | this.m_vecPos = value;
101 | if (this.m_cTrans != null)
102 | {
103 | this.m_cTrans.position = value;
104 | this.m_vecLocalPos = this.m_cTrans.localPosition;
105 | }
106 | else
107 | {
108 | if (this.m_cParent != null)
109 | {
110 | this.m_vecLocalPos = this.m_vecPos - this.m_cParent.position;
111 | }
112 | else
113 | {
114 | this.m_vecLocalPos = value;
115 | }
116 | }
117 | }
118 | }
119 |
120 | public Quaternion rotation
121 | {
122 | get
123 | {
124 | if (this.m_cTrans != null)
125 | return this.m_cTrans.rotation;
126 | return this.m_quaRot;
127 | }
128 | set
129 | {
130 | this.m_quaRot = value;
131 | if (this.m_cTrans != null)
132 | {
133 | this.m_cTrans.rotation = value;
134 | this.m_quaLoaclRot = this.m_cTrans.localRotation;
135 | }
136 | else
137 | {
138 | if (this.m_cParent != null)
139 | {
140 | Vector3 prot = this.m_cParent.rotation.eulerAngles;
141 | Vector3 lrot = this.m_quaRot.eulerAngles;
142 | this.m_quaLoaclRot = Quaternion.Euler(lrot - prot);
143 | }
144 | else
145 | {
146 | this.m_quaLoaclRot = value;
147 | }
148 | }
149 | }
150 | }
151 |
152 | public string tag
153 | {
154 | get
155 | {
156 | if (this.m_cTrans != null)
157 | return this.m_cTrans.tag;
158 | return this.m_strTag;
159 | }
160 | set
161 | {
162 | this.m_strTag = value;
163 | if (this.m_cTrans != null)
164 | {
165 | this.m_cTrans.tag = value;
166 | }
167 | }
168 | }
169 |
170 | ///
171 | /// 名字
172 | ///
173 | public string name
174 | {
175 | get
176 | {
177 | if (this.m_cTrans != null)
178 | return this.m_cTrans.name;
179 | return this.m_strName;
180 | }
181 | set
182 | {
183 | this.m_strName = value;
184 | if (this.m_cTrans != null)
185 | {
186 | this.m_cTrans.name = value;
187 | }
188 | }
189 | }
190 |
191 | public Vector3 localPosition
192 | {
193 | get
194 | {
195 | if (this.m_cTrans != null)
196 | return this.m_cTrans.localPosition;
197 | return this.m_vecLocalPos;
198 | }
199 | set
200 | {
201 | this.m_vecLocalPos = value;
202 | if (this.m_cTrans != null)
203 | {
204 | this.m_cTrans.localPosition = value;
205 | this.m_vecPos = this.m_cTrans.position;
206 | }
207 | else
208 | {
209 | if (this.m_cParent != null)
210 | {
211 | this.m_vecPos = this.m_cParent.position + this.m_vecLocalPos;
212 | }
213 | else
214 | {
215 | this.m_vecPos = value;
216 | }
217 | }
218 | }
219 | }
220 |
221 | public Quaternion localRotation
222 | {
223 | get
224 | {
225 | if (this.m_cTrans != null)
226 | return this.m_cTrans.localRotation;
227 | return this.m_quaLoaclRot;
228 | }
229 | set
230 | {
231 | this.m_quaLoaclRot = value;
232 | if (this.m_cTrans != null)
233 | {
234 | this.m_cTrans.localRotation = value;
235 | this.m_quaRot = this.m_cTrans.rotation;
236 | }
237 | else
238 | {
239 | if (this.m_cParent != null)
240 | {
241 | Vector3 prot = this.m_cParent.rotation.eulerAngles;
242 | Vector3 lrot = this.m_quaLoaclRot.eulerAngles;
243 |
244 | this.m_quaRot = Quaternion.Euler(lrot + prot);
245 | }
246 | else
247 | {
248 | this.m_quaRot = value;
249 | }
250 | }
251 | }
252 | }
253 |
254 | public Vector3 forward
255 | {
256 | get
257 | {
258 | if (this.m_cTrans != null)
259 | return this.m_cTrans.forward;
260 | return this.m_quaRot * Vector3.forward;
261 | }
262 | }
263 |
264 | public Vector3 right
265 | {
266 | get
267 | {
268 | if (this.m_cTrans != null)
269 | return this.m_cTrans.right;
270 | return this.m_quaRot * Vector3.right;
271 | }
272 | }
273 |
274 | public Vector3 up
275 | {
276 | get
277 | {
278 | if (this.m_cTrans != null)
279 | return this.m_cTrans.up;
280 | return this.m_quaRot * Vector3.up;
281 | }
282 | }
283 |
284 | public Vector3 localScale
285 | {
286 | get
287 | {
288 | if (this.m_cTrans != null)
289 | return this.m_cTrans.localScale;
290 | return this.m_vecLocalScale;
291 | }
292 | set
293 | {
294 | this.m_vecLocalScale = value;
295 | if (this.m_cTrans != null)
296 | {
297 | this.m_cTrans.localScale = value;
298 | }
299 | }
300 | }
301 |
302 | public bool active
303 | {
304 | get
305 | {
306 | if (this.m_cTrans != null)
307 | return this.m_cTrans.active;
308 | return this.m_bActive;
309 | }
310 | set
311 | {
312 | this.m_bActive = value;
313 | if (this.m_cTrans != null)
314 | this.m_cTrans.active = value;
315 | }
316 | }
317 |
318 | ///
319 | /// 重置
320 | ///
321 | ///
322 | public virtual void Reset(Transform trans)
323 | {
324 | this.m_cTrans = trans;
325 | this.m_cTrans.position = this.m_vecPos;
326 | this.m_cTrans.rotation = this.m_quaRot;
327 | this.m_cTrans.localPosition = this.m_vecLocalPos;
328 | this.m_cTrans.localRotation = this.m_quaLoaclRot;
329 | this.m_cTrans.localScale = this.m_vecLocalScale;
330 | }
331 |
332 | ///
333 | /// 销毁
334 | ///
335 | public virtual void Destory()
336 | {
337 | this.m_vecPos = Vector3.zero;
338 | this.m_vecLocalPos = Vector3.zero;
339 | this.m_quaRot = Quaternion.identity;
340 | this.m_quaLoaclRot = Quaternion.identity;
341 | this.m_vecLocalScale = new Vector3(1, 1, 1);
342 | this.m_cTrans = null;
343 | }
344 |
345 | ///
346 | /// 更新实体位置信息
347 | ///
348 | public void UpdateTrans()
349 | {
350 | this.m_vecPos = this.m_cTrans.position;
351 | this.m_quaRot = this.m_cTrans.rotation;
352 | this.m_strTag = this.m_cTrans.tag;
353 | this.m_strName = this.m_cTrans.name;
354 | this.m_vecLocalPos = this.m_cTrans.localPosition;
355 | this.m_quaLoaclRot = this.m_cTrans.localRotation;
356 | this.m_vecLocalScale = this.m_cTrans.localScale;
357 | this.m_bActive = this.m_cTrans.active;
358 | }
359 |
360 | ///
361 | /// 旋转实体
362 | ///
363 | ///
364 | ///
365 | ///
366 | public void Rotate(float x, float y, float z)
367 | {
368 | if (this.m_cTrans == null)
369 | {
370 | Vector3 angle = this.rotation.eulerAngles + new Vector3(x, y, z);
371 | this.rotation = Quaternion.Euler(angle);
372 | return;
373 | }
374 | else
375 | this.m_cTrans.Rotate(x, y, z);
376 | UpdateTrans();
377 | }
378 |
379 | ///
380 | /// 旋转实体
381 | ///
382 | ///
383 | ///
384 | ///
385 | public void Rotate(Vector3 rot)
386 | {
387 | if (this.m_cTrans == null)
388 | {
389 | Vector3 angle = this.rotation.eulerAngles + rot;
390 | this.rotation = Quaternion.Euler(angle);
391 | return;
392 | }
393 | else
394 | this.m_cTrans.Rotate(rot);
395 | UpdateTrans();
396 | }
397 |
398 | ///
399 | /// 旋转
400 | ///
401 | ///
402 | ///
403 | ///
404 | public void RotateAround(Vector3 pos, Vector3 axis, float angle)
405 | {
406 | if (this.m_cTrans == null)
407 | {
408 | //do something
409 | return;
410 | }
411 | else
412 | this.m_cTrans.RotateAround(pos, axis, angle);
413 | UpdateTrans();
414 | }
415 |
416 | ///
417 | /// 移动
418 | ///
419 | ///
420 | public void Translate(Vector3 dir)
421 | {
422 | if (this.m_cTrans == null)
423 | {
424 | this.position = this.position + dir;
425 | return;
426 | }
427 | else
428 | this.m_cTrans.Translate(dir);
429 | UpdateTrans();
430 | }
431 |
432 | ///
433 | /// 看着某点
434 | ///
435 | ///
436 | public void LookAt(Vector3 pos)
437 | {
438 | if (this.m_cTrans == null)
439 | {
440 | Vector3 dir = pos - this.position;
441 | this.rotation = Quaternion.LookRotation(dir);
442 | return;
443 | }
444 | else
445 | this.m_cTrans.LookAt(pos);
446 | UpdateTrans();
447 | }
448 |
449 | ////////////////////////////////////////////////////////////////////////////////////////////////////////
450 |
451 | ///////////////////////////////////////////////////// 挂接 API //////////////////////////////////////////
452 |
453 | ///
454 | /// 设置子节点
455 | ///
456 | ///
457 | public bool Attached(CTransform trans, string boneName)
458 | {
459 | if (this.m_cTrans == null)
460 | return false;
461 |
462 | foreach (Transform item in this.m_cTrans)
463 | {
464 | if (item.name == boneName)
465 | {
466 | trans.m_cTrans.parent = item;
467 | trans.localPosition = Vector3.zero;
468 | trans.localRotation = Quaternion.identity;
469 | return true;
470 | }
471 | }
472 | return false;
473 | }
474 |
475 |
476 | ///
477 | /// 是否包含指定Transform
478 | ///
479 | ///
480 | ///
481 | public bool ContainTrans(Transform trans)
482 | {
483 | foreach (Transform item in this.m_cTrans)
484 | {
485 | if (item == trans)
486 | {
487 | return true;
488 | }
489 | }
490 | return false;
491 | }
492 |
493 | ///
494 | /// 是否包含指定GameTrans
495 | ///
496 | ///
497 | ///
498 | public bool ContainTrans(CTransform trans)
499 | {
500 | foreach (Transform item in this.m_cTrans)
501 | {
502 | if (item == trans.m_cTrans)
503 | {
504 | return true;
505 | }
506 | }
507 | return false;
508 | }
509 |
510 | ////////////////////////////////////////////////////////////////////////////////////////////////////////
511 |
512 | //////////////////////////////////////// Character Controller ////////////////////////////
513 |
514 | ///
515 | /// 是否着地
516 | ///
517 | ///
518 | public virtual bool IsGround()
519 | {
520 | return false;
521 | }
522 |
523 | ///
524 | /// 移动
525 | ///
526 | ///
527 | public virtual CollisionFlags Move(Vector3 dir)
528 | {
529 | return CollisionFlags.None;
530 | }
531 |
532 | ///////////////////////////////////////////////////////////////////////////////////////////
533 |
534 | ///
535 | /// 忽略碰撞检测
536 | ///
537 | ///
538 | public virtual void IgnorCollider(CTransform trans)
539 | {
540 | Collider[] colliders1 = this.m_cTrans.GetComponentsInChildren();
541 | Collider[] colliders2 = trans.m_cTrans.GetComponentsInChildren();
542 |
543 | foreach (Collider item1 in colliders1)
544 | {
545 | if (item1.isTrigger == true)
546 | continue;
547 | foreach (Collider item2 in colliders2)
548 | {
549 | if (item2.isTrigger == true)
550 | continue;
551 | Physics.IgnoreCollision(item1, item2);
552 | }
553 | }
554 | }
555 |
556 | }
557 |
558 |
559 | }
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/CTransform.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 18c2a8574c8e24593b60cc78d98d0caf
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/GFXControl.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ad6f395c822d24ca3b0f8ade16fcbc76
3 | folderAsset: yes
4 | DefaultImporter:
5 | userData:
6 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/GFXControl/AIControl.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 |
7 | // AIControl.cs
8 | // Author: Lu Zexi
9 | // 2013-11-29
10 |
11 |
12 |
13 | ///
14 | /// AI控制
15 | ///
16 | public class AIControl
17 | {
18 |
19 | public AIControl()
20 | {
21 | }
22 |
23 | ///
24 | /// 逻辑更新
25 | ///
26 | ///
27 | public virtual bool Update()
28 | {
29 | return true;
30 | }
31 |
32 | ///
33 | /// 初始化
34 | ///
35 | public virtual void Initialize()
36 | {
37 | //
38 | }
39 |
40 | ///
41 | /// 销毁
42 | ///
43 | public virtual void Destroy()
44 | {
45 | //
46 | }
47 |
48 | }
49 |
50 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/GFXControl/AIControl.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d6d6227a8e0cd4604976a8570cec2633
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/GFXControl/CmdControl.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections;
4 | using Game.Gfx;
5 | using UnityEngine;
6 |
7 |
8 | // CmdControl.cs
9 | // Author: Lu Zexi
10 | // 2013-11-29
11 |
12 |
13 |
14 | ///
15 | /// 命令控制
16 | ///
17 | public class CmdControl
18 | {
19 | private CmdStateBase m_cState; //当前状态
20 | private CmdStateWrap m_cStateWrap; //命令状态包
21 |
22 | ///
23 | /// 命令状态包
24 | ///
25 | private class CmdStateWrap
26 | {
27 |
28 | public CmdStateWrap()
29 | {
30 | //
31 | }
32 | }
33 |
34 | public CmdControl()
35 | {
36 | this.m_cState = null;
37 | this.m_cStateWrap = new CmdStateWrap();
38 | }
39 |
40 | ///
41 | /// 获取命令状态
42 | ///
43 | ///
44 | public CMD_TYPE GetCmdType()
45 | {
46 | if (this.m_cState == null)
47 | return CMD_TYPE.STATE_NONE;
48 | return this.m_cState.GetCmdType();
49 | }
50 |
51 |
52 | ///
53 | /// 逻辑更新
54 | ///
55 | ///
56 | public bool Update()
57 | {
58 | if (this.m_cState == null)
59 | return false;
60 | if (!this.m_cState.Update())
61 | {
62 | if (this.m_cState != null)
63 | this.m_cState.OnExit();
64 | this.m_cState = null;
65 | return false;
66 | }
67 | return true;
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/GFXControl/CmdControl.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 02fca1b5f0d914abfb27f4c0e03619f8
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/GFXControl/CmdState.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: da0b6ebb3abaa4a1f9534c1c6516cf85
3 | folderAsset: yes
4 | DefaultImporter:
5 | userData:
6 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/GFXControl/CmdState/CmdStateBase.cs:
--------------------------------------------------------------------------------
1 |
2 | using UnityEngine;
3 | using Game.Gfx;
4 |
5 |
6 | // CmdStateBase.cs
7 | // Auth: Lu Zexi
8 | // 2013-11-21
9 |
10 |
11 |
12 | ///
13 | /// 状态类型
14 | ///
15 | public enum CMD_TYPE
16 | {
17 | STATE_NONE = 0, //无
18 | STATE_DEFENCE = 1, //防御
19 | STATE_SKILL, //不移动单体释放技能
20 | STATE_ALL_SKILL, //不移动全体释放技能
21 | STATE_MOVE_SKILL, //移动单体释放技能
22 | STATE_MOVE_ALL_SKILL, //移动全体释放技能
23 | STATE_MOVE_ATTACK, //移动攻击
24 | STATE_ATTACK, //非移动攻击
25 | STATE_HURT, //受伤
26 | STATE_DIE, //死亡状态
27 | }
28 |
29 |
30 | ///
31 | /// 命令状态基础类
32 | ///
33 | public abstract class CmdStateBase
34 | {
35 | protected GfxObject m_cObj; //物体
36 | protected StateControl m_cControl; //控制对象
37 |
38 | public CmdStateBase()
39 | {
40 | this.m_cControl = this.m_cObj.GetStateControl();
41 | }
42 |
43 | ///
44 | /// 获取状态类型
45 | ///
46 | ///
47 | public abstract CMD_TYPE GetCmdType();
48 |
49 | ///
50 | /// 进入事件
51 | ///
52 | ///
53 | public virtual bool OnEnter()
54 | {
55 | return true;
56 | }
57 |
58 | ///
59 | /// 退出事件
60 | ///
61 | ///
62 | public virtual bool OnExit()
63 | {
64 | return true;
65 | }
66 |
67 | ///
68 | /// 逻辑更新
69 | ///
70 | ///
71 | public abstract bool Update();
72 |
73 | ///
74 | /// 销毁
75 | ///
76 | public virtual void Destory()
77 | {
78 | //
79 | }
80 |
81 | }
82 |
83 |
84 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/GFXControl/CmdState/CmdStateBase.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: af4d57bdb8d3a44f1a245fdcee8f51de
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/GfxObject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 |
5 | // GfxObject.cs
6 | // Author: Lu Zexi
7 | // 2013-11-21
8 |
9 |
10 |
11 | namespace Game.Gfx
12 | {
13 | ///
14 | /// 图形渲染类
15 | ///
16 | public class GfxObject : MonoBehaviour
17 | {
18 | public StateControl m_cStateControl; //状态控制类
19 |
20 | void Awake()
21 | {
22 | this.m_cStateControl = new StateControl(this);
23 | }
24 |
25 | ///
26 | /// 销毁
27 | ///
28 | public virtual void Destory()
29 | {
30 | this.m_cStateControl = null;
31 |
32 | GameObject.DestroyImmediate(this.gameObject);
33 | }
34 |
35 | ///
36 | /// 逻辑更新
37 | ///
38 | void FixedUpdate()
39 | {
40 | if(this.m_cStateControl != null )
41 | this.m_cStateControl.Update();
42 | }
43 |
44 | ////////////////////////////////////////// 状态控制 ////////////////////////////////////
45 |
46 | ///
47 | /// 获取状态控制
48 | ///
49 | ///
50 | public StateControl GetStateControl()
51 | {
52 | return this.m_cStateControl;
53 | }
54 |
55 | ///
56 | /// 攻击状态
57 | ///
58 | public void AttackState()
59 | {
60 | this.m_cStateControl.Attack();
61 | }
62 |
63 | ///
64 | /// 空闲状态
65 | ///
66 | public void IdleState()
67 | {
68 | this.m_cStateControl.Idle();
69 | }
70 |
71 | ///
72 | /// 移动状态
73 | ///
74 | ///
75 | ///
76 | public void MoveState( Vector3 pos , float costTime )
77 | {
78 | this.m_cStateControl.Move(pos, costTime);
79 | }
80 |
81 | ///
82 | /// 受伤状态
83 | ///
84 | public void HurtState()
85 | {
86 | this.m_cStateControl.Hurt();
87 | }
88 |
89 | ///
90 | /// 技能状态
91 | ///
92 | public void SkillState()
93 | {
94 | this.m_cStateControl.Skill();
95 | }
96 |
97 | //////////////////////////////////////////// 动画 API /////////////////////////////////////////////
98 |
99 | ///
100 | /// 停止动画
101 | ///
102 | public void Stop()
103 | {
104 | if (this.animation == null)
105 | return;
106 |
107 | this.animation.Stop();
108 | }
109 |
110 | ///
111 | /// 播放动作
112 | ///
113 | ///
114 | ///
115 | ///
116 | ///
117 | public virtual void Play(string name, WrapMode wrap, float speed, PLAY_MODE mode)
118 | {
119 | if (this.animation == null || this.animation[name] == null)
120 | return;
121 |
122 | this.animation[name].wrapMode = wrap;
123 | this.animation[name].speed = speed;
124 |
125 | switch (mode)
126 | {
127 | case PLAY_MODE.CROSS_FADE:
128 | this.animation.CrossFade(name);
129 | break;
130 | case PLAY_MODE.PLAY:
131 | this.animation.Play(name);
132 | break;
133 | case PLAY_MODE.BLEND:
134 | this.animation.Blend(name);
135 | break;
136 | default:
137 | break;
138 | }
139 | }
140 |
141 | ///
142 | /// 是否正在播放指定动作
143 | ///
144 | ///
145 | ///
146 | public virtual bool IsPlaying(string name)
147 | {
148 | if (this.animation == null)
149 | return false;
150 | return this.animation.IsPlaying(name);
151 | }
152 |
153 |
154 | ///
155 | /// 获取长度
156 | ///
157 | ///
158 | ///
159 | public float GetAnimationLength(string name)
160 | {
161 | if (this.animation == null || this.animation[name] == null )
162 | return 0;
163 | return this.animation[name].length;
164 | }
165 |
166 | /////////////////////////////////////////////////////////////////////////////////////////////////////
167 |
168 | }
169 |
170 | }
171 |
172 |
173 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/GfxObject.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9032fef241d6f47fabb5446e93f9de68
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/State.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8f86814775cd34c69a014d4ea66d5fa4
3 | folderAsset: yes
4 | DefaultImporter:
5 | userData:
6 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/State/AttackState.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | using UnityEngine;
4 |
5 | // AttackState.cs
6 | // Auth: Lu Zexi
7 | // 2013-11-21
8 |
9 |
10 |
11 | namespace Game.Gfx
12 | {
13 | ///
14 | /// 攻击状态
15 | ///
16 | public class AttackState : StateBase
17 | {
18 | private GfxObject m_cTargetObj;
19 |
20 | public AttackState(GfxObject obj)
21 | : base(obj)
22 | {
23 |
24 | }
25 |
26 | ///
27 | /// 获取状态类型
28 | ///
29 | ///
30 | public override STATE_TYPE GetStateType()
31 | {
32 | return STATE_TYPE.STATE_ATTACK;
33 | }
34 |
35 | ///
36 | /// 设置
37 | ///
38 | ///
39 | public void Set(GfxObject target)
40 | {
41 | this.m_cTargetObj = target;
42 | }
43 |
44 | ///
45 | /// 进入状态
46 | ///
47 | ///
48 | public override bool OnEnter()
49 | {
50 | this.m_cObj.Play("attack" , WrapMode.Once , 1 , PLAY_MODE.CROSS_FADE );
51 | return true;
52 | }
53 |
54 | ///
55 | /// 逻辑更新
56 | ///
57 | ///
58 | public override bool Update()
59 | {
60 | if (this.m_cObj != null)
61 | {
62 | return this.m_cObj.IsPlaying("attack");
63 | }
64 | return false;
65 | }
66 |
67 | }
68 | }
69 |
70 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/State/AttackState.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: cbe2b26e849d1473abee09c1748f670c
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/State/DieState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 |
5 |
6 | // DieState.cs
7 | // Author: Lu Zexi
8 | // 2013-12-02
9 |
10 |
11 |
12 | namespace Game.Gfx
13 | {
14 | ///
15 | /// 死亡状态
16 | ///
17 | public class DieState : StateBase
18 | {
19 | private Vector3 m_cStartScale; //起始比率
20 | private float m_fStartTime; //时间
21 | private Vector3 m_cStartPos; //开始点
22 |
23 |
24 | private const float COST_TIME = 0.5F; //花费时间
25 | private Vector3 SHAKE_DIS = new Vector3(0.01f, 0.005f, 0); //抖动位置
26 | private Vector3 END_SCALE = new Vector3(0, 1.5f, 1); //最终大小
27 |
28 | public DieState(GfxObject obj)
29 | : base(obj)
30 | {
31 | //
32 | }
33 |
34 | ///
35 | /// 获取状态类型
36 | ///
37 | ///
38 | public override STATE_TYPE GetStateType()
39 | {
40 | return STATE_TYPE.STATE_DIE;
41 | }
42 |
43 | ///
44 | /// 进入事件
45 | ///
46 | ///
47 | public override bool OnEnter()
48 | {
49 | //GameObject obj = this.m_cObj.GetGameObject();
50 | //foreach (Renderer item in obj.transform.GetComponentsInChildren())
51 | //{
52 | // foreach (Material mat in item.materials)
53 | // {
54 | // mat.shader = Shader.Find("Transparent/Diffuse");
55 | // //mat.shader = Shader.Find("Game/GameGuide");
56 | // }
57 | //}
58 |
59 | this.m_cStartScale = this.m_cObj.transform.localScale;
60 | this.m_cStartPos = this.m_cObj.transform.localPosition;
61 |
62 | this.m_fStartTime = Time.fixedTime;
63 |
64 | this.m_cObj.Stop();
65 |
66 | return base.OnEnter();
67 | }
68 |
69 |
70 | ///
71 | /// 退出事件
72 | ///
73 | ///
74 | public override bool OnExit()
75 | {
76 | return base.OnExit();
77 | }
78 |
79 | ///
80 | /// 逻辑更新
81 | ///
82 | ///
83 | public override bool Update()
84 | {
85 | float disTime = Time.fixedTime - this.m_fStartTime;
86 |
87 | if (disTime > COST_TIME)
88 | {
89 | this.m_cObj.transform.localScale = Vector3.zero;
90 | return false;
91 | }
92 |
93 | float rate = disTime / COST_TIME;
94 | //float rate1 = CMath.ExponentialOut(rate, 0, 1, 1);
95 | float rate1 = Mathf.Lerp(0,1,rate);
96 |
97 | Vector3 pos = this.m_cStartPos;
98 | pos.x += UnityEngine.Random.Range(-SHAKE_DIS.x * rate1, SHAKE_DIS.x * rate1);
99 | pos.y += UnityEngine.Random.Range(-SHAKE_DIS.y * rate1, SHAKE_DIS.y * rate1);
100 | pos.z += UnityEngine.Random.Range(-SHAKE_DIS.z * rate1, SHAKE_DIS.z * rate1);
101 |
102 | Vector3 target = new Vector3(this.m_cStartScale.x * 0.1f, 1.3f, 1f);
103 | Vector3 scale = Vector3.Lerp(this.m_cStartScale, target, rate);
104 | //Vector3 scale = new Vector3(th.m_cStartScale * (COST_TIME - disTime) / COST_TIME, this.m_cStartScale.y * (COST_TIME + disTime) / COST_TIME, this.m_cStartScale.z);
105 | this.m_cObj.transform.localScale = scale;
106 | this.m_cObj.transform.localPosition = pos;
107 |
108 | return true;
109 | }
110 |
111 | ///
112 | /// 销毁
113 | ///
114 | public override void Destory()
115 | {
116 | base.Destory();
117 | }
118 |
119 | }
120 |
121 | }
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/State/DieState.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3e21b45f5857049c98ff8a4b8a249307
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/State/HurtState.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | // HurtState.cs
4 | // Auth: Lu Zexi
5 | // 2013-11-21
6 |
7 |
8 |
9 | namespace Game.Gfx
10 | {
11 | ///
12 | /// 受击状态
13 | ///
14 | public class HurtState : StateBase
15 | {
16 |
17 | private Vector3 m_cStartPos; //开始位置
18 | private float m_fStateStartTime; //开始时间
19 |
20 | private const float COST_TIME = 0.15f; //花费时间
21 | private Vector3 SHAKE_DIS = new Vector3(0, 0.2f, 0); //抖动距离
22 |
23 | public HurtState(GfxObject obj)
24 | : base(obj)
25 | {
26 |
27 | }
28 |
29 | ///
30 | /// 获取状态类型
31 | ///
32 | ///
33 | public override STATE_TYPE GetStateType()
34 | {
35 | return STATE_TYPE.STATE_HURT;
36 | }
37 |
38 | ///
39 | /// 进入状态
40 | ///
41 | ///
42 | public override bool OnEnter()
43 | {
44 | this.m_cStartPos = this.m_cObj.transform.localPosition;
45 | this.m_fStateStartTime = Time.fixedTime;
46 | return true;
47 | }
48 |
49 | ///
50 | /// 退出状态
51 | ///
52 | ///
53 | public override bool OnExit()
54 | {
55 | this.m_cObj.transform.localPosition = this.m_cStartPos;
56 | return base.OnExit();
57 | }
58 |
59 | ///
60 | /// 逻辑更新
61 | ///
62 | ///
63 | public override bool Update()
64 | {
65 |
66 | float disTime = Time.fixedTime - this.m_fStateStartTime;
67 |
68 | if (disTime > COST_TIME)
69 | {
70 | this.m_cObj.transform.localPosition = this.m_cStartPos;
71 | return false;
72 | }
73 |
74 | float rate = disTime / COST_TIME;
75 | //float rate1 = CMath.ExponentialOut(rate, 0, 1, 1);
76 | float rate1 = Mathf.Lerp(0,1,rate);
77 |
78 | Vector3 pos = this.m_cStartPos;
79 | pos.x += UnityEngine.Random.Range(-SHAKE_DIS.x * rate1, SHAKE_DIS.x * rate1);
80 | pos.y += UnityEngine.Random.Range(0, SHAKE_DIS.y * rate1);
81 | pos.z += UnityEngine.Random.Range(-SHAKE_DIS.z * rate1, SHAKE_DIS.z * rate1);
82 |
83 | this.m_cObj.transform.localPosition = pos;
84 |
85 | return true;
86 | }
87 |
88 | }
89 | }
90 |
91 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/State/HurtState.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 440a6de95f30347f0a9c939a67d8df0d
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/State/IdleState.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | // IdleState.cs
4 | // Auth: Lu Zexi
5 | // 2013-11-21
6 |
7 |
8 | namespace Game.Gfx
9 | {
10 |
11 | ///
12 | /// 空闲状态
13 | ///
14 | public class IdleState : StateBase
15 | {
16 | public IdleState(GfxObject obj)
17 | : base(obj)
18 | {
19 | }
20 |
21 | ///
22 | /// 获取状态类型
23 | ///
24 | ///
25 | public override STATE_TYPE GetStateType()
26 | {
27 | return STATE_TYPE.STATE_IDLE;
28 | }
29 |
30 | ///
31 | /// 进入状态
32 | ///
33 | ///
34 | public override bool OnEnter()
35 | {
36 | this.m_cObj.Play("idle" , WrapMode.Loop , 1 , PLAY_MODE.CROSS_FADE) ;
37 | return true;
38 | }
39 |
40 | ///
41 | /// 逻辑更新
42 | ///
43 | ///
44 | public override bool Update()
45 | {
46 | return true;
47 | }
48 |
49 | }
50 | }
51 |
52 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/State/IdleState.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b998dcd2dea674c1ea9246dc24a24e3b
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/State/MoveBackState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections;
4 | using UnityEngine;
5 |
6 |
7 | // MoveBackState.cs
8 | // Author: Lu Zexi
9 | // 2013-11-29
10 |
11 |
12 |
13 | namespace Game.Gfx
14 | {
15 |
16 | ///
17 | /// 回退状态
18 | ///
19 | public class MoveBackState : StateBase
20 | {
21 | private Vector3 m_vecTargetPos; //目标点
22 | private float m_fCostTime; //花费时间
23 | private float m_fLastTime; //最近时间
24 | private Vector3 m_vecLastPos; //最近坐标
25 |
26 | public MoveBackState(GfxObject obj)
27 | : base(obj)
28 | {
29 | }
30 |
31 | ///
32 | /// 获取状态类型
33 | ///
34 | ///
35 | public override STATE_TYPE GetStateType()
36 | {
37 | return STATE_TYPE.STATE_MOVE_BACK;
38 | }
39 |
40 | ///
41 | /// 设置参数
42 | ///
43 | ///
44 | ///
45 | public void Set(Vector3 pos, float costTime)
46 | {
47 | this.m_vecTargetPos = pos;
48 | this.m_fCostTime = costTime;
49 | this.m_fLastTime = Time.fixedTime;
50 | this.m_vecLastPos = this.m_cObj.transform.localPosition;
51 | }
52 |
53 | ///
54 | /// 进入状态
55 | ///
56 | ///
57 | public override bool OnEnter()
58 | {
59 | this.m_cObj.Play("idle", WrapMode.Once, 1f, PLAY_MODE.PLAY);
60 | return true;
61 | }
62 |
63 | ///
64 | /// 逻辑更新
65 | ///
66 | ///
67 | public override bool Update()
68 | {
69 | float disTime = Time.fixedTime - this.m_fLastTime;
70 |
71 | if (disTime >= this.m_fCostTime)
72 | {
73 | this.m_cObj.transform.localPosition = this.m_vecTargetPos;
74 | return false;
75 | }
76 | Vector3 pos = Vector3.Lerp(this.m_vecLastPos, this.m_vecTargetPos, disTime / this.m_fCostTime);
77 | this.m_cObj.transform.localPosition = pos;
78 |
79 | return true;
80 | }
81 | }
82 |
83 | }
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/State/MoveBackState.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8dd6e30a011624fb6986aa1227f155c5
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/State/MoveState.cs:
--------------------------------------------------------------------------------
1 |
2 | using UnityEngine;
3 |
4 | // MoveState.cs
5 | // Auth: Lu Zexi
6 | // 2013-11-21
7 |
8 | namespace Game.Gfx
9 | {
10 | ///
11 | /// 移动状态
12 | ///
13 | public class MoveState : StateBase
14 | {
15 | private Vector3 m_vecTargetPos; //目标点
16 | private float m_fCostTime; //花费时间
17 | private float m_fLastTime; //最近时间
18 | private Vector3 m_vecLastPos; //最近坐标
19 |
20 | public MoveState(GfxObject obj)
21 | : base(obj)
22 | {
23 | }
24 |
25 | ///
26 | /// 获取状态类型
27 | ///
28 | ///
29 | public override STATE_TYPE GetStateType()
30 | {
31 | return STATE_TYPE.STATE_MOVE;
32 | }
33 |
34 | ///
35 | /// 设置参数
36 | ///
37 | ///
38 | ///
39 | public void Set(Vector3 pos, float costTime)
40 | {
41 | this.m_vecTargetPos = pos;
42 | this.m_fCostTime = costTime;
43 | this.m_fLastTime = Time.fixedTime;
44 | this.m_vecLastPos = this.m_cObj.transform.localPosition;
45 | }
46 |
47 | ///
48 | /// 进入状态
49 | ///
50 | ///
51 | public override bool OnEnter()
52 | {
53 | float rate = this.m_cObj.GetAnimationLength("move") / this.m_fCostTime;
54 | this.m_cObj.Play("move", WrapMode.Once, rate, PLAY_MODE.PLAY);
55 | return true;
56 | }
57 |
58 | ///
59 | /// 逻辑更新
60 | ///
61 | ///
62 | public override bool Update()
63 | {
64 | float disTime = Time.fixedTime - this.m_fLastTime;
65 |
66 | if (disTime >= this.m_fCostTime)
67 | {
68 | this.m_cObj.transform.localPosition = this.m_vecTargetPos;
69 | return false;
70 | }
71 | else
72 | {
73 | Vector3 pos = Vector3.Lerp(this.m_vecLastPos, this.m_vecTargetPos, disTime / this.m_fCostTime);
74 | this.m_cObj.transform.localPosition = pos;
75 | }
76 |
77 | return true;
78 | }
79 |
80 | }
81 | }
82 |
83 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/State/MoveState.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: efdbc9837ece342638106cbceda4b302
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/State/SkillState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections;
4 | using UnityEngine;
5 |
6 |
7 | // SkillState.cs
8 | // Author: Lu Zexi
9 | // 2013-11-29
10 |
11 |
12 | namespace Game.Gfx
13 | {
14 | ///
15 | /// 技能状态
16 | ///
17 | public class SkillState : StateBase
18 | {
19 | public SkillState(GfxObject obj)
20 | : base(obj)
21 | {
22 | //
23 | }
24 |
25 | ///
26 | /// 获取状态
27 | ///
28 | ///
29 | public override STATE_TYPE GetStateType()
30 | {
31 | return STATE_TYPE.STATE_SKILL;
32 | }
33 |
34 | ///
35 | /// 进入状态
36 | ///
37 | ///
38 | public override bool OnEnter()
39 | {
40 | this.m_cObj.Play("skill", WrapMode.Once, 1f, PLAY_MODE.CROSS_FADE);
41 | return base.OnEnter();
42 | }
43 |
44 | ///
45 | /// 退出状态
46 | ///
47 | ///
48 | public override bool OnExit()
49 | {
50 | return base.OnExit();
51 | }
52 |
53 | ///
54 | /// 逻辑更新
55 | ///
56 | ///
57 | public override bool Update()
58 | {
59 | if (this.m_cObj != null)
60 | {
61 | return this.m_cObj.IsPlaying("skill");
62 | }
63 | return false;
64 | }
65 |
66 | ///
67 | /// 销毁
68 | ///
69 | public override void Destory()
70 | {
71 | base.Destory();
72 | }
73 | }
74 |
75 | }
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/State/SkillState.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9ec810f1515594d12953885587c74510
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/State/StateBase.cs:
--------------------------------------------------------------------------------
1 |
2 | using UnityEngine;
3 |
4 | // StateBase.cs
5 | // Auth: Lu Zexi
6 | // 2013-11-21
7 |
8 | namespace Game.Gfx
9 | {
10 | ///
11 | /// 状态类型
12 | ///
13 | public enum STATE_TYPE
14 | {
15 | STATE_NONE = 0,
16 | STATE_IDLE = 1,
17 | STATE_MOVE = 2,
18 | STATE_SKILL = 3,
19 | STATE_ATTACK = 4,
20 | STATE_HURT = 5,
21 | STATE_MOVE_BACK = 6,
22 | STATE_DIE = 7,
23 | }
24 |
25 | ///
26 | /// 状态基类
27 | ///
28 | public abstract class StateBase
29 | {
30 | protected GfxObject m_cObj; //物体
31 |
32 | public StateBase(GfxObject obj)
33 | {
34 | this.m_cObj = obj;
35 | }
36 |
37 | ///
38 | /// 获取状态类型
39 | ///
40 | ///
41 | public abstract STATE_TYPE GetStateType();
42 |
43 | ///
44 | /// 进入事件
45 | ///
46 | ///
47 | public virtual bool OnEnter()
48 | {
49 | return true;
50 | }
51 |
52 | ///
53 | /// 退出事件
54 | ///
55 | ///
56 | public virtual bool OnExit()
57 | {
58 | return true;
59 | }
60 |
61 | ///
62 | /// 逻辑更新
63 | ///
64 | ///
65 | public abstract bool Update();
66 |
67 | ///
68 | /// 销毁
69 | ///
70 | public virtual void Destory()
71 | {
72 | }
73 |
74 | }
75 |
76 | }
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/State/StateBase.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b63be112a0956484f94971b2094aa9a3
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/StateControl.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | using UnityEngine;
4 |
5 | // StateControl.cs
6 | // Auth: Lu Zexi
7 | // 2013-11-21
8 |
9 | namespace Game.Gfx
10 | {
11 | ///
12 | /// 状态控制
13 | ///
14 | public class StateControl
15 | {
16 | private StateBase m_cCurrentState; //当前状态
17 | private StateWrap m_cStateWrap; //状态包对象
18 |
19 | ///
20 | /// 状态包
21 | ///
22 | private class StateWrap
23 | {
24 | public IdleState m_cIdleState; //空闲状态
25 | public AttackState m_cAttackState; //攻击状态
26 | public MoveState m_cMoveState; //移动状态
27 | public MoveBackState m_cMoveBackState; //回退状态
28 | public HurtState m_cHurtState; //受伤状态
29 | public SkillState m_cSkillState; //技能状态
30 | public DieState m_cDieState; //死亡状态
31 |
32 | public StateWrap(GfxObject obj)
33 | {
34 | this.m_cIdleState = new IdleState(obj);
35 | this.m_cAttackState = new AttackState(obj);
36 | this.m_cMoveState = new MoveState(obj);
37 | this.m_cMoveBackState = new MoveBackState(obj);
38 | this.m_cHurtState = new HurtState(obj);
39 | this.m_cSkillState = new SkillState(obj);
40 | this.m_cDieState = new DieState(obj);
41 | }
42 | }
43 |
44 | public StateControl(GfxObject obj)
45 | {
46 | this.m_cStateWrap = new StateWrap(obj);
47 | this.m_cCurrentState = null;
48 | }
49 |
50 | ///
51 | /// 获取当前状态
52 | ///
53 | ///
54 | public StateBase GetCurrentState()
55 | {
56 | return this.m_cCurrentState;
57 | }
58 |
59 | ///
60 | /// 逻辑更新
61 | ///
62 | ///
63 | public bool Update()
64 | {
65 | //状态更新
66 | if ( this.m_cCurrentState != null)
67 | {
68 | if (!this.m_cCurrentState.Update())
69 | {
70 | Idle();
71 | }
72 | }
73 | return true;
74 | }
75 |
76 | ///
77 | /// 死亡状态
78 | ///
79 | public void Die()
80 | {
81 | if (this.m_cCurrentState != null)
82 | this.m_cCurrentState.OnExit();
83 |
84 | this.m_cCurrentState = this.m_cStateWrap.m_cDieState;
85 | this.m_cCurrentState.OnEnter();
86 | }
87 |
88 | ///
89 | /// 移动状态
90 | ///
91 | ///
92 | ///
93 | public void Move( Vector3 pos , float costTime )
94 | {
95 | if (this.m_cCurrentState != null)
96 | this.m_cCurrentState.OnExit();
97 |
98 | this.m_cStateWrap.m_cMoveState.Set(pos, costTime);
99 | this.m_cCurrentState = this.m_cStateWrap.m_cMoveState;
100 | this.m_cCurrentState.OnEnter();
101 | }
102 |
103 | ///
104 | /// 回退
105 | ///
106 | ///
107 | ///
108 | public void MoveBack(Vector3 pos, float costTime)
109 | {
110 | if (this.m_cCurrentState != null)
111 | this.m_cCurrentState.OnExit();
112 |
113 | this.m_cStateWrap.m_cMoveBackState.Set(pos, costTime);
114 | this.m_cCurrentState = this.m_cStateWrap.m_cMoveBackState;
115 | this.m_cCurrentState.OnEnter();
116 | }
117 |
118 | ///
119 | /// 空闲状态
120 | ///
121 | public void Idle()
122 | {
123 | if (this.m_cCurrentState != null)
124 | this.m_cCurrentState.OnExit();
125 |
126 | this.m_cCurrentState = this.m_cStateWrap.m_cIdleState;
127 | this.m_cCurrentState.OnEnter();
128 | }
129 |
130 | //受伤状态
131 | public void Hurt()
132 | {
133 | if (this.m_cCurrentState != null)
134 | this.m_cCurrentState.OnExit();
135 |
136 | this.m_cCurrentState = this.m_cStateWrap.m_cHurtState;
137 | this.m_cCurrentState.OnEnter();
138 | }
139 |
140 | ///
141 | /// 攻击状态
142 | ///
143 | ///
144 | public void Attack()
145 | {
146 | if (this.m_cCurrentState != null)
147 | this.m_cCurrentState.OnExit();
148 |
149 | this.m_cCurrentState = this.m_cStateWrap.m_cAttackState;
150 | this.m_cCurrentState.OnEnter();
151 | }
152 |
153 |
154 | ///
155 | /// 技能状态
156 | ///
157 | public void Skill()
158 | {
159 | if (this.m_cCurrentState != null)
160 | this.m_cCurrentState.OnExit();
161 |
162 | this.m_cCurrentState = this.m_cStateWrap.m_cSkillState;
163 | this.m_cCurrentState.OnEnter();
164 | }
165 | }
166 |
167 | }
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/GFX/StateControl.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 83f8538afef2144d99904ac9df56a7c5
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/Role.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System.Collections;
3 |
4 | public class Role : MonoBehaviour {
5 |
6 | // Use this for initialization
7 | void Start () {
8 |
9 | }
10 |
11 | // Update is called once per frame
12 | void Update () {
13 |
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/Scripts/Role.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f51ec8c8149a049b9b877779f6bc7ec9
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/test.unity:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Assets/test.unity
--------------------------------------------------------------------------------
/Unity3DFSM/Assets/test.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2f988097313f447b0abee038147e9358
3 | DefaultImporter:
4 | userData:
5 |
--------------------------------------------------------------------------------
/Unity3DFSM/Library/AnnotationManager:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/AnnotationManager
--------------------------------------------------------------------------------
/Unity3DFSM/Library/AssetImportState:
--------------------------------------------------------------------------------
1 | 4;0;-1
--------------------------------------------------------------------------------
/Unity3DFSM/Library/AssetServerCacheV3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/AssetServerCacheV3
--------------------------------------------------------------------------------
/Unity3DFSM/Library/AssetVersioning.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/AssetVersioning.db
--------------------------------------------------------------------------------
/Unity3DFSM/Library/BuildPlayer.prefs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/BuildPlayer.prefs
--------------------------------------------------------------------------------
/Unity3DFSM/Library/BuildSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/BuildSettings.asset
--------------------------------------------------------------------------------
/Unity3DFSM/Library/CurrentLayout.dwlt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/CurrentLayout.dwlt
--------------------------------------------------------------------------------
/Unity3DFSM/Library/EditorUserBuildSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/EditorUserBuildSettings.asset
--------------------------------------------------------------------------------
/Unity3DFSM/Library/EditorUserSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/EditorUserSettings.asset
--------------------------------------------------------------------------------
/Unity3DFSM/Library/FailedAssetImports.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/FailedAssetImports.txt
--------------------------------------------------------------------------------
/Unity3DFSM/Library/InspectorExpandedItems.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/InspectorExpandedItems.asset
--------------------------------------------------------------------------------
/Unity3DFSM/Library/MonoManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/MonoManager.asset
--------------------------------------------------------------------------------
/Unity3DFSM/Library/ProjectSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/ProjectSettings.asset
--------------------------------------------------------------------------------
/Unity3DFSM/Library/ScriptAssemblies/Assembly-CSharp.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/ScriptAssemblies/Assembly-CSharp.dll
--------------------------------------------------------------------------------
/Unity3DFSM/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb
--------------------------------------------------------------------------------
/Unity3DFSM/Library/ScriptAssemblies/CompilationCompleted.txt:
--------------------------------------------------------------------------------
1 | Completed
2 |
--------------------------------------------------------------------------------
/Unity3DFSM/Library/ScriptMapper:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/ScriptMapper
--------------------------------------------------------------------------------
/Unity3DFSM/Library/ShaderCache.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/ShaderCache.db
--------------------------------------------------------------------------------
/Unity3DFSM/Library/assetDatabase3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/assetDatabase3
--------------------------------------------------------------------------------
/Unity3DFSM/Library/expandedItems:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/expandedItems
--------------------------------------------------------------------------------
/Unity3DFSM/Library/guidmapper:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/guidmapper
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/00/00000000000000001000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/00/00000000000000001000000000000000
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/00/00000000000000002000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/00/00000000000000002000000000000000
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/00/00000000000000003000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/00/00000000000000003000000000000000
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/00/00000000000000004000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/00/00000000000000004000000000000000
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/00/00000000000000004100000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/00/00000000000000004100000000000000
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/00/00000000000000005000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/00/00000000000000005000000000000000
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/00/00000000000000005100000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/00/00000000000000005100000000000000
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/00/00000000000000006000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/00/00000000000000006000000000000000
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/00/00000000000000006100000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/00/00000000000000006100000000000000
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/00/00000000000000007000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/00/00000000000000007000000000000000
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/00/00000000000000008000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/00/00000000000000008000000000000000
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/00/00000000000000009000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/00/00000000000000009000000000000000
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/00/0000000000000000a000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/00/0000000000000000a000000000000000
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/00/0000000000000000b000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/00/0000000000000000b000000000000000
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/00/0000000000000000c000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/00/0000000000000000c000000000000000
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/02/02fca1b5f0d914abfb27f4c0e03619f8:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/02/02fca1b5f0d914abfb27f4c0e03619f8
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/18/18c2a8574c8e24593b60cc78d98d0caf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/18/18c2a8574c8e24593b60cc78d98d0caf
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/2f/2f988097313f447b0abee038147e9358:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/2f/2f988097313f447b0abee038147e9358
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/3e/3e21b45f5857049c98ff8a4b8a249307:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/3e/3e21b45f5857049c98ff8a4b8a249307
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/44/440a6de95f30347f0a9c939a67d8df0d:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/44/440a6de95f30347f0a9c939a67d8df0d
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/83/83f8538afef2144d99904ac9df56a7c5:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/83/83f8538afef2144d99904ac9df56a7c5
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/8b/8b7fe1b3809b64581a8840d5a0477c01:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/8b/8b7fe1b3809b64581a8840d5a0477c01
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/8d/8dd6e30a011624fb6986aa1227f155c5:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/8d/8dd6e30a011624fb6986aa1227f155c5
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/8f/8f86814775cd34c69a014d4ea66d5fa4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/8f/8f86814775cd34c69a014d4ea66d5fa4
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/90/9032fef241d6f47fabb5446e93f9de68:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/90/9032fef241d6f47fabb5446e93f9de68
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/9e/9ec810f1515594d12953885587c74510:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/9e/9ec810f1515594d12953885587c74510
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/ad/ad6f395c822d24ca3b0f8ade16fcbc76:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/ad/ad6f395c822d24ca3b0f8ade16fcbc76
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/ae/ae76310935e6746f680a0d8f072c737e:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/ae/ae76310935e6746f680a0d8f072c737e
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/af/af4d57bdb8d3a44f1a245fdcee8f51de:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/af/af4d57bdb8d3a44f1a245fdcee8f51de
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/b6/b63be112a0956484f94971b2094aa9a3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/b6/b63be112a0956484f94971b2094aa9a3
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/b9/b998dcd2dea674c1ea9246dc24a24e3b:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/b9/b998dcd2dea674c1ea9246dc24a24e3b
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/c1/c1556887adc574a1bb86dd3c0f032720:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/c1/c1556887adc574a1bb86dd3c0f032720
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/cb/cbe2b26e849d1473abee09c1748f670c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/cb/cbe2b26e849d1473abee09c1748f670c
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/d6/d6d6227a8e0cd4604976a8570cec2633:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/d6/d6d6227a8e0cd4604976a8570cec2633
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/d7/d7f7478a0d6244eaca8e7ac21d6dff26:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/d7/d7f7478a0d6244eaca8e7ac21d6dff26
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/da/da0b6ebb3abaa4a1f9534c1c6516cf85:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/da/da0b6ebb3abaa4a1f9534c1c6516cf85
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/ef/efdbc9837ece342638106cbceda4b302:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/ef/efdbc9837ece342638106cbceda4b302
--------------------------------------------------------------------------------
/Unity3DFSM/Library/metadata/f5/f51ec8c8149a049b9b877779f6bc7ec9:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Library/metadata/f5/f51ec8c8149a049b9b877779f6bc7ec9
--------------------------------------------------------------------------------
/Unity3DFSM/ProjectSettings/AudioManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/ProjectSettings/AudioManager.asset
--------------------------------------------------------------------------------
/Unity3DFSM/ProjectSettings/DynamicsManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/ProjectSettings/DynamicsManager.asset
--------------------------------------------------------------------------------
/Unity3DFSM/ProjectSettings/EditorBuildSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/ProjectSettings/EditorBuildSettings.asset
--------------------------------------------------------------------------------
/Unity3DFSM/ProjectSettings/EditorSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/ProjectSettings/EditorSettings.asset
--------------------------------------------------------------------------------
/Unity3DFSM/ProjectSettings/GraphicsSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/ProjectSettings/GraphicsSettings.asset
--------------------------------------------------------------------------------
/Unity3DFSM/ProjectSettings/InputManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/ProjectSettings/InputManager.asset
--------------------------------------------------------------------------------
/Unity3DFSM/ProjectSettings/NavMeshLayers.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/ProjectSettings/NavMeshLayers.asset
--------------------------------------------------------------------------------
/Unity3DFSM/ProjectSettings/NetworkManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/ProjectSettings/NetworkManager.asset
--------------------------------------------------------------------------------
/Unity3DFSM/ProjectSettings/Physics2DSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/ProjectSettings/Physics2DSettings.asset
--------------------------------------------------------------------------------
/Unity3DFSM/ProjectSettings/ProjectSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/ProjectSettings/ProjectSettings.asset
--------------------------------------------------------------------------------
/Unity3DFSM/ProjectSettings/QualitySettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/ProjectSettings/QualitySettings.asset
--------------------------------------------------------------------------------
/Unity3DFSM/ProjectSettings/TagManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/ProjectSettings/TagManager.asset
--------------------------------------------------------------------------------
/Unity3DFSM/ProjectSettings/TimeManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/ProjectSettings/TimeManager.asset
--------------------------------------------------------------------------------
/Unity3DFSM/Temp/UnityLockfile:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luzexi/Unity3DFSM/52a898b16f37452bddd4473812f87cbda3c91504/Unity3DFSM/Temp/UnityLockfile
--------------------------------------------------------------------------------
/Unity3DFSM/Temp/UnityTempFile-aedb297b1a7c94f5f9d4c1cd2166a708:
--------------------------------------------------------------------------------
1 | -debug
2 | -target:library
3 | -nowarn:0169
4 | -out:'Temp/Assembly-CSharp.dll'
5 | -r:'/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll'
6 | -r:'/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll'
7 | -define:UNITY_4_5_0
8 | -define:UNITY_4_5
9 | -define:UNITY_STANDALONE_OSX
10 | -define:ENABLE_MICROPHONE
11 | -define:ENABLE_TEXTUREID_MAP
12 | -define:ENABLE_UNITYEVENTS
13 | -define:ENABLE_NEW_HIERARCHY
14 | -define:ENABLE_AUDIO_FMOD
15 | -define:UNITY_STANDALONE
16 | -define:ENABLE_MONO
17 | -define:ENABLE_TERRAIN
18 | -define:ENABLE_SUBSTANCE
19 | -define:ENABLE_GENERICS
20 | -define:INCLUDE_WP8SUPPORT
21 | -define:ENABLE_MOVIES
22 | -define:ENABLE_WWW
23 | -define:ENABLE_IMAGEEFFECTS
24 | -define:ENABLE_WEBCAM
25 | -define:INCLUDE_METROSUPPORT
26 | -define:RENDER_SOFTWARE_CURSOR
27 | -define:ENABLE_NETWORK
28 | -define:ENABLE_PHYSICS
29 | -define:ENABLE_CACHING
30 | -define:ENABLE_CLOTH
31 | -define:ENABLE_2D_PHYSICS
32 | -define:ENABLE_GAMECENTER
33 | -define:ENABLE_SHADOWS
34 | -define:ENABLE_AUDIO
35 | -define:ENABLE_NAVMESH_CARVING
36 | -define:ENABLE_DUCK_TYPING
37 | -define:ENABLE_SINGLE_INSTANCE_BUILD_SETTING
38 | -define:ENABLE_PROFILER
39 | -define:UNITY_EDITOR
40 | -define:UNITY_EDITOR_OSX
41 | -define:UNITY_TEAM_LICENSE
42 | -define:UNITY_PRO_LICENSE
43 | 'Assets/Scripts/GFX/CAnimation.cs'
44 | 'Assets/Scripts/GFX/CTransform.cs'
45 | 'Assets/Scripts/GFX/GFXControl/AIControl.cs'
46 | 'Assets/Scripts/GFX/GFXControl/CmdControl.cs'
47 | 'Assets/Scripts/GFX/GFXControl/CmdState/CmdStateBase.cs'
48 | 'Assets/Scripts/GFX/GfxObject.cs'
49 | 'Assets/Scripts/GFX/State/AttackState.cs'
50 | 'Assets/Scripts/GFX/State/DieState.cs'
51 | 'Assets/Scripts/GFX/State/HurtState.cs'
52 | 'Assets/Scripts/GFX/State/IdleState.cs'
53 | 'Assets/Scripts/GFX/State/MoveBackState.cs'
54 | 'Assets/Scripts/GFX/State/MoveState.cs'
55 | 'Assets/Scripts/GFX/State/SkillState.cs'
56 | 'Assets/Scripts/GFX/State/StateBase.cs'
57 | 'Assets/Scripts/GFX/StateControl.cs'
58 | 'Assets/Scripts/Role.cs'
59 | -r:'/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/System.Runtime.Serialization.dll'
60 | -r:'/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/System.Xml.Linq.dll'
61 |
--------------------------------------------------------------------------------
/Unity3DFSM/Unity3DFSM-csharp.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 11.00
2 | # Visual Studio 2008
3 |
4 | Project("{82AFBE63-EEEE-C2A8-3642-EA5E64089916}") = "Unity3DFSM", "Assembly-CSharp-vs.csproj", "{9A93F800-DAED-310C-D69A-9F541F6DBD11}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {9A93F800-DAED-310C-D69A-9F541F6DBD11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {9A93F800-DAED-310C-D69A-9F541F6DBD11}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {9A93F800-DAED-310C-D69A-9F541F6DBD11}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {9A93F800-DAED-310C-D69A-9F541F6DBD11}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | GlobalSection(MonoDevelopProperties) = preSolution
21 | StartupItem = Assembly-CSharp.csproj
22 | Policies = $0
23 | $0.TextStylePolicy = $1
24 | $1.inheritsSet = null
25 | $1.scope = text/x-csharp
26 | $0.CSharpFormattingPolicy = $2
27 | $2.inheritsSet = Mono
28 | $2.inheritsScope = text/x-csharp
29 | $2.scope = text/x-csharp
30 | $0.TextStylePolicy = $3
31 | $3.FileWidth = 120
32 | $3.TabWidth = 4
33 | $3.EolMarker = Unix
34 | $3.inheritsSet = Mono
35 | $3.inheritsScope = text/plain
36 | $3.scope = text/plain
37 | EndGlobalSection
38 |
39 | EndGlobal
40 |
--------------------------------------------------------------------------------
/Unity3DFSM/Unity3DFSM.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 11.00
2 | # Visual Studio 2008
3 |
4 | Project("{82AFBE63-EEEE-C2A8-3642-EA5E64089916}") = "Unity3DFSM", "Assembly-CSharp.csproj", "{9A93F800-DAED-310C-D69A-9F541F6DBD11}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {9A93F800-DAED-310C-D69A-9F541F6DBD11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {9A93F800-DAED-310C-D69A-9F541F6DBD11}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {9A93F800-DAED-310C-D69A-9F541F6DBD11}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {9A93F800-DAED-310C-D69A-9F541F6DBD11}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | GlobalSection(MonoDevelopProperties) = preSolution
21 | StartupItem = Assembly-CSharp.csproj
22 | Policies = $0
23 | $0.TextStylePolicy = $1
24 | $1.inheritsSet = null
25 | $1.scope = text/x-csharp
26 | $0.CSharpFormattingPolicy = $2
27 | $2.inheritsSet = Mono
28 | $2.inheritsScope = text/x-csharp
29 | $2.scope = text/x-csharp
30 | $0.TextStylePolicy = $3
31 | $3.FileWidth = 120
32 | $3.TabWidth = 4
33 | $3.EolMarker = Unix
34 | $3.inheritsSet = Mono
35 | $3.inheritsScope = text/plain
36 | $3.scope = text/plain
37 | EndGlobalSection
38 |
39 | EndGlobal
40 |
--------------------------------------------------------------------------------
/Unity3DFSM/Unity3DFSM.userprefs:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------