summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Test/SaionjiScript_States.cs
blob: 0ed8eef2784e96d708b1c34e1632f01bb910e6d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public partial class SaionjiScript : Avatar
{

	/// <summary>
	/// 设置states
	/// </summary>
	void SetupStates()
	{
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		// states
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		IdleState idle = new IdleState(animator, Anim_Idle);

		MoveState move = new MoveState(animator, Anim_Run);
		MoveState dash = new MoveState(animator, Anim_DashWithSword);

		JumpStateConfig jumpConfig = new JumpStateConfig
		{
			animator = animator,
			collider = m_BodyCollider,
			body = m_Body,
			neutralJumpSpeedY = 13f,
			fowardJumpSpeedX = 5f,
			backwardJumpSpeedX = -5f,
			animJump = Anim_JumpStart,
			animJumpEnd = Anim_JumpEnd,
			animNU = Anim_JumpUp,
			animND = Anim_JumpDown,
			animFU = Anim_JumpUp,
			animFD = Anim_JumpDown,
			animBU = Anim_JumpUp,
			animBD = Anim_JumpDown,
			skipStart = true,
		};
        JumpState jump = new JumpState(jumpConfig);

		AttackState airDash = new AttackState(animator, Anim_AirDash, m_Body);

		AttackStateConfig config;

        //招式会绑定一个motion
        HitDefination hitDef = new HitDefination
        {
            type = HitType.Air,
            hurtAddForce = new Vector3(0, 20000, 0),
            sparkName = "Bullet_WhiteSpark",
            sparkHostType = HitSparkHost.Center
        };
		AttackState attk1 = new AttackState(animator, Anim_LightAttack1, m_Body);
        attk1.AddHitDefination(hitDef);
        AttackState attk2 = new AttackState(animator, Anim_LightAttack2, m_Body);
        attk2.AddHitDefination(hitDef);
        AttackState attk3 = new AttackState(animator, Anim_LightAttack3, m_Body);
        attk3.AddHitDefination(hitDef);
        AttackState attk4 = new AttackState(animator, Anim_LightAttack4, m_Body);
        attk4.AddHitDefination(hitDef);
        AttackState attk5 = new AttackState(animator, Anim_LightAttack5, m_Body);
        attk5.AddHitDefination(hitDef);
        AttackState attkRush = new AttackState(animator, Anim_LightAttackRush, m_Body);

		config = new AttackStateConfig() {
			animator = this.animator,
			body = this.m_Body,
			motion = Anim_SideKick,
			velocity = new Vector3(20, 1.5f, 0) 
		};
		AttackState sideKick = new AttackState(config);

		AttackState sideKickRush = new AttackState(animator, Anim_SideKickRush, m_Body);
		AttackState superKick = new AttackState(animator, Anim_SuperKick, m_Body);
		AttackState gun1 = new AttackState(animator, Anim_Gun1, m_Body);
		AttackState gun2 = new AttackState(animator, Anim_Gun2, m_Body);
		AttackState gun3 = new AttackState(animator, Anim_Gun3, m_Body);
		AttackState gun4 = new AttackState(animator, Anim_Gun4, m_Body);

		AttackState airAttk1 = new AttackState(animator, Anim_AirAttack1, m_Body);
		hitDef = new HitDefination
		{
			type = HitType.Air,
            hurtAddForce = new Vector3(0,10000,0),
            sparkName = "Bullet_WhiteSpark",
            sparkHostType = HitSparkHost.Center
        };
        airAttk1.AddHitDefination(hitDef);

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // actions
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ActionTurn180 turn180 = new ActionTurn180(this.transform);
		ActionTowardLeft towardLeft = new ActionTowardLeft(this.transform);
		ActionTowardRight towardRight = new ActionTowardRight(this.transform);

        ActionJump toJump = new ActionJump(m_StateController, jump);
		ActionJumpForward toJumpForward = new ActionJumpForward(m_StateController, jump);

		ActionSwitchState switchToMove = new ActionSwitchState(m_StateController, move);
		ActionSwitchState switchToIdle = new ActionSwitchState(m_StateController, idle);
		ActionSwitchState switchToAttk1 = new ActionSwitchState(m_StateController, attk1);
		ActionSwitchState switchToAttk2 = new ActionSwitchState(m_StateController, attk2);
		ActionSwitchState switchToAttk3 = new ActionSwitchState(m_StateController, attk3);
		ActionSwitchState switchToAttk4 = new ActionSwitchState(m_StateController, attk4);
		ActionSwitchState switchToAttk5 = new ActionSwitchState(m_StateController, attk5);
		ActionSwitchState switchToAttkRush = new ActionSwitchState(m_StateController, attkRush);
		ActionSwitchState switchToSideKick = new ActionSwitchState(m_StateController, sideKick);
		ActionSwitchState switchToSideKickRush = new ActionSwitchState(m_StateController, sideKickRush);
		ActionSwitchState switchToDash = new ActionSwitchState(m_StateController, dash);
		ActionSwitchState switchToSuperKick = new ActionSwitchState(m_StateController, superKick);
		ActionSwitchState switchToGun1 = new ActionSwitchState(m_StateController, gun1);
		ActionSwitchState switchToGun2 = new ActionSwitchState(m_StateController, gun2);
		ActionSwitchState switchToGun3 = new ActionSwitchState(m_StateController, gun3);
		ActionSwitchState switchToGun4 = new ActionSwitchState(m_StateController, gun4);

		ActionSwitchState switchToAirDash = new ActionSwitchState(m_StateController, airDash);
		ActionSwitchState switchToAirAttk1 = new ActionSwitchState(m_StateController, airAttk1);

		ActionWipeCmdRecord wipeCmdRecord = new ActionWipeCmdRecord();

		ActionEffectGhost enableGhost = new ActionEffectGhost(Effects[0] as CharacterGhostEffect);
		ActionDisableGhost disableGhost = new ActionDisableGhost(Effects[0] as CharacterGhostEffect);

        ActionActivateAfterImage enableAfterImage = new ActionActivateAfterImage(true);
        ActionActivateAfterImage disaleAfterImage = new ActionActivateAfterImage(false);
        ActionAfterImageInterval smallAfterImageInterval = new ActionAfterImageInterval(2);
        ActionAfterImageInterval midiumAfterImageInterval = new ActionAfterImageInterval(5);

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // conditions
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ConditionCommand condLeftCmd = new ConditionCommand(GamepadButton.Left);
		ConditionCommand condRightCmd = new ConditionCommand(GamepadButton.Right);
		ConditionNoMoveButtonHold condNoMoveButtonHold = new ConditionNoMoveButtonHold();
		ConditionButtonHold condRightButtonHold = new ConditionButtonHold(GamepadButton.Right);
		ConditionButtonHold condLeftButtonHold = new ConditionButtonHold(GamepadButton.Left);
		ConditionCommand condUpCmd = new ConditionCommand(GamepadButton.Up);
		ConditionCommand condTriangleCmd = new ConditionCommand(GamepadButton.Triangle);
		ConditionCommand condCircleCmd = new ConditionCommand(GamepadButton.Circle);
        ConditionCommand condCrossCmd = new ConditionCommand(GamepadButton.Cross);
		ConditionCommand condSquareCmd = new ConditionCommand(GamepadButton.Square);
		ConditionTowardLeft condTowardLeft = new ConditionTowardLeft(this.transform);
		ConditionTowardRight condTowardRight = new ConditionTowardRight(this.transform);
		ConditionCommandSeq condRight2Cmd = new ConditionCommandSeq(new List<GamepadButton>{GamepadButton.Right, GamepadButton.Right }, 0.8f);
		ConditionCommandSeq condLeft2Cmd = new ConditionCommandSeq(new List<GamepadButton> { GamepadButton.Left, GamepadButton.Left }, 0.8f);
		ConditionCommandSeq condDRC = new ConditionCommandSeq(new List<GamepadButton> { GamepadButton.Down, GamepadButton.Right, GamepadButton.Circle}, 1f);
		ConditionCommandSeq condDLC = new ConditionCommandSeq(new List<GamepadButton> { GamepadButton.Down, GamepadButton.Left, GamepadButton.Circle }, 1f);
		ConditionCommandSeq condDR = new ConditionCommandSeq(new List<GamepadButton> { GamepadButton.Down, GamepadButton.Right}, 1f);
		ConditionCommandSeq condDL = new ConditionCommandSeq(new List<GamepadButton> { GamepadButton.Down, GamepadButton.Left}, 1f);

		ConditionHit condIsHit = new ConditionHit(this);

        ConditionJumpDone condJumpDone = new ConditionJumpDone(jump);
		ConditionJumpOnGround condJumpOnGround = new ConditionJumpOnGround(jump);

		ConditionInAir condInAir = new ConditionInAir(m_BodyCollider);

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // common triggers
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        Trigger triggerTurnRight = new Trigger(And(condRightCmd, Not(condTowardRight)), towardRight);
		Trigger triggerTurnLeft = new Trigger(And(condLeftCmd, Not(condTowardLeft)), towardLeft);

		Trigger trigger = null;

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // state setup
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        // idle state
        trigger = new Trigger(condTriangleCmd, toJump) ;
        idle.AddTrigger(trigger);
		trigger = new Trigger(And(condTowardRight, condDRC), new List<ActionBase> { wipeCmdRecord, switchToSuperKick });
		idle.AddTrigger(trigger);
		trigger = new Trigger(And(condTowardLeft, condDLC), new List<ActionBase> { wipeCmdRecord, switchToSuperKick });
		idle.AddTrigger(trigger);
		trigger = new Trigger(And(condTowardRight, And(condRightCmd, condRight2Cmd)), new List<ActionBase> { wipeCmdRecord , switchToDash  });
		idle.AddTrigger(trigger);
		trigger = new Trigger(And(condTowardLeft, And(condLeftCmd, condLeft2Cmd)), new List<ActionBase> { wipeCmdRecord , switchToDash });
		idle.AddTrigger(trigger);
		trigger = new Trigger(And(condRightButtonHold, Not(condDR)), new List<ActionBase> { switchToMove, towardRight });
		idle.AddTrigger(trigger);
		trigger = new Trigger(And(condLeftButtonHold, Not(condDL)), new List<ActionBase> { switchToMove, towardLeft });
		idle.AddTrigger(trigger);
		trigger = new Trigger(condCircleCmd, switchToAttk1);
		idle.AddTrigger(trigger);
		trigger = new Trigger(condCrossCmd, switchToSideKick);
		idle.AddTrigger(trigger);
		trigger = new Trigger(condSquareCmd, switchToGun1);
		idle.AddTrigger(trigger);
		idle.AddTrigger(triggerTurnRight);
		idle.AddTrigger(triggerTurnLeft);

        // move state
        //trigger = new Trigger(Or(Ands(condRightButtonHold, condTowardRight, condTriangleCmd), Ands(condLeftButtonHold, condTowardLeft, condTriangleCmd)), toJumpForward);
        //move.AddTrigger(trigger);
        trigger = new Trigger(condTriangleCmd, toJump);
        move.AddTrigger(trigger);
        trigger = new Trigger(And(condTowardRight, And(condRightCmd, condRight2Cmd)), new List<ActionBase> { wipeCmdRecord, switchToDash, });
		move.AddTrigger(trigger);
		trigger = new Trigger(And(condTowardLeft, And(condLeftCmd, condLeft2Cmd)), new List<ActionBase> { wipeCmdRecord, switchToDash });
		move.AddTrigger(trigger);
		trigger = new Trigger(And(condRightButtonHold, condCircleCmd), new List<ActionBase> { towardRight, switchToAttkRush });
		move.AddTrigger(trigger);
		trigger = new Trigger(And(condLeftButtonHold, condCircleCmd), new List<ActionBase> { towardLeft, switchToAttkRush });
		move.AddTrigger(trigger);
		trigger = new Trigger(And(condRightButtonHold, condCrossCmd), new List<ActionBase> { towardRight, switchToSideKickRush });
		move.AddTrigger(trigger);
		trigger = new Trigger(And(condLeftButtonHold, condCrossCmd), new List<ActionBase> { towardLeft, switchToSideKickRush });
		move.AddTrigger(trigger);
		trigger = new Trigger(And(condTowardRight, Not(condRightButtonHold)), switchToIdle);
		move.AddTrigger(trigger);
		trigger = new Trigger(And(condTowardLeft, Not(condLeftButtonHold)), switchToIdle);
		move.AddTrigger(trigger);
		trigger = new Trigger(condCircleCmd, switchToAttk1);
		move.AddTrigger(trigger);
		trigger = new Trigger(condCrossCmd, switchToSideKick);
		move.AddTrigger(trigger);

		// jump state 
		trigger = new Trigger(condJumpOnGround, new ActionSetVelocity(m_Body, Vector3.zero), TriggerOnlyOnce.On, TriggerSwallow.Off);
		jump.AddTrigger(trigger);
		trigger = new Trigger(Ands(condInAir, condRightCmd, condRight2Cmd), new List<ActionBase> { towardRight, switchToAirDash, new ActionSetVelocity(m_Body, new Vector3(25, 0, 0)), new ActionDontUseGravity(m_Body), enableAfterImage, midiumAfterImageInterval});
		jump.AddTrigger(trigger);
		trigger = new Trigger(Ands(condInAir, condLeftCmd, condLeft2Cmd), new List<ActionBase> { towardLeft, switchToAirDash, new ActionSetVelocity(m_Body, new Vector3(-25, 0, 0)), new ActionDontUseGravity(m_Body), enableAfterImage, midiumAfterImageInterval });
		jump.AddTrigger(trigger);
		trigger = new Trigger(Ands(condInAir, condCircleCmd), new List<ActionBase> { switchToAirAttk1, new ActionSetLocalVelocity(m_Body, new Vector3(0, 0, 0)), new ActionDontUseGravity(m_Body), enableAfterImage, smallAfterImageInterval});
		jump.AddTrigger(trigger);
		ConditionCheckJumpState condCheckJump = new ConditionCheckJumpState(jump, JumpState.Stage.None, JumpState.Direction.Neutral);
		trigger = new Trigger(And(condRightButtonHold, condCheckJump), new List<ActionBase> { towardRight, new ActionSetVelocityX(m_Body, 4)}, TriggerOnlyOnce.Off, TriggerSwallow.Off);
		jump.AddTrigger(trigger);
		trigger = new Trigger(And(condLeftButtonHold, condCheckJump), new List<ActionBase> { towardLeft, new ActionSetVelocityX(m_Body,-4) }, TriggerOnlyOnce.Off, TriggerSwallow.Off);
		jump.AddTrigger(trigger);
		//trigger = new Trigger(Ands(condCheckJump, Not(condRightButtonHold), Not(condLeftButtonHold)), new ActionSetVelocityX(m_Body, 0), TriggerOnlyOnce.Off, TriggerSwallow.Off);
		//jump.AddTrigger(trigger);
		trigger = new Trigger(Ands(new ConditionJumpDone(jump, 0.4f), condJumpOnGround, Or(condRightButtonHold, condLeftButtonHold)), switchToMove);
		jump.AddTrigger(trigger);
		trigger = new Trigger(condJumpDone, switchToIdle);
        jump.AddTrigger(trigger);

		// dash state
		trigger = new Trigger(And(new ConditionMotionRange(animator, 0.5f, 1.0f), condCircleCmd), switchToAttk1);
		dash.AddTrigger(trigger);
		trigger = new Trigger(new ConditionMotionAtEnd(animator, Anim_DashWithSword), switchToIdle);
		dash.AddTrigger(trigger);

		// attack states
		float expireTime = 0.3f;

		// sword normal attack
		ConditionMotionAtEnd condAttk1AtEnd = new ConditionMotionAtEnd(animator, Anim_LightAttack1);
		trigger = new Trigger(And(condAttk1AtEnd, condCircleCmd), switchToAttk2);
		attk1.AddTrigger(trigger);
		ConditionAttkExpireTime condAttk1ExpireTime = new ConditionAttkExpireTime(attk1, expireTime);
		trigger = new Trigger(condAttk1ExpireTime, switchToIdle);
		attk1.AddTrigger(trigger);
		attk1.AddTrigger(triggerTurnRight);
		attk1.AddTrigger(triggerTurnLeft);
		//trigger = new Trigger(condIsHit, new ActionLog("hit!!!"));
		//attk1.AddLateTrigger(trigger);

		//ConditionMotionRange condAttkRushGhostRange = new ConditionMotionRange(animator, 0f, 0.8f);
		//trigger = new Trigger(condAttkRushGhostRange, enableGhost, false);
		//attkRush.AddTrigger(trigger);
		//ConditionMotionRange condAttkRushGhostDisableRange = new ConditionMotionRange(animator, 0.8f, 10f);
		//trigger = new Trigger(condAttkRushGhostDisableRange, disableGhost, false);
		//attkRush.AddTrigger(trigger);
		ConditionMotionRange condAttkRushAtRange = new ConditionMotionRange(animator, 0.5f, 1f);
		trigger = new Trigger(And(condAttkRushAtRange, condCircleCmd), switchToAttk2);
		attkRush.AddTrigger(trigger);
		//trigger = new Trigger(And(And(condAttkRushAtRange, condTowardRight), condRightCmd), switchToAttkRush);
		//attkRush.AddTrigger(trigger);
		//trigger = new Trigger(And(And(condAttkRushAtRange, condTowardLeft), condLeftCmd), switchToAttkRush);
		//attkRush.AddTrigger(trigger);
		ConditionAttkExpireTime condAttkRushExpireTime = new ConditionAttkExpireTime(attkRush, expireTime);
		trigger = new Trigger(condAttkRushExpireTime, switchToIdle);
		attkRush.AddTrigger(trigger);
		//attkRush.AddTrigger(triggerTurnRight);
		//attkRush.AddTrigger(triggerTurnLeft);

		ConditionMotionAtEnd condAttk2AtEnd = new ConditionMotionAtEnd(animator, Anim_LightAttack2);
		trigger = new Trigger(And(condAttk2AtEnd, condCircleCmd), switchToAttk3);
		attk2.AddTrigger(trigger);
		ConditionAttkExpireTime condAttk2ExpireTime = new ConditionAttkExpireTime(attk2, expireTime);
		trigger = new Trigger(condAttk2ExpireTime, switchToIdle);
		attk2.AddTrigger(trigger);
		attk2.AddTrigger(triggerTurnRight);
		attk2.AddTrigger(triggerTurnLeft);

		ConditionMotionAtEnd condAttk3AtEnd = new ConditionMotionAtEnd(animator, Anim_LightAttack3);
		trigger = new Trigger(And(condAttk3AtEnd, condCircleCmd), switchToAttk4);
		attk3.AddTrigger(trigger);
		ConditionAttkExpireTime condAttk3ExpireTime = new ConditionAttkExpireTime(attk3, expireTime);
		trigger = new Trigger(condAttk3ExpireTime, switchToIdle);
		attk3.AddTrigger(trigger);
		attk3.AddTrigger(triggerTurnRight);
		attk3.AddTrigger(triggerTurnLeft);

		ConditionMotionAtEnd condAttk4AtEnd = new ConditionMotionAtEnd(animator, Anim_LightAttack4);
		trigger = new Trigger(And(condAttk4AtEnd, condCircleCmd), switchToAttk5);
		attk4.AddTrigger(trigger);
		ConditionAttkExpireTime condAttk4ExpireTime = new ConditionAttkExpireTime(attk4, expireTime);
		trigger = new Trigger(condAttk4ExpireTime, switchToIdle);
		attk4.AddTrigger(trigger);
		attk4.AddTrigger(triggerTurnRight);
		attk4.AddTrigger(triggerTurnLeft);

		ConditionMotionAtEnd condAttk5AtEnd = new ConditionMotionAtEnd(animator, Anim_LightAttack5);
		trigger = new Trigger(condAttk5AtEnd, switchToIdle);
		attk5.AddTrigger(trigger);
		ConditionAttkExpireTime condAttk5ExpireTime = new ConditionAttkExpireTime(attk5, expireTime);
		trigger = new Trigger(condAttk5ExpireTime, switchToIdle);
		attk5.AddTrigger(trigger);
		attk5.AddTrigger(triggerTurnRight);
		attk5.AddTrigger(triggerTurnLeft);

		// side kick normal
		ConditionMotionAtEnd condKickMotionEnd = new ConditionMotionAtEnd(animator, Anim_SideKick);
		trigger = new Trigger(condKickMotionEnd, new ActionSetVelocity(m_Body, Vector3.zero), TriggerOnlyOnce.On, TriggerSwallow.Off);
		sideKick.AddTrigger(trigger);
		ConditionAttkExpireTime condSideKickExpireTime = new ConditionAttkExpireTime(sideKick, expireTime);
		trigger = new Trigger(condSideKickExpireTime, switchToIdle);
		sideKick.AddTrigger(trigger);

		// side kick rush
		ConditionAttkExpireTime condSideKickRushExpireTime = new ConditionAttkExpireTime(sideKickRush, expireTime);
		trigger = new Trigger(condSideKickRushExpireTime, switchToIdle);
		sideKickRush.AddTrigger(trigger);
		ConditionMotionRange condSideKickRushMotionRange = new ConditionMotionRange(animator, 0.5f, 10f);
		trigger = new Trigger(And(condSideKickRushMotionRange, And(condRightButtonHold, condCircleCmd)), new List<ActionBase> { towardRight, switchToAttkRush });
		sideKickRush.AddTrigger(trigger);
		trigger = new Trigger(And(condSideKickRushMotionRange, And(condLeftButtonHold, condCircleCmd)), new List<ActionBase> { towardLeft, switchToAttkRush });
		sideKickRush.AddTrigger(trigger);

		// super kick combo
		ConditionMotionRange condSuperKickComboBegin = new ConditionMotionRange(animator, 0f, 1f);
		trigger = new Trigger(condSuperKickComboBegin, new ActionDontUseGravity(m_Body));
		superKick.AddTrigger(trigger);
		ConditionAttkExpireTime condSuperKickExpireTime = new ConditionAttkExpireTime(superKick, expireTime);
		trigger = new Trigger(condSuperKickExpireTime, new List < ActionBase >() { switchToIdle , new ActionUseGravity(m_Body) });
		superKick.AddTrigger(trigger);

		// gun normal
		ConditionMotionAtEnd condGun1AtEnd = new ConditionMotionAtEnd(animator, Anim_Gun1);
		trigger = new Trigger(And(condGun1AtEnd, condSquareCmd), switchToGun2);
		gun1.AddTrigger(trigger);
		ConditionAttkExpireTime condGun1ExpireTime = new ConditionAttkExpireTime(gun1, expireTime);
		trigger = new Trigger(condGun1ExpireTime, switchToIdle);
		gun1.AddTrigger(trigger);

		ConditionMotionAtEnd condGun2AtEnd = new ConditionMotionAtEnd(animator, Anim_Gun2);
		trigger = new Trigger(And(condGun2AtEnd, condSquareCmd), switchToGun3);
		gun2.AddTrigger(trigger);
		ConditionAttkExpireTime condGun2ExpireTime = new ConditionAttkExpireTime(gun2, expireTime);
		trigger = new Trigger(condGun2ExpireTime, switchToIdle);
		gun2.AddTrigger(trigger);

		ConditionMotionAtEnd condGun3AtEnd = new ConditionMotionAtEnd(animator, Anim_Gun3);
		trigger = new Trigger(And(condGun3AtEnd, condSquareCmd), switchToGun4);
		gun3.AddTrigger(trigger);
		ConditionAttkExpireTime condGun3ExpireTime = new ConditionAttkExpireTime(gun3, expireTime);
		trigger = new Trigger(condGun3ExpireTime, switchToIdle);
		gun3.AddTrigger(trigger);

		ConditionAttkExpireTime condGun4ExpireTime = new ConditionAttkExpireTime(gun4, expireTime);
		trigger = new Trigger(condGun4ExpireTime, switchToIdle);
		gun4.AddTrigger(trigger);
		ConditionMotionRange condGun4MotionRange = new ConditionMotionRange(animator, 0.6f, 1f);
		trigger = new Trigger(And(condGun4MotionRange, condRight2Cmd), new List<ActionBase> { switchToDash, towardRight });
		gun4.AddTrigger(trigger);
		trigger = new Trigger(And(condGun4MotionRange, condLeft2Cmd), new List<ActionBase> { switchToDash, towardLeft });
		gun4.AddTrigger(trigger);

        // air dash 
        trigger = new Trigger(new ConditionMotionRange(animator, 0.8f, 1f), disaleAfterImage, TriggerOnlyOnce.On, TriggerSwallow.Off);
        airDash.AddTrigger(trigger);
        trigger = new Trigger(new ConditionMotionAtEnd(animator, Anim_AirDash), new List<ActionBase> { new ActionSetVelocity(m_Body, Vector3.zero), new ActionUseGravity(m_Body), toJump });
		airDash.AddTrigger(trigger);

        trigger = new Trigger(new ConditionMotionRange(animator, 0.18f, 1f), new ActionPlayEffect("Air_Attk1", this, new Vector3(-136.805f, 0, 0), new Vector3(0.8f, 0.8f, 0.8f)), TriggerOnlyOnce.On, TriggerSwallow.Off);
        airAttk1.AddTrigger(trigger);
        trigger = new Trigger(new ConditionMotionRange(animator, 0.6f,1f), disaleAfterImage, TriggerOnlyOnce.On, TriggerSwallow.Off);
        airAttk1.AddTrigger(trigger);
        trigger = new Trigger(new ConditionMotionAtEnd(animator, Anim_AirAttack1), new List<ActionBase> { new ActionSetVelocity(m_Body, Vector3.zero), new ActionUseGravity(m_Body), toJump});
		airAttk1.AddTrigger(trigger);

        m_StateController.ForceStart(idle);
	}

}