Prechádzať zdrojové kódy

锁魂塔停在黄色边缘bug

SZAND\msx_2 1 rok pred
rodič
commit
ad3e123e72

+ 4 - 2
ActionTowerDefense/Assets/Resources/Prefab/ESpirits_Cook.prefab

@@ -50,7 +50,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!4 &8927539278125731317
 Transform:
   m_ObjectHideFlags: 0
@@ -330,7 +330,7 @@ MonoBehaviour:
   minX: 8.5
   maxX: 20
   value: 20
-  effect: {fileID: 2123904437201259524, guid: 24cf2b33715a9e04b9aabcb789c31067, type: 3}
+  effect: {fileID: 417478504669294145, guid: 07c7a53ff610e0b45898f0f09276d995, type: 3}
   activeAniTime: 1.3
   larger: 1.2
   customers: []
@@ -828,6 +828,8 @@ MonoBehaviour:
   invincibleTime: 0
   injuryNumText: {fileID: 6467251191553420251, guid: 9b37289f93ea76745ab2cefb79a93e3c, type: 3}
   showInjuryNum: 1
+  ls: {fileID: 0}
+  isInSoulTower: 0
   totalDieKeepTime: 0
   dieKeepTime: 0
   canHitFly: 1

+ 1 - 1
ActionTowerDefense/Assets/Scenes/SampleScene.unity

@@ -30085,7 +30085,7 @@ PrefabInstance:
       objectReference: {fileID: 0}
     - target: {fileID: 6220511700128991423, guid: dd98f16e694849044b9b84d56d30cdb1, type: 3}
       propertyPath: m_LocalPosition.x
-      value: 106.4
+      value: -16.3
       objectReference: {fileID: 0}
     - target: {fileID: 6220511700128991423, guid: dd98f16e694849044b9b84d56d30cdb1, type: 3}
       propertyPath: m_LocalPosition.y

+ 8 - 3
ActionTowerDefense/Assets/Scripts/Demonic.cs

@@ -607,6 +607,8 @@ public class Demonic : MoveCharacter
                     }
                     else
                     {
+                        ani.Play("idle", 0, 0);
+                        aniCollider.Play("Idle", 0, 0);
                         rb.velocity = Vector3.zero;
                         transform.position = origSoulPos;
                         isReturnSoulTower = false;
@@ -633,7 +635,7 @@ public class Demonic : MoveCharacter
                 to = g;
             }
         }
-        if (to.transform.position.x < transform.position.x)
+        if (to != null && to.transform.position.x < transform.position.x)
         {
             if (bodyTrans.localScale.x < 0)
             {
@@ -692,6 +694,9 @@ public class Demonic : MoveCharacter
             case CharacterState.Float:
                 canMove = true;
                 break;
+            case CharacterState.LockSoul:
+                isReturnSoulTower = true;
+                break;
             default:
                 break;
         }
@@ -758,8 +763,8 @@ public class Demonic : MoveCharacter
                 break;
             case CharacterState.LockSoul:
                 rb.velocity = Vector3.zero;
-                ani.Play("idle", 0, 0);
-                aniCollider.Play("Idle", 0, 0);
+                ani.Play("walk", 0, 0);
+                aniCollider.Play("Walk", 0, 0);
                 FaceToEneTower();
                 break;
             default: