Browse Source

角色子弹改成自瞄及瞄准逻辑迭代

wulifu 1 năm trước cách đây
mục cha
commit
b08da911cb

+ 7 - 6
ActionTowerDefense/Assets/Resources/Prefab/Demonic_Arrow.prefab

@@ -614,7 +614,7 @@ Transform:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 5388987656270167698}
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalPosition: {x: 0, y: 0.792, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children: []
@@ -633,7 +633,7 @@ BoxCollider:
   m_Enabled: 1
   serializedVersion: 2
   m_Size: {x: 0.72, y: 1.584, z: 1}
-  m_Center: {x: 0, y: 0.792, z: 0}
+  m_Center: {x: 0, y: 0, z: 0}
 --- !u!114 &316813748882225178
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -965,6 +965,7 @@ MonoBehaviour:
   aniCollider: {fileID: 6864986857343475389}
   rb: {fileID: 8639832132491289349}
   bodyTrans: {fileID: 5769591908339262981}
+  beSearchTrigger: {fileID: 316813748882225178}
   uiHp: {fileID: 3586716274361854270}
   state: 0
   attackTime: 0
@@ -1000,6 +1001,10 @@ MonoBehaviour:
   shootTrack: 1
   invincibleTime: 0
   totalInvincibleTime: 2
+  targetCharacter: {fileID: 0}
+  searchTrigger: {fileID: 3566347593191160092}
+  targetTypes: 0400000005000000
+  canHitFly: 1
   foot: {fileID: 8639832132450015562}
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
@@ -1008,13 +1013,9 @@ MonoBehaviour:
   totalHurtKeepTime: 0.5
   id: 0
   costMp: 60
-  searchTrigger: {fileID: 3566347593191160092}
   searchState: 0
-  targetTypes: 0400000005000000
   attackDistance: 10
   canFly: 1
-  canHitFly: 1
-  targetCharacter: {fileID: 0}
 --- !u!54 &8639832132491289349
 Rigidbody:
   m_ObjectHideFlags: 0

+ 9 - 8
ActionTowerDefense/Assets/Resources/Prefab/Demonic_Giant.prefab

@@ -180,7 +180,7 @@ Transform:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 4480734502875862885}
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalPosition: {x: 0, y: 2.16, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children: []
@@ -199,7 +199,7 @@ BoxCollider:
   m_Enabled: 1
   serializedVersion: 2
   m_Size: {x: 3.6, y: 4.32, z: 1}
-  m_Center: {x: 0, y: 2.16, z: 0}
+  m_Center: {x: 0, y: 0, z: 0}
 --- !u!114 &4259433079752244006
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -256,8 +256,8 @@ BoxCollider:
   m_IsTrigger: 0
   m_Enabled: 1
   serializedVersion: 2
-  m_Size: {x: 1.8, y: 2.16, z: 1}
-  m_Center: {x: 0, y: 1.08, z: 0}
+  m_Size: {x: 3.6, y: 4.32, z: 1}
+  m_Center: {x: 0, y: 2.16, z: 0}
 --- !u!1 &5041915139224979942
 GameObject:
   m_ObjectHideFlags: 0
@@ -428,6 +428,7 @@ MonoBehaviour:
   aniCollider: {fileID: 2776251058442384869}
   rb: {fileID: 5440846222648032765}
   bodyTrans: {fileID: 6459001683917408033}
+  beSearchTrigger: {fileID: 4259433079752244006}
   uiHp: {fileID: 478072938412589135}
   state: 0
   attackTime: 0
@@ -455,6 +456,10 @@ MonoBehaviour:
   shootTrack: 0
   invincibleTime: 0
   totalInvincibleTime: 2
+  targetCharacter: {fileID: 0}
+  searchTrigger: {fileID: 2932762729738363159}
+  targetTypes: 0400000005000000
+  canHitFly: 0
   foot: {fileID: 5440846222604650418}
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
@@ -463,13 +468,9 @@ MonoBehaviour:
   totalHurtKeepTime: 0.5
   id: 0
   costMp: 150
-  searchTrigger: {fileID: 2932762729738363159}
   searchState: 0
-  targetTypes: 0400000005000000
   attackDistance: 3
   canFly: 0
-  canHitFly: 0
-  targetCharacter: {fileID: 0}
 --- !u!54 &5440846222648032765
 Rigidbody:
   m_ObjectHideFlags: 0

+ 7 - 6
ActionTowerDefense/Assets/Resources/Prefab/Demonic_Sword.prefab

@@ -171,6 +171,7 @@ MonoBehaviour:
   aniCollider: {fileID: 7460010523729932468}
   rb: {fileID: 2437299196472462355}
   bodyTrans: {fileID: 2730232521377132808}
+  beSearchTrigger: {fileID: 1317309795988277421}
   uiHp: {fileID: 6433555643392153575}
   state: 0
   attackTime: 0
@@ -198,6 +199,10 @@ MonoBehaviour:
   shootTrack: 0
   invincibleTime: 0
   totalInvincibleTime: 2
+  targetCharacter: {fileID: 0}
+  searchTrigger: {fileID: 5104552355235513707}
+  targetTypes: 0400000005000000
+  canHitFly: 0
   foot: {fileID: 2437299196663985756}
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
@@ -206,13 +211,9 @@ MonoBehaviour:
   totalHurtKeepTime: 0.5
   id: 0
   costMp: 100
-  searchTrigger: {fileID: 5104552355235513707}
   searchState: 0
-  targetTypes: 0400000005000000
   attackDistance: 1.5
   canFly: 0
-  canHitFly: 0
-  targetCharacter: {fileID: 0}
 --- !u!54 &2437299196472462355
 Rigidbody:
   m_ObjectHideFlags: 0
@@ -454,7 +455,7 @@ Transform:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 6526817785665782971}
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalPosition: {x: 0, y: 0.792, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children: []
@@ -473,7 +474,7 @@ BoxCollider:
   m_Enabled: 1
   serializedVersion: 2
   m_Size: {x: 0.72, y: 1.584, z: 1}
-  m_Center: {x: 0, y: 0.792, z: 0}
+  m_Center: {x: 0, y: 0, z: 0}
 --- !u!114 &1317309795988277421
 MonoBehaviour:
   m_ObjectHideFlags: 0

+ 8 - 6
ActionTowerDefense/Assets/Resources/Prefab/EnemyTower.prefab

@@ -295,6 +295,7 @@ MonoBehaviour:
   aniCollider: {fileID: 3581793009692002704}
   rb: {fileID: 3581793008941702771}
   bodyTrans: {fileID: 3581793009506298626}
+  beSearchTrigger: {fileID: 3778640999066524515}
   uiHp: {fileID: 3581793008612699030}
   state: 0
   attackTime: 0
@@ -319,9 +320,10 @@ MonoBehaviour:
   shootTrack: 1
   invincibleTime: 0
   totalInvincibleTime: 0
+  targetCharacter: {fileID: 0}
   searchTrigger: {fileID: 3581793009074591734}
   targetTypes: 0100000003000000
-  searchTarget: {fileID: 0}
+  canHitFly: 0
 --- !u!54 &3581793008941702771
 Rigidbody:
   m_ObjectHideFlags: 0
@@ -364,7 +366,7 @@ Transform:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 3581793009074591723}
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 0, y: 1, z: 0}
+  m_LocalPosition: {x: 0, y: 2.5, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children: []
@@ -396,8 +398,8 @@ BoxCollider:
   m_IsTrigger: 1
   m_Enabled: 1
   serializedVersion: 2
-  m_Size: {x: 20, y: 3, z: 1}
-  m_Center: {x: 0, y: 1.5, z: 0}
+  m_Size: {x: 20, y: 5, z: 1}
+  m_Center: {x: 0, y: 0, z: 0}
 --- !u!1 &3581793009091440430
 GameObject:
   m_ObjectHideFlags: 0
@@ -809,7 +811,7 @@ Transform:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 7102644708960417302}
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalPosition: {x: 0, y: 2.5, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children: []
@@ -828,7 +830,7 @@ BoxCollider:
   m_Enabled: 1
   serializedVersion: 2
   m_Size: {x: 1, y: 5, z: 1}
-  m_Center: {x: 0, y: 2.5, z: 0}
+  m_Center: {x: 0, y: 0, z: 0}
 --- !u!114 &3778640999066524515
 MonoBehaviour:
   m_ObjectHideFlags: 0

+ 9 - 6
ActionTowerDefense/Assets/Resources/Prefab/Enemy_Arrow.prefab

@@ -614,7 +614,7 @@ Transform:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 5388987656270167698}
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalPosition: {x: 0, y: 0.792, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children: []
@@ -633,7 +633,7 @@ BoxCollider:
   m_Enabled: 1
   serializedVersion: 2
   m_Size: {x: 0.72, y: 1.584, z: 1}
-  m_Center: {x: 0, y: 0.792, z: 0}
+  m_Center: {x: 0, y: 0, z: 0}
 --- !u!114 &316813748882225178
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -965,6 +965,7 @@ MonoBehaviour:
   aniCollider: {fileID: 6864986857343475389}
   rb: {fileID: 8639832132491289349}
   bodyTrans: {fileID: 5769591908339262981}
+  beSearchTrigger: {fileID: 316813748882225178}
   uiHp: {fileID: 3586716274361854270}
   state: 0
   attackTime: 0
@@ -998,6 +999,12 @@ MonoBehaviour:
   totalDieKeepTime: 2
   attackTarget: {fileID: 0}
   shootTrack: 1
+  invincibleTime: 0
+  totalInvincibleTime: 2
+  targetCharacter: {fileID: 0}
+  searchTrigger: {fileID: 3566347593191160092}
+  targetTypes: 010000000300000002000000
+  canHitFly: 1
   foot: {fileID: 8639832132450015562}
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
@@ -1005,14 +1012,10 @@ MonoBehaviour:
   hurtKeepTime: 0
   totalHurtKeepTime: 0.5
   id: 0
-  searchTrigger: {fileID: 3566347593191160092}
   jumpSpeed: 10
   searchState: 0
-  targetTypes: 010000000300000002000000
   attackDistance: 10
   canFly: 1
-  canHitFly: 1
-  targetCharacter: {fileID: 0}
   attackRatio: 0
   maxMoveSpeed: 2.2
   minMoveSpeed: 1.8

+ 11 - 8
ActionTowerDefense/Assets/Resources/Prefab/Enemy_Giant.prefab

@@ -180,7 +180,7 @@ Transform:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 4480734502875862885}
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalPosition: {x: 0, y: 2.16, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children: []
@@ -199,7 +199,7 @@ BoxCollider:
   m_Enabled: 1
   serializedVersion: 2
   m_Size: {x: 3.6, y: 4.32, z: 1}
-  m_Center: {x: 0, y: 2.16, z: 0}
+  m_Center: {x: 0, y: 0, z: 0}
 --- !u!114 &4259433079752244006
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -256,8 +256,8 @@ BoxCollider:
   m_IsTrigger: 0
   m_Enabled: 1
   serializedVersion: 2
-  m_Size: {x: 1.8, y: 2.16, z: 1}
-  m_Center: {x: 0, y: 1.08, z: 0}
+  m_Size: {x: 3.6, y: 4.32, z: 1}
+  m_Center: {x: 0, y: 2.16, z: 0}
 --- !u!1 &5041915139224979942
 GameObject:
   m_ObjectHideFlags: 0
@@ -428,6 +428,7 @@ MonoBehaviour:
   aniCollider: {fileID: 2776251058442384869}
   rb: {fileID: 5440846222648032765}
   bodyTrans: {fileID: 6459001683917408033}
+  beSearchTrigger: {fileID: 4259433079752244006}
   uiHp: {fileID: 478072938412589135}
   state: 0
   attackTime: 0
@@ -453,6 +454,12 @@ MonoBehaviour:
   totalDieKeepTime: 2
   attackTarget: {fileID: 0}
   shootTrack: 0
+  invincibleTime: 0
+  totalInvincibleTime: 2
+  targetCharacter: {fileID: 0}
+  searchTrigger: {fileID: 2932762729738363159}
+  targetTypes: 010000000200000003000000
+  canHitFly: 0
   foot: {fileID: 5440846222604650418}
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
@@ -460,14 +467,10 @@ MonoBehaviour:
   hurtKeepTime: 0
   totalHurtKeepTime: 0.5
   id: 0
-  searchTrigger: {fileID: 2932762729738363159}
   jumpSpeed: 10
   searchState: 0
-  targetTypes: 010000000200000003000000
   attackDistance: 3
   canFly: 0
-  canHitFly: 0
-  targetCharacter: {fileID: 0}
   attackRatio: 0
   maxMoveSpeed: 1.2
   minMoveSpeed: 0.8

+ 9 - 6
ActionTowerDefense/Assets/Resources/Prefab/Enemy_Sword.prefab

@@ -223,6 +223,7 @@ MonoBehaviour:
   aniCollider: {fileID: 2250177594949393219}
   rb: {fileID: 2437299196472462355}
   bodyTrans: {fileID: 5075820377452290163}
+  beSearchTrigger: {fileID: 6542925321707027015}
   uiHp: {fileID: 5757877461832872043}
   state: 0
   attackTime: 0
@@ -248,6 +249,12 @@ MonoBehaviour:
   totalDieKeepTime: 2
   attackTarget: {fileID: 0}
   shootTrack: 0
+  invincibleTime: 0
+  totalInvincibleTime: 2
+  targetCharacter: {fileID: 0}
+  searchTrigger: {fileID: 428784489592146076}
+  targetTypes: 010000000300000002000000
+  canHitFly: 0
   foot: {fileID: 2437299196663985756}
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
@@ -255,14 +262,10 @@ MonoBehaviour:
   hurtKeepTime: 0
   totalHurtKeepTime: 0.5
   id: 0
-  searchTrigger: {fileID: 428784489592146076}
   jumpSpeed: 9
   searchState: 0
-  targetTypes: 010000000300000002000000
   attackDistance: 1.5
   canFly: 0
-  canHitFly: 0
-  targetCharacter: {fileID: 0}
   attackRatio: 0
   maxMoveSpeed: 2
   minMoveSpeed: 1.6
@@ -476,7 +479,7 @@ Transform:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 3917432747505904452}
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalPosition: {x: 0, y: 0.792, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children: []
@@ -495,7 +498,7 @@ BoxCollider:
   m_Enabled: 1
   serializedVersion: 2
   m_Size: {x: 0.72, y: 1.584, z: 1}
-  m_Center: {x: 0, y: 0.792, z: 0}
+  m_Center: {x: 0, y: 0, z: 0}
 --- !u!114 &6542925321707027015
 MonoBehaviour:
   m_ObjectHideFlags: 0

+ 82 - 4
ActionTowerDefense/Assets/Resources/Prefab/Player.prefab

@@ -387,7 +387,7 @@ Transform:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 1367816017394770223}
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalPosition: {x: 0, y: 0.9, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children: []
@@ -406,7 +406,7 @@ BoxCollider:
   m_Enabled: 1
   serializedVersion: 2
   m_Size: {x: 0.576, y: 1.8, z: 1}
-  m_Center: {x: 0, y: 0.9, z: 0}
+  m_Center: {x: 0, y: 0, z: 0}
 --- !u!114 &573198802
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -579,15 +579,25 @@ MonoBehaviour:
   aniCollider: {fileID: 5072770566235913242}
   rb: {fileID: 3571941038519084339}
   bodyTrans: {fileID: 2788556811231999033}
+  beSearchTrigger: {fileID: 573198802}
   uiHp: {fileID: 205997967}
   state: 1
   attackTime: 0
-  totalAttack1Time: 1
+  totalAttack1Time: 0.35
   totalAttack2Time: 0.5
   isDie: 0
   totalHp: 3000
   hp: 0
   attack1Infos:
+  - damage: 300
+    attackDir: {x: -1, y: 0, z: 0}
+    force: 1000
+  - damage: 300
+    attackDir: {x: -1, y: 0, z: 0}
+    force: 1000
+  - damage: 300
+    attackDir: {x: -1, y: 0, z: 0}
+    force: 1000
   - damage: 300
     attackDir: {x: -1, y: 0, z: 0}
     force: 1000
@@ -604,9 +614,13 @@ MonoBehaviour:
   dieKeepTime: 0
   totalDieKeepTime: 2
   attackTarget: {fileID: 0}
-  shootTrack: 0
+  shootTrack: 1
   invincibleTime: 0
   totalInvincibleTime: 2
+  targetCharacter: {fileID: 0}
+  searchTrigger: {fileID: 2246792914537570827}
+  targetTypes: 0400000005000000
+  canHitFly: 1
   foot: {fileID: 3571941039716665623}
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
@@ -647,6 +661,8 @@ MonoBehaviour:
   cacheRushTime: 0
   totalCacheRushTime: 0.1
   airJumped: 0
+  attackState: 0
+  attackMoveSpeed: 5
   isClickBtnJump: 0
   isClickBtnRush: 0
   isKeepBtnRush: 0
@@ -654,6 +670,7 @@ MonoBehaviour:
   isClickBtnEast: 0
   isClickBtnWest: 0
   isClickBtnNorth: 0
+  isKeepBtnNorth: 0
 --- !u!54 &3571941038519084339
 Rigidbody:
   m_ObjectHideFlags: 0
@@ -1040,6 +1057,7 @@ Transform:
   m_Children:
   - {fileID: 7749421205528274812}
   - {fileID: 5205406772191310031}
+  - {fileID: 4820292395093981591}
   m_Father: {fileID: 3571941038519084349}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -1181,6 +1199,66 @@ Transform:
   m_Father: {fileID: 5205406772191310031}
   m_RootOrder: 8
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &7543684069368865882
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 4820292395093981591}
+  - component: {fileID: 2246792914537570827}
+  - component: {fileID: 1773367177312460232}
+  m_Layer: 0
+  m_Name: SearchTrigger
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &4820292395093981591
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 7543684069368865882}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 2, y: 2, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 2788556811231999033}
+  m_RootOrder: 2
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &2246792914537570827
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 7543684069368865882}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 21f006d2c845e2e43bce70ea7a2d8dcc, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  owner: {fileID: 0}
+  trigObjList: []
+--- !u!65 &1773367177312460232
+BoxCollider:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 7543684069368865882}
+  m_Material: {fileID: 0}
+  m_IsTrigger: 1
+  m_Enabled: 1
+  serializedVersion: 2
+  m_Size: {x: 20, y: 3, z: 1}
+  m_Center: {x: 0, y: 1.5, z: 0}
 --- !u!1 &8722136878745494474
 GameObject:
   m_ObjectHideFlags: 0

+ 8 - 6
ActionTowerDefense/Assets/Resources/Prefab/Tower.prefab

@@ -577,7 +577,7 @@ Transform:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 6126647545521899028}
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 0, y: 1, z: 0}
+  m_LocalPosition: {x: 0, y: 2.5, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children: []
@@ -609,8 +609,8 @@ BoxCollider:
   m_IsTrigger: 1
   m_Enabled: 1
   serializedVersion: 2
-  m_Size: {x: 20, y: 3, z: 1}
-  m_Center: {x: 0, y: 1.5, z: 0}
+  m_Size: {x: 20, y: 5, z: 1}
+  m_Center: {x: 0, y: 0, z: 0}
 --- !u!1 &6126647545538756305
 GameObject:
   m_ObjectHideFlags: 0
@@ -740,6 +740,7 @@ MonoBehaviour:
   aniCollider: {fileID: 6126647544260794479}
   rb: {fileID: 6126647545658003340}
   bodyTrans: {fileID: 6126647544008014589}
+  beSearchTrigger: {fileID: 6745549281751514252}
   uiHp: {fileID: 6126647545328450153}
   state: 0
   attackTime: 0
@@ -764,9 +765,10 @@ MonoBehaviour:
   shootTrack: 1
   invincibleTime: 0
   totalInvincibleTime: 0
+  targetCharacter: {fileID: 0}
   searchTrigger: {fileID: 6126647545521899017}
   targetTypes: 04000000
-  searchTarget: {fileID: 0}
+  canHitFly: 0
 --- !u!54 &6126647545658003340
 Rigidbody:
   m_ObjectHideFlags: 0
@@ -809,7 +811,7 @@ Transform:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 6745549281751514254}
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalPosition: {x: 0, y: 2.5, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children: []
@@ -828,7 +830,7 @@ BoxCollider:
   m_Enabled: 1
   serializedVersion: 2
   m_Size: {x: 1, y: 5, z: 1}
-  m_Center: {x: 0, y: 2.5, z: 0}
+  m_Center: {x: 0, y: 0, z: 0}
 --- !u!114 &6745549281751514252
 MonoBehaviour:
   m_ObjectHideFlags: 0

+ 0 - 44
ActionTowerDefense/Assets/Scenes/SampleScene.unity

@@ -1156,50 +1156,6 @@ PrefabInstance:
   m_Modification:
     m_TransformParent: {fileID: 0}
     m_Modifications:
-    - target: {fileID: 3571941038519084336, guid: 5b538f610930dd743a096c582e2810f4, type: 3}
-      propertyPath: totalAttack1Time
-      value: 0.35
-      objectReference: {fileID: 0}
-    - target: {fileID: 3571941038519084336, guid: 5b538f610930dd743a096c582e2810f4, type: 3}
-      propertyPath: attack1Infos.Array.size
-      value: 4
-      objectReference: {fileID: 0}
-    - target: {fileID: 3571941038519084336, guid: 5b538f610930dd743a096c582e2810f4, type: 3}
-      propertyPath: attack1Infos.Array.data[1].force
-      value: 1000
-      objectReference: {fileID: 0}
-    - target: {fileID: 3571941038519084336, guid: 5b538f610930dd743a096c582e2810f4, type: 3}
-      propertyPath: attack1Infos.Array.data[2].force
-      value: 1000
-      objectReference: {fileID: 0}
-    - target: {fileID: 3571941038519084336, guid: 5b538f610930dd743a096c582e2810f4, type: 3}
-      propertyPath: attack1Infos.Array.data[3].force
-      value: 1000
-      objectReference: {fileID: 0}
-    - target: {fileID: 3571941038519084336, guid: 5b538f610930dd743a096c582e2810f4, type: 3}
-      propertyPath: attack1Infos.Array.data[1].damage
-      value: 300
-      objectReference: {fileID: 0}
-    - target: {fileID: 3571941038519084336, guid: 5b538f610930dd743a096c582e2810f4, type: 3}
-      propertyPath: attack1Infos.Array.data[2].damage
-      value: 300
-      objectReference: {fileID: 0}
-    - target: {fileID: 3571941038519084336, guid: 5b538f610930dd743a096c582e2810f4, type: 3}
-      propertyPath: attack1Infos.Array.data[3].damage
-      value: 300
-      objectReference: {fileID: 0}
-    - target: {fileID: 3571941038519084336, guid: 5b538f610930dd743a096c582e2810f4, type: 3}
-      propertyPath: attack1Infos.Array.data[1].attackDir.x
-      value: -1
-      objectReference: {fileID: 0}
-    - target: {fileID: 3571941038519084336, guid: 5b538f610930dd743a096c582e2810f4, type: 3}
-      propertyPath: attack1Infos.Array.data[2].attackDir.x
-      value: -1
-      objectReference: {fileID: 0}
-    - target: {fileID: 3571941038519084336, guid: 5b538f610930dd743a096c582e2810f4, type: 3}
-      propertyPath: attack1Infos.Array.data[3].attackDir.x
-      value: -1
-      objectReference: {fileID: 0}
     - target: {fileID: 3571941038519084344, guid: 5b538f610930dd743a096c582e2810f4, type: 3}
       propertyPath: m_Name
       value: Player

+ 5 - 0
ActionTowerDefense/Assets/Scripts/Bullet.cs

@@ -48,6 +48,11 @@ public class Bullet : MonoBehaviour
 
     public void BeShoot(Character own, Vector3 shootPos, Vector3 dir, int dmg, float fc, bool track = false, Transform target = null)
     {
+        print("BeShoot:" + track + ";" + target);
+        if (target)
+        {
+            print("target:" + target.transform.position.y);
+        }
         startPos = shootPos;
         transform.position = shootPos;
         transform.right = -dir;

+ 6 - 1
ActionTowerDefense/Assets/Scripts/Character.cs

@@ -36,6 +36,7 @@ public class Character : MonoBehaviour
     public Animator aniCollider;
     public Rigidbody rb;
     public Transform bodyTrans;
+    public BeSearchTrigger beSearchTrigger;
     public UIHP uiHp;
 
     public CharacterState state;
@@ -61,6 +62,10 @@ public class Character : MonoBehaviour
     [HideInInspector]
     public float invincibleTime;
     public float totalInvincibleTime = 2f;
+    public Character targetCharacter;
+    public SearchTrigger searchTrigger;
+    public List<TargetType> targetTypes;
+    public bool canHitFly;
 
     public virtual void Init()
     {
@@ -144,7 +149,7 @@ public class Character : MonoBehaviour
         {
             attackDir.x = -attackDir.x;
         }
-        bullet.BeShoot(this, shootPos[shootId].position, attackDir, attackInfo.damage, attackInfo.force, shootTrack, attackTarget?attackTarget.transform:null);
+        bullet.BeShoot(this, shootPos[shootId].position, attackDir, attackInfo.damage, attackInfo.force, shootTrack, attackTarget?attackTarget.beSearchTrigger.transform:null);
     }
 
     public virtual Vector3 GetMoveDir()

+ 0 - 5
ActionTowerDefense/Assets/Scripts/Demonic.cs

@@ -8,14 +8,9 @@ public class Demonic : MoveCharacter
 {
     public int id;
     public float costMp = 10;
-    public SearchTrigger searchTrigger;
     public SearchState searchState;
-    public List<TargetType> targetTypes;
     public float attackDistance;
     public bool canFly = false;
-    public bool canHitFly = false;
-
-    public Character targetCharacter;
 
     private void Awake()
     {

+ 0 - 4
ActionTowerDefense/Assets/Scripts/Enemy.cs

@@ -25,15 +25,11 @@ public enum SearchState
 public class Enemy : MoveCharacter
 {
     public int id;
-    public SearchTrigger searchTrigger;
     public float jumpSpeed = 10;
     public SearchState searchState;
-    public List<TargetType> targetTypes;
     public float attackDistance;
     public bool canFly = false;
-    public bool canHitFly = false;
 
-    public Character targetCharacter;
     public float attackRatio;
     public float maxMoveSpeed, minMoveSpeed;
 

+ 3 - 7
ActionTowerDefense/Assets/Scripts/EnemyTower.cs

@@ -4,10 +4,6 @@ using UnityEngine;
 
 public class EnemyTower : Character
 {
-    public SearchTrigger searchTrigger;
-    public List<TargetType> targetTypes;
-    public Character searchTarget;
-
     private void Awake()
     {
         Init();
@@ -15,7 +11,7 @@ public class EnemyTower : Character
 
     public bool GetAttack()
     {
-        if (searchTarget != null)
+        if (targetCharacter != null)
         {
             return true;
         }
@@ -24,7 +20,7 @@ public class EnemyTower : Character
 
     public void SearchTarget()
     {
-        searchTarget = searchTrigger.GetMinDisTarget(targetTypes, true);
+        targetCharacter = searchTrigger.GetMinDisTarget(targetTypes, true);
     }
 
     public override void OnState()
@@ -89,7 +85,7 @@ public class EnemyTower : Character
                 //animalAni.SetInteger("state", (int)PlayerState.Idle);
                 break;
             case CharacterState.Attack:
-                attackTarget = searchTarget;
+                attackTarget = targetCharacter;
                 if ((attackTarget.transform.position - transform.position).x > 0
                     && bodyTrans.localScale.x > 0)
                 {

+ 9 - 0
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -405,6 +405,7 @@ public class PlayerController : MoveCharacter
     public override void OnState()
     {
         base.OnState();
+
         cacheJumpTime -= Time.deltaTime;
         cacheAttackTime -= Time.deltaTime;
         cacheSummonTime -= Time.deltaTime;
@@ -758,6 +759,8 @@ public class PlayerController : MoveCharacter
         {
             canJumpTime = leaveGroundCanJumpTime;
         }
+        SearchTarget();
+        attackTarget = targetCharacter;
 
         if (mp < totalMp)
         {
@@ -1035,4 +1038,10 @@ public class PlayerController : MoveCharacter
         ani.SetInteger("attackState", (int)value);
         aniCollider.Play("Attack1Keep", 1, 0);
     }
+
+    public void SearchTarget()
+    {
+        targetCharacter = searchTrigger.GetMinDisTarget(targetTypes, canHitFly);
+    }
+
 }

+ 3 - 7
ActionTowerDefense/Assets/Scripts/Tower.cs

@@ -5,10 +5,6 @@ using static Spine.Unity.Examples.SpineboyFootplanter;
 
 public class Tower : Character
 {
-    public SearchTrigger searchTrigger;
-    public List<TargetType> targetTypes;
-    public Character searchTarget;
-
     private void Awake()
     {
         Init();
@@ -16,7 +12,7 @@ public class Tower : Character
 
     public bool GetAttack()
     {
-        if (searchTarget != null)
+        if (targetCharacter != null)
         {
             return true;
         }
@@ -25,7 +21,7 @@ public class Tower : Character
 
     public void SearchTarget()
     {
-        searchTarget = searchTrigger.GetMinDisTarget(targetTypes, true);
+        targetCharacter = searchTrigger.GetMinDisTarget(targetTypes, true);
     }
 
     public override void OnState()
@@ -90,7 +86,7 @@ public class Tower : Character
                 //animalAni.SetInteger("state", (int)PlayerState.Idle);
                 break;
             case CharacterState.Attack:
-                attackTarget = searchTarget;
+                attackTarget = targetCharacter;
                 if ((attackTarget.transform.position - transform.position).x > 0
                     && bodyTrans.localScale.x > 0)
                 {