Răsfoiți Sursa

还在优化boss,有个蝌蚪的bug上传看一下

HY-LSZNWIN10\Administrator 6 zile în urmă
părinte
comite
a7cb804deb

+ 28 - 11
ActionTowerDefense/Assets/Resources/Prefab/Boss/WaterSprite/Boss_Braid.prefab

@@ -390,14 +390,14 @@ MonoBehaviour:
   bossPhase: 0
   statOfPhase:
   - hpRadioThreshold: 1
-    maxInterval: 3
-    minInterval: 2.6
+    maxInterval: 2.5
+    minInterval: 2.2
   - hpRadioThreshold: 0.6
-    maxInterval: 2.6
-    minInterval: 2.4
-  - hpRadioThreshold: 0.3
-    maxInterval: 2.4
+    maxInterval: 2.2
     minInterval: 2
+  - hpRadioThreshold: 0.3
+    maxInterval: 2
+    minInterval: 1.8
   idleAniNames:
   - idle
   - idle2
@@ -429,8 +429,7 @@ MonoBehaviour:
   dropSoulMax: 8
   dropSoulMin: 5
   dropSoulAngle: 60
-  attackCount: 0
-  comboInterval: 0.5
+  attackController: {fileID: 16214313399265844}
   attackConfigurations:
   - category: 0
     attacks:
@@ -439,7 +438,7 @@ MonoBehaviour:
   - category: 1
     attacks:
     - attack: 1
-      weight: 3
+      weight: 4
     - attack: 3
       weight: 0
     - attack: 5
@@ -466,6 +465,10 @@ MonoBehaviour:
       weight: 1
   curAttackType: 0
   smokeFx: {fileID: 417478504669294145, guid: db445634305994d48be096bffc1684d0, type: 3}
+  isHoldingUmbre: 1
+  attackNum: 0
+  attackCount: 0
+  comboInterval: 0.5
   bodyFlickerTime: 1
   isDisappear: 0
   polliNum: 100
@@ -474,8 +477,7 @@ MonoBehaviour:
   polliTime: 10
   angryAttackInterval: 1.5
   angryDuration: 10
-  isHoldingUmbre: 1
-  attackNum: 0
+  isTakingUmbre: 0
 --- !u!114 &16214313399265844
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -581,6 +583,7 @@ MonoBehaviour:
   lifesteal: 1
   umbrellaPrefab: {fileID: 5733499164336919437, guid: 203a26064d258d74683c81fbfee9f135, type: 3}
   umbrellaInstance: {fileID: 0}
+  blackUmbrella: {fileID: 0}
   umbrellaOrigPos: {fileID: 16214313865630205}
   umbrellaBackPos: {fileID: 16214313865630205}
   shootEndTime: 1.433
@@ -1840,6 +1843,7 @@ GameObject:
   m_Component:
   - component: {fileID: 3983394102083973817}
   - component: {fileID: 566765055176838525}
+  - component: {fileID: 9061816907716761474}
   m_Layer: 16
   m_Name: Pollishot
   m_TagString: Untagged
@@ -1879,3 +1883,16 @@ MonoBehaviour:
   num: 0
   pos: {fileID: 0}
   pollis: []
+--- !u!135 &9061816907716761474
+SphereCollider:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2439495398494907273}
+  m_Material: {fileID: 0}
+  m_IsTrigger: 1
+  m_Enabled: 1
+  serializedVersion: 2
+  m_Radius: 0.5
+  m_Center: {x: 0, y: 0, z: 0}

+ 1 - 0
ActionTowerDefense/Assets/Resources/Prefab/Boss/WaterSprite/Boss_Umbrella.prefab

@@ -10242,6 +10242,7 @@ MonoBehaviour:
   backTime: 1.5
   disappearTime: 0.2
   effect: {fileID: 7473170563405908938, guid: 8d195dec6a5551844ba6e4a0a4af3b59, type: 3}
+  initialTransparency: 0.2
   leftX: -9
   rightX: 9
   leftBoundary: 60

+ 86 - 36
ActionTowerDefense/Assets/Resources/Prefab/Boss/WaterSprite/Effc_umbralla_alarm.prefab

@@ -167,7 +167,7 @@ Transform:
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 1.8906, y: -0.001, z: 0}
   m_LocalScale: {x: 1.9331386, y: 2.6762064, z: 1}
-  m_ConstrainProportionsScale: 0
+  m_ConstrainProportionsScale: 1
   m_Children:
   - {fileID: 2741126262971895706}
   m_Father: {fileID: 7473170563405908937}
@@ -215,7 +215,7 @@ SpriteRenderer:
   m_SortingLayer: 4
   m_SortingOrder: 1
   m_Sprite: {fileID: 21300000, guid: b7dafa7e5223da44d98bba0cc7ca80f7, type: 3}
