diff options
author | chai <chaifix@163.com> | 2021-08-31 19:07:21 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-08-31 19:07:21 +0800 |
commit | ffd1d5af496e0a0eff343b27c4f0f965bbbf79eb (patch) | |
tree | c5a8ae2116040ce8c483454b2e82093f247db341 /Assets/Scripts/Unit/Controller | |
parent | 476abf41a7357db0dd870f0d221f1a26481ab2bf (diff) |
*projectile
Diffstat (limited to 'Assets/Scripts/Unit/Controller')
-rw-r--r-- | Assets/Scripts/Unit/Controller/MonsterController.cs | 14 | ||||
-rw-r--r-- | Assets/Scripts/Unit/Controller/UnitController.cs | 13 |
2 files changed, 19 insertions, 8 deletions
diff --git a/Assets/Scripts/Unit/Controller/MonsterController.cs b/Assets/Scripts/Unit/Controller/MonsterController.cs index 981e6d4b..9e7e7955 100644 --- a/Assets/Scripts/Unit/Controller/MonsterController.cs +++ b/Assets/Scripts/Unit/Controller/MonsterController.cs @@ -6,14 +6,6 @@ public class MonsterController : UnitController {
public override UnitType type { get { return UnitType.Monster; } }
- public Vector3 center
- {
- get
- {
- return GetComponentInChildren<Renderer>().bounds.center;
- }
- }
-
public override void Initialize(GameObject obj, string folder)
{
base.Initialize(obj, folder);
@@ -58,4 +50,10 @@ public class MonsterController : UnitController }
}
+ public override void OnGetShot(CollisionInfo info)
+ {
+ monsterState.ChangeState(MonsterState.EUnitState.HitLight, new MonsterState.HitLightParam());
+ }
+
+
}
\ No newline at end of file diff --git a/Assets/Scripts/Unit/Controller/UnitController.cs b/Assets/Scripts/Unit/Controller/UnitController.cs index 3568cb4e..9b3ef6e5 100644 --- a/Assets/Scripts/Unit/Controller/UnitController.cs +++ b/Assets/Scripts/Unit/Controller/UnitController.cs @@ -83,6 +83,14 @@ public class UnitController : MonoBehaviour/*, Interactable*/ }
}
+ public virtual Vector3 center
+ {
+ get
+ {
+ return GetComponentInChildren<Renderer>().bounds.center;
+ }
+ }
+
public virtual void Initialize( GameObject obj , string folder)
{
unitObj = obj;
@@ -123,6 +131,11 @@ public class UnitController : MonoBehaviour/*, Interactable*/ {
}
+ public virtual void OnGetShot(CollisionInfo info)
+ {
+ }
+
+
public virtual void OnGrab()
{
}
|