Explorar el Código

修改刺客刀光偏移

LAPTOP-OM1V99U2\永远de小亡灵 hace 1 año
padre
commit
3c2e86e7cb

+ 2 - 1
ActionTowerDefense/Assets/Resources/Prefab/ESpirits_Assassin.prefab

@@ -875,6 +875,7 @@ MonoBehaviour:
   offset: 2
   rushEffect: {fileID: 7473170563405908938, guid: 8ad3c225050205945b10657aa300afd6, type: 3}
   targetY: 1
+  aim: {fileID: 6373916053725309541}
 --- !u!1 &8203964573996106666
 GameObject:
   m_ObjectHideFlags: 0
@@ -1181,7 +1182,7 @@ PrefabInstance:
       objectReference: {fileID: 0}
     - target: {fileID: 2762284929821138691, guid: b7051bb1545467c4b834bfe5db9c3029, type: 3}
       propertyPath: m_LocalPosition.y
-      value: 1.02
+      value: 1
       objectReference: {fileID: 0}
     - target: {fileID: 2762284929821138691, guid: b7051bb1545467c4b834bfe5db9c3029, type: 3}
       propertyPath: m_LocalPosition.z

+ 1 - 0
ActionTowerDefense/Assets/Resources/Prefab/Spirits_Assassin.prefab

@@ -843,6 +843,7 @@ MonoBehaviour:
   offset: 2
   rushEffect: {fileID: 7473170563405908938, guid: 8ad3c225050205945b10657aa300afd6, type: 3}
   targetY: 1
+  aim: {fileID: 8203964573996106666}
 --- !u!54 &8257178686841521685
 Rigidbody:
   m_ObjectHideFlags: 0

+ 4 - 0
ActionTowerDefense/Assets/Scripts/Spirits/DashEffect.cs

@@ -12,6 +12,7 @@ public class DashEffect : MonoBehaviour
     public float offset;
     public GameObject rushEffect;
     public float targetY;
+    public GameObject aim;
     private void Awake()
     {
         if (isEnemy)
@@ -75,5 +76,8 @@ public class DashEffect : MonoBehaviour
         GameObject effect = Instantiate(rushEffect);
         effect.transform.position = new Vector3(character.transform.position.x,
             transform.position.y + targetY, 0);
+        effect.transform.position =
+            Vector3.Lerp(character.transform.position + Vector3.up *targetY,
+            aim.transform.position, 0.5f);
     }
 }