-
Notifications
You must be signed in to change notification settings - Fork 0
/
GOAPActionFactory.cs
102 lines (98 loc) · 1.59 KB
/
GOAPActionFactory.cs
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
using System;
using UnityEngine;
public enum E_GOAPAction
{
invalid = -1,
move,
//0
gotoPos,
//70
gotoMeleeRange,
//70
combatMoveRight,
//0
combatMoveLeft,
//0
combatMoveForward,
//0
combatMoveBackward,
//0
combatRunForward,
//0
combatRunBackward,
//0
lookatTarget,
//95
weaponShow,
//90
weaponHide,
//0
attackMeleeOnce,
//0
attackWhirl,
//0
attackBerserk,
//0
attackMeleeTwoSwords,
//0
attackBow,
//0
attackBoss,
//20
attackRoll,
//20
attackCounter,
//20
orderAttack,
//0
orderDodge,
//0
rollToTarget,
//80
useLever,
//0
playAnim,
//0
injury,
//100
injuryOrochi,
//100
death,
//100
block,
//50
tount,
//0
knockdown,
//100
teleport,
//90
count
}
class GOAPActionFactory : System.Object
{
public static GOAPAction Create(E_GOAPAction type, Agent owner)
{
GOAPAction a;
switch (type)
{
case E_GOAPAction.move:
a = new GOAPActionMove(owner);
break;
case E_GOAPAction.gotoPos:
a = new GOAPActionGoTo(owner);
break;
case E_GOAPAction.weaponShow:
a = new GOAPActionWeaponShow(owner);
break;
case E_GOAPAction.weaponHide:
a = new GOAPActionWeaponHide(owner);
break;
default:
Debug.LogError("GOAPActionFactory - unknow state " + type);
return null;
}
a.InitAction();
return a;
}
}