-  m_Color: {r: 1, g: 0, b: 0.21247053, a: 0.62352943}
+  m_Color: {r: 1, g: 0, b: 0.21247053, a: 0.68235296}
   m_FlipX: 0
   m_FlipY: 0
   m_DrawMode: 0
@@ -285,53 +285,103 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 9a4a2dbc1e482cd4b9f1532e1fddcb30, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  canStop: 0
-  stopTime: 1.5
+  isBulletMove: 1
   owner: {fileID: 0}
-  attackInfo:
-    attackValue: 0
-    damage: 0
-    attackDir: {x: 0, y: 0, z: 0}
-    attackEffect: 
-    floatState:
-      time: 0
-      upTime: {x: 0, y: 0}
-      backSpeed: {x: 0, y: 0}
-      rotateSpeed: {x: 0, y: 0}
-      height: {x: 0, y: 0}
-    blowUp:
-      dir: {x: 0, y: 0, z: 0}
-      force: 0
-      time: 0
-    shotDown:
-      dir: {x: 0, y: 0, z: 0}
-      force: 0
-      time: 0
-    weak:
-      time: 0
-    armor:
-      rate: 0
-    vulnerable:
-      rate: 0
-      time: 0
-    changeDamage:
-      rate: 0
-    sustainedInjury:
+  attackMethod:
+    attackName: 
+    attackType: 0
+    attackInfo:
+      attackValue: 0
       damage: 0
+      attackDir: {x: 0, y: 0, z: 0}
+      criticalChance: 0
+      criticalStrikeEffect: 0
+      lifesteal: 0
+      attackOnEffect: {fileID: 0}
+      attackOnEffectPos: {fileID: 0}
+      hitEffect: {fileID: 0}
+      attackEffect: 
+      attackMethod_Type: 0
+      floatState:
+        time: 0
+        upTime: {x: 0, y: 0}
+        backSpeed: {x: 0, y: 0}
+        rotateSpeed: {x: 0, y: 0}
+        height: {x: 0, y: 0}
+        ControlOrder: 0
+      blowUp:
+        directionType: 0
+        dir: {x: 0, y: 0, z: 0}
+        dirRandom: {x: 0, y: 0, z: 0}
+        force: 0
+        time: 0
+        haveLandingDamage: 0
+        landingDamageRate: 0
+        jumpNum: 0
+        ControlOrder: 0
+      shotDown:
+        directionType: 0
+        dir: {x: 0, y: 0, z: 0}
+        dirRandom: {x: 0, y: 0, z: 0}
+        force: 0
+        time: 0
+        haveLandingDamage: 0
+        landingDamageRate: 0
+        minLandingDamage: 0
+        ControlOrder: 0
+      weak:
+        time: 0
+        ControlOrder: 0
+      armorPiercing:
+        rate: 0
+      vulnerable:
+        rate: 0
+        time: 0
+      stackingWounds:
+        damage: 0
+        time: 0
+      changeDamage:
+        rate: 0
+      sustainedInjury:
+        damage: 0
+    attackTrigger: {fileID: 0}
+    needToChange: 0
+    attackDistance: 0
+    maxAttackDis: 0
+    minAttackDis: 0
+    searchMode: 0
+    canHitFly: 0
+    bulletPrefab: {fileID: 0}
+    shootPos: []
+    maxUpAngle: 0
+    maxDownAngle: 0
+    shootTrack: 0
+    shootAlwaysTrack: 0
+    skill: {fileID: 0}
+    additionalEffects: 0
   rb: {fileID: 0}
   trigedObjs: []
   bulletType: 0
+  stopTime: 1.5
+  backDuration: 0
+  stopDuration: 0
+  BoomerangWeaponController: {fileID: 0}
   isGetTarget: 0
   speed: 20
   maxFlyTime: 2
   flyTime: 0
-  isTrack: 0
-  canAlwaysTrack: 0
   trackTarget: {fileID: 0}
+  effect: {fileID: 0}
+  disappearEffect: {fileID: 0}
   canTransmit: 0
   haveTransmit: 0
   transmitTime: 0
-  portalsController: {fileID: 0}
+  canStop: 0
+  isTrack: 0
+  canAlwaysTrack: 0
+  isCreatedByDemonicSummon: 0
+  canPassGround: 0
+  originalScale: {x: 0, y: 0, z: 0}
 --- !u!54 &8541051486027365006
 Rigidbody:
   m_ObjectHideFlags: 0

+ 4 - 2
ActionTowerDefense/Assets/Resources/Prefab/Enemy/Enemy_Polliwog.prefab

@@ -75,6 +75,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 1d04dd6e35d71724689001e450625c39, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  character: {fileID: 0}
   curSpecialStates: -1
   attackMethod:
     attackName: 
@@ -1060,7 +1061,7 @@ MonoBehaviour:
   targetCharacter: {fileID: 0}
   attackTarget: {fileID: 0}
   state: 0
-  totalHp: 60
+  totalHp: 120
   hp: 0
   regenerationTime: 0
   canFly: 1
@@ -1167,6 +1168,7 @@ MonoBehaviour:
   updateInterval: 1
   isInGroup: 1
   attackTrigger: {fileID: 3696373114645964265}
+  isReturn: 0
   decelerationDistanceThreshold: 10
 --- !u!114 &4087616115681235363
 MonoBehaviour:
@@ -1365,7 +1367,7 @@ Rigidbody:
   m_UseGravity: 0
   m_IsKinematic: 1
   m_Interpolate: 0
-  m_Constraints: 116
+  m_Constraints: 52
   m_CollisionDetection: 0
 --- !u!1 &8707527156012311288
 GameObject:

Fișier diff suprimat deoarece este prea mare
+ 254 - 453
ActionTowerDefense/Assets/Resources/Spine/Boss_braid/Boss_braid_SkeletonData_Controller.controller


+ 216 - 2
ActionTowerDefense/Assets/Scenes/Game.unity

@@ -38,7 +38,7 @@ RenderSettings:
   m_ReflectionIntensity: 1
   m_CustomReflection: {fileID: 0}
   m_Sun: {fileID: 0}
-  m_IndirectSpecularColor: {r: 0.08884769, g: 0.23271483, b: 0.22609791, a: 1}
+  m_IndirectSpecularColor: {r: 0.088847615, g: 0.23271477, b: 0.22609779, a: 1}
   m_UseRadianceAmbientProbe: 0
 --- !u!157 &3
 LightmapSettings:
@@ -11637,6 +11637,103 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+--- !u!1 &744688363
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 744688367}
+  - component: {fileID: 744688366}
+  - component: {fileID: 744688365}
+  - component: {fileID: 744688364}
+  m_Layer: 3
+  m_Name: Cube (1)
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!65 &744688364
+BoxCollider:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 744688363}
+  m_Material: {fileID: 13400000, guid: ae11ca82bc783194e8fdded3f8828a76, type: 2}
+  m_IsTrigger: 0
+  m_Enabled: 1
+  serializedVersion: 2
+  m_Size: {x: 1, y: 1, z: 1}
+  m_Center: {x: 0, y: 0, z: 0}
+--- !u!23 &744688365
+MeshRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 744688363}
+  m_Enabled: 1
+  m_CastShadows: 1
+  m_ReceiveShadows: 1
+  m_DynamicOccludee: 1
+  m_StaticShadowCaster: 0
+  m_MotionVectors: 1
+  m_LightProbeUsage: 1
+  m_ReflectionProbeUsage: 1
+  m_RayTracingMode: 2
+  m_RayTraceProcedural: 0
+  m_RenderingLayerMask: 1
+  m_RendererPriority: 0
+  m_Materials:
+  - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
+  m_StaticBatchInfo:
+    firstSubMesh: 0
+    subMeshCount: 0
+  m_StaticBatchRoot: {fileID: 0}
+  m_ProbeAnchor: {fileID: 0}
+  m_LightProbeVolumeOverride: {fileID: 0}
+  m_ScaleInLightmap: 1
+  m_ReceiveGI: 1
+  m_PreserveUVs: 0
+  m_IgnoreNormalsForChartDetection: 0
+  m_ImportantGI: 0
+  m_StitchLightmapSeams: 1
+  m_SelectedEditorRenderState: 3
+  m_MinimumChartSize: 4
+  m_AutoUVMaxDistance: 0.5
+  m_AutoUVMaxAngle: 89
+  m_LightmapParameters: {fileID: 0}
+  m_SortingLayerID: 0
+  m_SortingLayer: 0
+  m_SortingOrder: 0
+  m_AdditionalVertexStreams: {fileID: 0}
+--- !u!33 &744688366
+MeshFilter:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 744688363}
+  m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
+--- !u!4 &744688367
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 744688363}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 140, y: -4.4693346, z: -0.17521667}
+  m_LocalScale: {x: 30.75, y: 30.75, z: 30.75}
+  m_ConstrainProportionsScale: 1
+  m_Children: []
+  m_Father: {fileID: 0}
+  m_RootOrder: 19
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &790432810
 GameObject:
   m_ObjectHideFlags: 0
@@ -16834,6 +16931,103 @@ RectTransform:
   m_CorrespondingSourceObject: {fileID: 1876076526888370792, guid: 1b321de3f3e560540bee6f895c405812, type: 3}
   m_PrefabInstance: {fileID: 1015519865}
   m_PrefabAsset: {fileID: 0}
+--- !u!1 &1060160316
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1060160320}
+  - component: {fileID: 1060160319}
+  - component: {fileID: 1060160318}
+  - component: {fileID: 1060160317}
+  m_Layer: 3
+  m_Name: Cube
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!65 &1060160317
+BoxCollider:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1060160316}
+  m_Material: {fileID: 13400000, guid: ae11ca82bc783194e8fdded3f8828a76, type: 2}
+  m_IsTrigger: 0
+  m_Enabled: 1
+  serializedVersion: 2
+  m_Size: {x: 1, y: 1, z: 1}
+  m_Center: {x: 0, y: 0, z: 0}
+--- !u!23 &1060160318
+MeshRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1060160316}
+  m_Enabled: 1
+  m_CastShadows: 1
+  m_ReceiveShadows: 1
+  m_DynamicOccludee: 1
+  m_StaticShadowCaster: 0
+  m_MotionVectors: 1
+  m_LightProbeUsage: 1
+  m_ReflectionProbeUsage: 1
+  m_RayTracingMode: 2
+  m_RayTraceProcedural: 0
+  m_RenderingLayerMask: 1
+  m_RendererPriority: 0
+  m_Materials:
+  - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
+  m_StaticBatchInfo:
+    firstSubMesh: 0
+    subMeshCount: 0
+  m_StaticBatchRoot: {fileID: 0}
+  m_ProbeAnchor: {fileID: 0}
+  m_LightProbeVolumeOverride: {fileID: 0}
+  m_ScaleInLightmap: 1
+  m_ReceiveGI: 1
+  m_PreserveUVs: 0
+  m_IgnoreNormalsForChartDetection: 0
+  m_ImportantGI: 0
+  m_StitchLightmapSeams: 1
+  m_SelectedEditorRenderState: 3
+  m_MinimumChartSize: 4
+  m_AutoUVMaxDistance: 0.5
+  m_AutoUVMaxAngle: 89
+  m_LightmapParameters: {fileID: 0}
+  m_SortingLayerID: 0
+  m_SortingLayer: 0
+  m_SortingOrder: 0
+  m_AdditionalVertexStreams: {fileID: 0}
+--- !u!33 &1060160319
+MeshFilter:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1060160316}
+  m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
+--- !u!4 &1060160320
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1060160316}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 40, y: -4.4693346, z: -0.17521667}
+  m_LocalScale: {x: 30.75, y: 30.75, z: 30.75}
+  m_ConstrainProportionsScale: 1
+  m_Children: []
+  m_Father: {fileID: 0}
+  m_RootOrder: 18
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!4 &1079295322 stripped
 Transform:
   m_CorrespondingSourceObject: {fileID: 8077449060965017007, guid: 8f38420ea6472ad41b71c9ea20aa1683, type: 3}
@@ -24916,7 +25110,7 @@ PrefabInstance:
       objectReference: {fileID: 741372831}
     - target: {fileID: 1880576200062196041, guid: bd8119632a1311b44ab791a903582d59, type: 3}
       propertyPath: curLevelID
-      value: 1
+      value: 4
       objectReference: {fileID: 0}
     - target: {fileID: 1880576200062196041, guid: bd8119632a1311b44ab791a903582d59, type: 3}
       propertyPath: levels.Array.data[1]
@@ -26030,6 +26224,18 @@ PrefabInstance:
       propertyPath: reflectPresets.Array.data[1].effects.Array.data[1].frame
       value: 2
       objectReference: {fileID: 0}
+    - target: {fileID: 5446471053527330204, guid: e5c00bfb08ae78849af0c262fa477a7a, type: 3}
+      propertyPath: leftBoundary
+      value: 60
+      objectReference: {fileID: 0}
+    - target: {fileID: 5446471053527330204, guid: e5c00bfb08ae78849af0c262fa477a7a, type: 3}
+      propertyPath: isUseBoundary
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: 5446471053527330204, guid: e5c00bfb08ae78849af0c262fa477a7a, type: 3}
+      propertyPath: rightBoundary
+      value: 120
+      objectReference: {fileID: 0}
     - target: {fileID: 5446471053527330205, guid: e5c00bfb08ae78849af0c262fa477a7a, type: 3}
       propertyPath: m_Name
       value: View
@@ -26078,6 +26284,10 @@ PrefabInstance:
       propertyPath: m_LocalEulerAnglesHint.z
       value: 0
       objectReference: {fileID: 0}
+    - target: {fileID: 5446471054063718609, guid: e5c00bfb08ae78849af0c262fa477a7a, type: 3}
+      propertyPath: m_LocalPosition.x
+      value: 117.6
+      objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_SourcePrefab: {fileID: 100100000, guid: e5c00bfb08ae78849af0c262fa477a7a, type: 3}
 --- !u!1001 &6486017610891705019
@@ -26199,6 +26409,10 @@ PrefabInstance:
       propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
       value: 
       objectReference: {fileID: 1714821085}
+    - target: {fileID: 8794518808883019058, guid: 8f38420ea6472ad41b71c9ea20aa1683, type: 3}
+      propertyPath: m_IsActive
+      value: 0
+      objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_SourcePrefab: {fileID: 100100000, guid: 8f38420ea6472ad41b71c9ea20aa1683, type: 3}
 --- !u!114 &6486017610891705020 stripped

+ 72 - 16
ActionTowerDefense/Assets/Scripts/Boss/WaterGhost/BlackUmbrella.cs

@@ -58,6 +58,8 @@ public class BlackUmbrella : MonoBehaviour
     [LabelText("黑伞位置提示特效")]
     public GameObject effect;
     private GameObject effectIns;
+    private SpriteRenderer effectInsSr;
+    public float initialTransparency = 0.5f;
     //提示X坐标
     public float leftX, rightX;
 
@@ -120,6 +122,7 @@ public class BlackUmbrella : MonoBehaviour
                     aimPos.x += farFromPlayerDis * fx;
                     attackDis = Mathf.Abs(aimPos.x - transform.position.x);
                 }
+                Debug.Log("冲刺"); 
                 if (aimPos.x > rightBoundary)
                 {
                     aimPos.x = rightBoundary;
@@ -183,22 +186,22 @@ public class BlackUmbrella : MonoBehaviour
                 }
                 break;
             case UmbrellaState.back:
-                float t2 = Mathf.Clamp01(umbrePastTime / backTime);
-                float smoothT2 = Mathf.SmoothStep(0, 1, t2);
-                transform.position = Vector3.Lerp(aimPos, umbrellaBackPos.position, smoothT2);
-                if (umbrePastTime >= backTime)
-                {
-                    umbrePastTime = 0;
-                    hasBackAni = false;
-                    ws.isHoldingUmbre = true;
-                    ChangeUmbrellaState(UmbrellaState.disappear);
-                }
-                else if (!hasBackAni && umbrePastTime >= backTime - 0.6f)
-                {
-                    hasBackAni = true;
-                    attackCon.isUmbrellaBack = true;
-                    ws.isHoldingUmbre = true;
-                }
+                //float t2 = Mathf.Clamp01(umbrePastTime / backTime);
+                //float smoothT2 = Mathf.SmoothStep(0, 1, t2);
+                //transform.position = Vector3.Lerp(aimPos, umbrellaBackPos.position, smoothT2);
+                //if (umbrePastTime >= backTime)
+                //{
+                //    umbrePastTime = 0;
+                //    hasBackAni = false;
+                //    ws.isHoldingUmbre = true;
+                //    ChangeUmbrellaState(UmbrellaState.disappear);
+                //}
+                //else if (!hasBackAni && umbrePastTime >= backTime - 0.6f)
+                //{
+                //    hasBackAni = true;
+                //    attackCon.isUmbrellaBack = true;
+                //    ws.isHoldingUmbre = true;
+                //}
                 break;
             case UmbrellaState.disappear:
                 if (umbrePastTime >= disappearTime)
@@ -211,6 +214,19 @@ public class BlackUmbrella : MonoBehaviour
         }
     }
 
+    public void BeTaken()
+    {
+        StartCoroutine(Disappear());
+    }
+
+    IEnumerator Disappear()
+    {
+        yield return new WaitForSeconds(0.6f);
+        umbrePastTime = 0;
+        attackCon.isUmbrellaBack = true;
+        ws.isHoldingUmbre = true;
+        ChangeUmbrellaState(UmbrellaState.disappear);
+    }
     private bool IsTargetVisible(GameObject target)
     {
         Camera camera = Camera.main;
@@ -231,9 +247,40 @@ public class BlackUmbrella : MonoBehaviour
         {
             effectIns = PoolManager.Instantiate(effect, Camera.main.transform);
             effectIns.GetComponent<Bullet>().owner = ws;
+            effectInsSr = effectIns.GetComponentInChildren<SpriteRenderer>();
+
+            // 初始化透明度为半透明(假设原本是0.5)
+            var color = effectInsSr.color;
+            color.a = initialTransparency;
+            effectInsSr.color = color;
         }
+
+        bool isAboutToAttack = umbrellaState == UmbrellaState.stay
+                       && allTime > 0
+                       && (stayTime - umbrePastTime) <= 1f;
+
         if (!IsTargetVisible(gameObject))
         {
+            if (isAboutToAttack)
+            {
+                // 剩余时间在0-1秒之间,计算透明度(0.5 -> 1.0)
+                float remainingTime = stayTime - umbrePastTime;
+                float alpha = Mathf.Lerp(1.0f, initialTransparency, remainingTime); // 时间越少透明度越高
+                var color = effectInsSr.color;
+                color.a = alpha;
+                effectInsSr.color = color;
+            }
+            else
+            {
+                // 非攻击状态保持半透明
+                var color = effectInsSr.color;
+                if (color.a != initialTransparency)
+                {
+                    color.a = initialTransparency;
+                    effectInsSr.color = color;
+                }
+            }
+
             if (gameObject.transform.position.x > pc.transform.position.x)
             {
                 effectIns.transform.localPosition = new Vector3(rightX, 0, 16);
@@ -255,6 +302,15 @@ public class BlackUmbrella : MonoBehaviour
         else
         {
             effectIns.SetActive(false);
+            // 重置透明度为半透明,避免下次显示时状态错误
+            var color = effectInsSr.color;
+            if (color.a != initialTransparency)
+            {
+                color.a = initialTransparency;
+                effectInsSr.color = color;
+            }
+
+            effectIns.SetActive(false);
         }
     }
 

+ 120 - 22
ActionTowerDefense/Assets/Scripts/Boss/WaterGhost/WaterSprite.cs

@@ -34,7 +34,7 @@ public class WaterSprite : Boss
         public AttackCategories category;
         public AttackAssignment[] attacks;
     }
-
+    [FoldoutGroup("组件")] public WaterSpriteAttackController attackController;
     [Space(30)]
     [Header("水诡白家娘娘")]
     [Header("攻击配置")]
@@ -75,6 +75,7 @@ public class WaterSprite : Boss
     [LabelText("愤怒状态持续时间")] public float angryDuration;
     private float angryTimer;
     private bool isAngry = false;
+    public bool isTakingUmbre = false;
 
     public override void Init()
     {
@@ -113,11 +114,15 @@ public class WaterSprite : Boss
                 bodyTrans.gameObject.SetActive(false);
                 //在原地召唤一堆蝌蚪
                 pws.Shoot(polliNum, bodyTrans.position);
+
+                ChangeState(CharacterState.Idle);
                 break;
             default:
                 break;
         }
         ClearAllSkills();
+        isTakingUmbre = false;
+        attackCount = 0;
     }
 
     private void OnStage()
@@ -180,7 +185,7 @@ public class WaterSprite : Boss
         int[] powers = new int[attacks.Length];
         for (int i = 0; i < attacks.Length; i++)
         {
-            if (curAttackType == AttackMethods.Umbrella && !isHoldingUmbre && attacks[i].attack == AttackMethods.Umbrella)
+            if (!isHoldingUmbre && attacks[i].attack == AttackMethods.Umbrella)
             {
                 continue;
             }
@@ -211,7 +216,6 @@ public class WaterSprite : Boss
                 ChangeState(CharacterState.Run);
                 break;
             case AttackMethods.Umbrella:
-                Debug.Log("伞攻击");
                 isHoldingUmbre = false;
                 ani.Play("shoot");
                 attack.SkillBlackUmbrella();
@@ -236,9 +240,9 @@ public class WaterSprite : Boss
                 ChangeBossState(BossState.invincible);
                 break;
             case AttackMethods.Shoot:
-                //ani.Play("roar");
-                BodyFlickerDisappear();
-                
+                if (isHoldingUmbre) ani.Play("smoke", 0, 0);
+                else ani.Play("smoke_no3", 0, 0);
+                bodyFlickerTimer = Time.time + 10;
                 break;
             default:
                 break;
@@ -273,12 +277,33 @@ public class WaterSprite : Boss
             isHoldingUmbre = true;
         }
     }
+
     public override void OnState()
     {
         if (curBossStage == BossStage.polliwog) return;
         switch (state)
         {
             case CharacterState.Idle:
+                if (isTakingUmbre)
+                {
+                    if (Time.time - bodyFlickerTimer > bodyFlickerTime && isDisappear)
+                    {
+                        curInterval = 1;
+                        transform.position = attackController.blackUmbrella.transform.position - attackController.umbrellaBackPos.position + transform.position;
+                        EndCurAttackState(true);
+                        BodyFlickerAppear();
+                        ani.Play("shoot_end");
+                        isTakingUmbre = false;
+                        attackController.blackUmbrella.BeTaken();
+                    }
+                    else if (spineEvent.isAttackOn)
+                    {
+                        spineEvent.isAttackOn = false;
+                        BodyFlickerDisappear();
+                    }
+                    return;
+                }
+
                 if (isToBossRoom)
                 {
                     OnChangeBG();
@@ -363,24 +388,97 @@ public class WaterSprite : Boss
             case AttackMethods.Shoot:
                 if (Time.time - bodyFlickerTimer > bodyFlickerTime)
                 {
-                    int faceDir = pc.bodyTrans.transform.localScale.x > 0 ? 1 : -1;
-                    transform.position = pc.transform.position + Vector3.right * faceDir * 5;
-                    int num = 0;
-                    switch (bossPhase)
+                    if (isDisappear)
+                    {
+                        int faceDir = pc.bodyTrans.transform.localScale.x > 0 ? 1 : -1;
+                        transform.position = pc.transform.position + Vector3.right * faceDir * 5;
+                        BodyFlickerAppear();
+                        if (isHoldingUmbre) ani.Play("attack", 0, 0);
+                        else ani.Play("attack_no3", 0, 0);
+                    }
+                    if (spineEvent.isAttackOn)
+                    {
+                        spineEvent.isAttackOn = false;
+                        int num = 0;
+                        switch (bossPhase)
+                        {
+                            case 0:
+                                num = 7;
+                                break;
+                            case 1:
+                                num = 11;
+                                break;
+                            case 2:
+                                num = 15;
+                                break;
+                        }
+                        attack.KunaiAttack((pc.transform.position - pws.transform.position).normalized, num);
+                        EndCurAttackState(true);
+                        ChangeState(CharacterState.Run);
+                    }
+                }
+                else
+                {
+                    if (spineEvent.isAttackOn)
+                    {
+                        spineEvent.isAttackOn = false;
+                        BodyFlickerDisappear();
+                    }
+                }
+                break;
+            default:
+                break;
+        }
+    }
+
+    public override void ChangeState(CharacterState newState)
+    {
+        if (state == newState || newState == CharacterState.FramePause)
+        {
+            return;
+        }
+        Debug.Log("从" + state + "切换到" + newState);
+        switch (state)
+        {
+            case CharacterState.Run:
+                rb.velocity = Vector3.zero;
+                break;
+            case CharacterState.Attack:
+                spineEvent.isAttackOn = false;
+                break;
+            default:
+                break;
+        }
+        state = newState;
+        switch (newState)
+        {
+            case CharacterState.Idle:
+                if (bossState != BossState.weak)
+                {
+                    if (isHoldingUmbre)
                     {
-                        case 0:
-                            num = 7;
-                            break;
-                        case 1:
-                            num = 11;
-                            break;
-                        case 2:
-                            num = 15;
-                            break;
+                        int randomAni = RandomWithWeight(weight);
+                        ani.Play(idleAniNames[randomAni], 0, 0);
                     }
-                    attack.KunaiAttack((pc.transform.position - pws.transform.position).normalized, num);
-                    BodyFlickerAppear();
-                    EndCurAttackState(true);
+                    else
+                    {
+                        ani.Play("idle_no3", 0, 0);
+                    }
+                }
+                break;
+            case CharacterState.Run:
+                ToMove();
+                break;
+            case CharacterState.Die:
+                ani.Play("die", 0, 0);
+                gameObject.SetActive(false);
+                ClearAllSkills();
+                break;
+            case CharacterState.Attack:
+                if (!isToBossRoom)
+                {
+                    //hitResistance = 300;
+                    Attack();
                 }
                 break;
             default:

+ 7 - 14
ActionTowerDefense/Assets/Scripts/Boss/WaterGhost/WaterSpriteAttackController.cs

@@ -12,7 +12,7 @@ public class WaterSpriteAttackController : AttackController
     public GameObject umbrellaPrefab;       //预制体
     [HideInInspector]
     public GameObject umbrellaInstance;    //实例化
-    private BlackUmbrella blackUmbrella;
+    public BlackUmbrella blackUmbrella;
     [LabelText("黑伞攻击初始位置")]
     public Transform umbrellaOrigPos;
     [LabelText("黑伞收回结束位置")]
@@ -77,29 +77,22 @@ public class WaterSpriteAttackController : AttackController
         ws.ChangeState(CharacterState.Idle);
         if (ws.isDisappear)
         {
-            ws.BodyFlickerAppear();
+            ws.curInterval = 1;
             transform.position = blackUmbrella.transform.position - umbrellaBackPos.position + transform.position;
             ws.EndCurAttackState(true);
+            ws.BodyFlickerAppear();
             ws.ani.Play("shoot_end");
+            ws.isTakingUmbre = false;
+            ws.attackController.blackUmbrella.BeTaken();
         }
         else
         {
+            ws.isTakingUmbre = true;
             ws.curInterval = 3f;
-            ws.BodyFlickerDisappear();
-            StartCoroutine(GetUmbre());
+            ws.ani.Play("smoke_no3", 0, 0);
         }
     }
 
-    IEnumerator GetUmbre()
-    {
-        ws.curInterval = 3f;
-        yield return new WaitForSeconds(ws.bodyFlickerTime);
-        ws.BodyFlickerAppear();
-        transform.position = blackUmbrella.transform.position - umbrellaBackPos.position + transform.position;
-        ws.EndCurAttackState(true);
-        ws.ani.Play("shoot_end");
-    }
-
     //辫子狠狠戳
     public void SkillHairSprint(int attackTime)
     {

+ 1 - 1
ActionTowerDefense/Assets/Scripts/Characters/AttributeStatus.cs

@@ -18,7 +18,7 @@ public enum SpecialState
 public class AttributeStatus : MonoBehaviour
 {
     //×é¼þ
-    private MoveCharacter character;
+    public MoveCharacter character;
     private Rigidbody rb;
     private Foot foot;
     private HitFeedbackSystem hitFeedbackSystem;

+ 16 - 1
ActionTowerDefense/Assets/Scripts/Characters/Polliwog.cs

@@ -33,6 +33,7 @@ public class Polliwog : Enemy
     public bool isInGroup = true;
 
     public BoxCollider attackTrigger;
+    public bool isReturn = false;
     [LabelText("¼õËÙ¾àÀëãÐÖµ")] public float decelerationDistanceThreshold;
     public override void Awake()
     {
@@ -47,6 +48,7 @@ public class Polliwog : Enemy
             return;
         }
         base.OnEnable();
+        isReturn = false;
         rb.isKinematic = true;
         PolliwogManager.GetInstance().AddPolliwog(this);
         isDie = false;
@@ -64,11 +66,13 @@ public class Polliwog : Enemy
 
     public override void BeHit(int damage)
     {
+        //if (isReturn) return;   
         base.BeHit(damage);
     }
 
     public override void BeHit(AttackController.AttackMethod attackMethod, Character attackFrom, int damage = -1)
     {
+        //if (isReturn) return;
         base.BeHit(attackMethod, attackFrom, damage);
     }
 
@@ -91,6 +95,9 @@ public class Polliwog : Enemy
                 rb.velocity = Vector3.zero;
                 rb.isKinematic = true;
                 attackTrigger.enabled = true;
+                attributeStatus.character.mecanim.transform.localPosition = Vector3.zero;
+                attributeStatus.character.mecanim.transform.localRotation = Quaternion.Euler(0, 0, 0);
+                attributeStatus.character.transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, attributeStatus.character.platformRotZ);
                 break;
         }
         state = newState;
@@ -140,11 +147,12 @@ public class Polliwog : Enemy
     {
         base.Init();
         ChangeState(CharacterState.Run);
+        if (PlayersInput.instance.Length > 0) playerTarget = PlayersInput.instance[0].transform;
     }
 
     public override void OnState()
     {
-        if (PlayersInput.instance.Length > 0) playerTarget = PlayersInput.instance[0].transform;
+        //if (PlayersInput.instance.Length > 0) playerTarget = PlayersInput.instance[0].transform;
         if (state == CharacterState.None || playerTarget == null)
         {
             return;
@@ -293,4 +301,11 @@ public class Polliwog : Enemy
         lastUpdateNearbyFishTime = Time.time;
         nearbyFish = PolliwogManager.GetInstance().GetNearbyFish(transform.position, 6);
     }
+
+    public void StartReturn(Transform target)
+    {
+        playerTarget = target;
+        isReturn = true;
+        ChangeState(CharacterState.Run);
+    }
 }

+ 13 - 3
ActionTowerDefense/Assets/Scripts/PolliwogShot.cs

@@ -51,11 +51,16 @@ public class PolliwogShot : SpecialSkills
 
     public void AllPoliDie()
     {
-        foreach(Polliwog pol in pollis)
+        for (int i = pollis.Count - 1; i >= 0; i--)
         {
-            if (!pol.isDie)
+            Polliwog pol = pollis[i];
+            if (pol.isDie)
             {
-                pol.ChangeState(CharacterState.Die);
+                pollis.RemoveAt(i);
+            }
+            else
+            {
+                pol.StartReturn(owner.transform);
             }
         }
     }
@@ -72,4 +77,9 @@ public class PolliwogShot : SpecialSkills
             }
         }
     }
+
+    private void OnTriggerEnter(Collider other)
+    {
+        
+    }
 }

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff