فهرست منبع

变身后可吸收魂;变身法师后修复不可向右攻击bug

SZAND\msx_2 1 سال پیش
والد
کامیت
8b00119491

+ 3 - 3
ActionTowerDefense/Assets/Animations/Spirits_Float/SpiritsFloatCollider_Attack2.anim

@@ -7,7 +7,7 @@ AnimationClip:
   m_PrefabInstance: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
   m_Name: SpiritsFloatCollider_Attack2
-  serializedVersion: 6
+  serializedVersion: 7
   m_Legacy: 0
   m_Compressed: 0
   m_UseHighQualityCurve: 1
@@ -54,7 +54,7 @@ AnimationClip:
     m_AdditiveReferencePoseClip: {fileID: 0}
     m_AdditiveReferencePoseTime: 0
     m_StartTime: 0
-    m_StopTime: 0.33333334
+    m_StopTime: 0
     m_OrientationOffsetY: 0
     m_Level: 0
     m_CycleOffset: 0
@@ -131,7 +131,7 @@ AnimationClip:
   m_HasGenericRootTransform: 0
   m_HasMotionFloatCurves: 0
   m_Events:
-  - time: 0.33333334
+  - time: 0
     functionName: Attack2ShootEvent
     data: 
     objectReferenceParameter: {fileID: 0}

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

@@ -287,10 +287,6 @@ MonoBehaviour:
   minHurtKeepTime: 0.2
   hurtKeepTime: 0
   hurtChangeVelocity: 1
-  comaTime: 5
-  pastComaTime: 0
-  isCaughtByCook: 0
-  isBeDropped: 0
   maxTime: 1.5
   minTime: 0.1
   maxHeight: 9
@@ -443,7 +439,7 @@ Transform:
   m_GameObject: {fileID: 5216717017252562314}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: 0}
-  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_LocalScale: {x: 2, y: 2, z: 2}
   m_ConstrainProportionsScale: 0
   m_Children:
   - {fileID: 1971427318739414964}

+ 6 - 0
ActionTowerDefense/Assets/Resources/Prefab/MySpirit/Spirits_Float.prefab

@@ -981,6 +981,8 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: c1bedfb340186164dbac1499b49b879e, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  isTran: 0
+  pc: {fileID: 0}
   HitCols:
   - {fileID: 5388987656270167698}
   - {fileID: 1190225091429982147}
@@ -1062,6 +1064,10 @@ MonoBehaviour:
   minHurtKeepTime: 0.2
   hurtKeepTime: 0
   hurtChangeVelocity: 1
+  comaTime: 5
+  pastComaTime: 0
+  isCaughtByCook: 0
+  isBeDropped: 0
   maxTime: 15
   minTime: 6
   maxHeight: 12

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

@@ -759,6 +759,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 0b46e3a90d8fc304caef18f1c373478c, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  isTran: 0
   HitCols:
   - {fileID: 5569876744729591823}
   - {fileID: 1367816017394770223}
@@ -832,7 +833,7 @@ MonoBehaviour:
   foot: {fileID: 3571941039716665623}
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
-  moveSpeed: 12
+  moveSpeed: 14
   beRepelValue: 0
   totalBeRepelValue: 100
   weakTime: 0
@@ -881,7 +882,7 @@ MonoBehaviour:
   - {fileID: 2437299196472462361, guid: 00861cbb6651ced4a85013d35a07b3e6, type: 3}
   - {fileID: 5440846222648032759, guid: 1d487061d2e4ceb409a42daadf985eec, type: 3}
   - {fileID: 2437299196472462361, guid: 0e7e5e45ddc25b641963c78f68b041b8, type: 3}
-  changeTime: 10
+  changeTime: 30
   demonicPrefabs:
   - {fileID: 8639832132491289359, guid: 4c2987691cdb47040b3a55ff928803c3, type: 3}
   - {fileID: 5440846222648032759, guid: 05825e721b2832f478f66e78daed901f, type: 3}
@@ -905,7 +906,7 @@ MonoBehaviour:
   sprintLinkTrigger: {fileID: 2536450432252384432}
   jumpSpeed: 20
   airJumpSpeed: 17
-  rushSpeed: 40
+  rushSpeed: 54
   mp: 0
   totalMp: 300
   mpReplySpeed: 12

+ 61 - 0
ActionTowerDefense/Assets/Resources/Prefab/Transfiguration/SoulCollector.prefab

@@ -0,0 +1,61 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &5376725906162418333
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 3086552803727018989}
+  - component: {fileID: 2485901983353895383}
+  - component: {fileID: 5865232508651324313}
+  m_Layer: 0
+  m_Name: SoulCollector
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &3086552803727018989
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 5376725906162418333}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 0}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &2485901983353895383
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 5376725906162418333}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 02e8744abca6d3d459e26c639743ddb7, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  player: {fileID: 0}
+--- !u!65 &5865232508651324313
+BoxCollider:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 5376725906162418333}
+  m_Material: {fileID: 0}
+  m_IsTrigger: 1
+  m_Enabled: 1
+  serializedVersion: 2
+  m_Size: {x: 3, y: 3, z: 1}
+  m_Center: {x: 0, y: 1, z: 0}

+ 7 - 0
ActionTowerDefense/Assets/Resources/Prefab/Transfiguration/SoulCollector.prefab.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: b4bf188276a397e44bb17112d3d3d013
+PrefabImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 5 - 0
ActionTowerDefense/Assets/Resources/Prefab/Transfiguration/Trans_Assassin.prefab

@@ -205,6 +205,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: c1bedfb340186164dbac1499b49b879e, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  isTran: 1
   HitCols:
   - {fileID: 6526817785665782971}
   - {fileID: 8769150919382874379}
@@ -274,6 +275,10 @@ MonoBehaviour:
   minHurtKeepTime: 0.2
   hurtKeepTime: 0
   hurtChangeVelocity: 1
+  comaTime: 5
+  pastComaTime: 0
+  isCaughtByCook: 0
+  isBeDropped: 0
   maxTime: 15
   minTime: 6
   maxHeight: 12

+ 5 - 0
ActionTowerDefense/Assets/Resources/Prefab/Transfiguration/Trans_Cook.prefab

@@ -790,6 +790,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: c1bedfb340186164dbac1499b49b879e, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  isTran: 1
   HitCols: []
   cookNum: 10
   mecanim: {fileID: 7573527827155227431}
@@ -846,6 +847,10 @@ MonoBehaviour:
   minHurtKeepTime: 0
   hurtKeepTime: 0
   hurtChangeVelocity: 0
+  comaTime: 5
+  pastComaTime: 0
+  isCaughtByCook: 0
+  isBeDropped: 0
   maxTime: 0
   minTime: 0
   maxHeight: 0

+ 69 - 2
ActionTowerDefense/Assets/Resources/Prefab/Transfiguration/Trans_Float.prefab

@@ -530,6 +530,65 @@ Transform:
   m_Father: {fileID: 8639832132491289354}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &4119178927446429342
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 6440736511392024558}
+  - component: {fileID: 5892967253400679892}
+  - component: {fileID: 2509289168932687770}
+  m_Layer: 0
+  m_Name: SoulCollector
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &6440736511392024558
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4119178927446429342}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 6561999689701501378}
+  m_RootOrder: 7
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &5892967253400679892
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4119178927446429342}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 02e8744abca6d3d459e26c639743ddb7, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  player: {fileID: 0}
+--- !u!65 &2509289168932687770
+BoxCollider:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4119178927446429342}
+  m_Material: {fileID: 0}
+  m_IsTrigger: 1
+  m_Enabled: 1
+  serializedVersion: 2
+  m_Size: {x: 3, y: 3, z: 1}
+  m_Center: {x: 0, y: 1, z: 0}
 --- !u!1 &5307676761346103599
 GameObject:
   m_ObjectHideFlags: 0
@@ -691,6 +750,7 @@ Transform:
   - {fileID: 8482269351142858204}
   - {fileID: 776105162125788029}
   - {fileID: 6220414675483084992}
+  - {fileID: 6440736511392024558}
   m_Father: {fileID: 5769591908339262981}
   m_RootOrder: 1
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -968,6 +1028,7 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   controller: {fileID: 0}
+  intervalTime: 0.5
   minTime: 7
   maxTime: 9
   toFloat: 0
@@ -1001,6 +1062,8 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: c1bedfb340186164dbac1499b49b879e, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  isTran: 1
+  pc: {fileID: 0}
   HitCols:
   - {fileID: 5388987656270167698}
   - {fileID: 1190225091429982147}
@@ -1023,7 +1086,7 @@ MonoBehaviour:
   totalHp: 100
   hp: 0
   attack1Infos:
-  - damage: 20
+  - damage: 200
     attackDir: {x: -1, y: 0, z: 0}
     force: 100
     changeHurt: 0
@@ -1039,7 +1102,7 @@ MonoBehaviour:
     changeHurt: 1
     repelValue: 10
   attack2Infos:
-  - damage: 20
+  - damage: 200
     attackDir: {x: -1, y: 0, z: 0}
     force: 0
     changeHurt: 0
@@ -1082,6 +1145,10 @@ MonoBehaviour:
   minHurtKeepTime: 0.2
   hurtKeepTime: 0
   hurtChangeVelocity: 1
+  comaTime: 5
+  pastComaTime: 0
+  isCaughtByCook: 0
+  isBeDropped: 0
   maxTime: 15
   minTime: 6
   maxHeight: 12

+ 5 - 0
ActionTowerDefense/Assets/Resources/Prefab/Transfiguration/Trans_Invisible.prefab

@@ -233,6 +233,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: c1bedfb340186164dbac1499b49b879e, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  isTran: 1
   HitCols:
   - {fileID: 6526817785665782971}
   - {fileID: 8769150919382874379}
@@ -302,6 +303,10 @@ MonoBehaviour:
   minHurtKeepTime: 0.2
   hurtKeepTime: 0
   hurtChangeVelocity: 1
+  comaTime: 5
+  pastComaTime: 0
+  isCaughtByCook: 0
+  isBeDropped: 0
   maxTime: 0
   minTime: 6
   maxHeight: 12

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

@@ -388,6 +388,8 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 481b12dc18964dc4f879c5df3686f5fa, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  isTran: 0
+  pc: {fileID: 0}
   HitCols: []
   cookNum: 0
   mecanim: {fileID: 0}
@@ -26445,6 +26447,10 @@ PrefabInstance:
       propertyPath: upSpeed
       value: 0.5
       objectReference: {fileID: 0}
+    - target: {fileID: 7524009302527559481, guid: 956ff4379e83d3c49a9c10310dbf7cc7, type: 3}
+      propertyPath: m_LocalPosition.x
+      value: -12
+      objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_SourcePrefab: {fileID: 100100000, guid: 956ff4379e83d3c49a9c10310dbf7cc7, type: 3}
 --- !u!1001 &3581793010024254886

+ 3 - 0
ActionTowerDefense/Assets/Scripts/Character.cs

@@ -48,6 +48,9 @@ public enum HpUpType
 
 public class Character : MonoBehaviour
 {
+    public bool isTran;
+    public PlayerController pc;
+
     public GameObject[] HitCols;
 
     public int cookNum;   //ÄÜ×ö³É¶àÉÙ´®Èâ

+ 49 - 39
ActionTowerDefense/Assets/Scripts/Demonic.cs

@@ -23,7 +23,6 @@ public class Demonic : MoveCharacter
 
     private void Awake()
     {
-        
     }
 
     private void Start()
@@ -138,55 +137,66 @@ public class Demonic : MoveCharacter
         Vector3 moveDir = Vector3.zero;
         if (canMove)
         {
-            switch (searchState)
+            if (!isTran)
             {
-                case SearchState.NoTarget:
-                    //if (PlayerController.instance.bodyTrans.localScale.x > 0)
-                    //{
-                    //    moveDir = Vector3.left;
-                    //}
-                    //else
-                    //{
-                    //    moveDir = Vector3.right;
-                    //}
-                    moveDir = Vector3.left;
-                    break;
-                case SearchState.InSearchScope:
-                    if (targetCharacter)
-                    {
-                        if (targetCharacter.transform.position.x - transform.position.x < 0)
+                switch (searchState)
+                {
+                    case SearchState.NoTarget:
+                        //if (PlayerController.instance.bodyTrans.localScale.x > 0)
+                        //{
+                        //    moveDir = Vector3.left;
+                        //}
+                        //else
+                        //{
+                        //    moveDir = Vector3.right;
+                        //}
+                        moveDir = Vector3.left;
+                        break;
+                    case SearchState.InSearchScope:
+                        if (targetCharacter)
                         {
-                            moveDir = Vector3.left;
+                            if (targetCharacter.transform.position.x - transform.position.x < 0)
+                            {
+                                moveDir = Vector3.left;
+                            }
+                            else
+                            {
+                                moveDir = Vector3.right;
+                            }
                         }
                         else
                         {
-                            moveDir = Vector3.right;
+                            moveDir = Vector3.zero;
                         }
-                    }
-                    else
-                    {
-                        moveDir = Vector3.zero;
-                    }
-                    break;
-                case SearchState.InAttackScope:
-                    if (targetCharacter)
-                    {
-                        if (targetCharacter.transform.position.x - transform.position.x < 0)
+                        break;
+                    case SearchState.InAttackScope:
+                        if (targetCharacter)
                         {
-                            moveDir = Vector3.left;
+                            if (targetCharacter.transform.position.x - transform.position.x < 0)
+                            {
+                                moveDir = Vector3.left;
+                            }
+                            else
+                            {
+                                moveDir = Vector3.right;
+                            }
                         }
                         else
                         {
-                            moveDir = Vector3.right;
+                            moveDir = Vector3.zero;
                         }
-                    }
-                    else
-                    {
-                        moveDir = Vector3.zero;
-                    }
-                    break;
-                default:
-                    break;
+                        break;
+                    default:
+                        break;
+                }
+            }
+            else
+            {
+                if (pc == null)
+                {
+                    pc = GetComponentInParent<PlayerController>();
+                }
+                moveDir = pc.GetMoveDir();
             }
         }
         return moveDir;

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

@@ -260,6 +260,15 @@ public class MoveCharacter : Character
         }
 
         hp -= damage;
+        if (isTran)
+        {
+            if (pc == null)
+            {
+                pc = GetComponentInParent<PlayerController>();
+            }
+            pc.hp = hp;
+            pc.uiHp.Show(pc.hp, pc.totalHp);
+        }
         uiHp.Show(hp, totalHp);
         if (hp <= 0)
         {

+ 2 - 1
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -378,9 +378,10 @@ public class PlayerController : MoveCharacter
         else
         {
             leftDir = Vector3.zero;
-            moveVec= value.Get<Vector2>();
+            moveVec = value.Get<Vector2>();
         }
     }
+    
     void OnJump()
     {
         if (canJump && canMove)

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

@@ -13,6 +13,10 @@ public class SoulCollector : MonoBehaviour
 
     private void OnTriggerEnter(Collider other)
     {
+        if (player == null)
+        {
+            player = GetComponentInParent<PlayerController>();
+        }
         Soul soul = other.GetComponentInParent<Soul>();
         if (soul)
         {

+ 15 - 1
ActionTowerDefense/Assets/Scripts/Spirits/Trans_Float.cs

@@ -6,6 +6,10 @@ public class Trans_Float : MonoBehaviour
 {
     public PlayerController controller;
 
+    public float intervalTime;              //攻击硬直
+    private float pastAttackTime;
+    private bool canAttack = true;
+
     private bool isFirst = true;            //第一次攻击
     private int times;                      //攻击次数
     public int minTime, maxTime;            //保底范围
@@ -39,8 +43,18 @@ public class Trans_Float : MonoBehaviour
 
     private void Update()
     {
-        if (controller.isinputJ)
+        if (!canAttack)
+        {
+            pastAttackTime += Time.deltaTime;
+            if (pastAttackTime >= intervalTime)
+            {
+                canAttack = true;
+                pastAttackTime = 0;
+            }
+        }
+        if (controller.isinputJ && canAttack)
         {
+            canAttack = false;
             controller.isinputJ = false;
             if (isFirst)
             {