Explorar el Código

刺客冲刺移动

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

+ 97 - 0
ActionTowerDefense/Assets/Resources/Prefab/DashAttackEffect.prefab

@@ -0,0 +1,97 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &2183721406926779447
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 8664237789312556553}
+  - component: {fileID: 3035890298701611987}
+  - component: {fileID: 2416267944528422428}
+  m_Layer: 7
+  m_Name: DashAttackTrigger
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &8664237789312556553
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2183721406926779447}
+  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: 1
+  m_Children: []
+  m_Father: {fileID: 1162837953448672199}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!65 &3035890298701611987
+BoxCollider:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2183721406926779447}
+  m_Material: {fileID: 0}
+  m_IsTrigger: 1
+  m_Enabled: 1
+  serializedVersion: 2
+  m_Size: {x: 2.5, y: 2, z: 1}
+  m_Center: {x: -1.5, y: 1, z: 0}
+--- !u!114 &2416267944528422428
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2183721406926779447}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 028d37216b47ca446ba0037910919e25, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  damage: 50
+  attackDir: {x: -2, y: 1, z: 0}
+  force: 10000
+  changeHurt: 1
+  repelValue: 31
+--- !u!1 &3022365896308084047
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1162837953448672199}
+  m_Layer: 7
+  m_Name: DashAttackEffect
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &1162837953448672199
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 3022365896308084047}
+  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:
+  - {fileID: 8664237789312556553}
+  m_Father: {fileID: 0}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

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

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

+ 13 - 0
ActionTowerDefense/Assets/Resources/Prefab/Demonic_Arrow.prefab

@@ -90,6 +90,7 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  mainParent: {fileID: 8639832132491289359}
 --- !u!1 &1637528673901708253
 GameObject:
   m_ObjectHideFlags: 0
@@ -1013,6 +1014,9 @@ MonoBehaviour:
   searchTrigger: {fileID: 3566347593191160092}
   targetTypes: 0400000005000000
   canHitFly: 1
+  linked: 0
+  joint: {fileID: 0}
+  rope: {fileID: 0}
   foot: {fileID: 8639832132450015562}
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
@@ -1026,12 +1030,21 @@ MonoBehaviour:
   minHurtKeepTime: 0.2
   hurtKeepTime: 0
   hurtChangeVelocity: 1
+  maxTime: 0
+  minTime: 6
+  maxHeight: 12
+  minHeight: 7
+  maxRotateSpeed: 20
+  minRotateSpeed: 5
+  floatTime: 20
   id: 0
   costMp: 40
   searchState: 0
   attackDistance: 10
   canFly: 1
   sortingOrder: 2000
+  playerID: 0
+  hasEffect: 0
 --- !u!54 &8639832132491289349
 Rigidbody:
   m_ObjectHideFlags: 0

+ 13 - 0
ActionTowerDefense/Assets/Resources/Prefab/Demonic_Giant.prefab

@@ -156,6 +156,7 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  mainParent: {fileID: 5440846222648032759}
 --- !u!1 &4480734502875862885
 GameObject:
   m_ObjectHideFlags: 0
@@ -466,6 +467,9 @@ MonoBehaviour:
   searchTrigger: {fileID: 2932762729738363159}
   targetTypes: 0400000005000000
   canHitFly: 0
+  linked: 0
+  joint: {fileID: 0}
+  rope: {fileID: 0}
   foot: {fileID: 5440846222604650418}
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
@@ -479,12 +483,21 @@ MonoBehaviour:
   minHurtKeepTime: 0.2
   hurtKeepTime: 0
   hurtChangeVelocity: 1
+  maxTime: 0
+  minTime: 6
+  maxHeight: 12
+  minHeight: 7
+  maxRotateSpeed: 20
+  minRotateSpeed: 5
+  floatTime: 20
   id: 0
   costMp: 150
   searchState: 0
   attackDistance: 3
   canFly: 0
   sortingOrder: 0
+  playerID: 0
+  hasEffect: 0
 --- !u!54 &5440846222648032765
 Rigidbody:
   m_ObjectHideFlags: 0

+ 13 - 0
ActionTowerDefense/Assets/Resources/Prefab/Demonic_Sword.prefab

@@ -207,6 +207,9 @@ MonoBehaviour:
   searchTrigger: {fileID: 5104552355235513707}
   targetTypes: 0400000005000000
   canHitFly: 0
+  linked: 0
+  joint: {fileID: 0}
+  rope: {fileID: 0}
   foot: {fileID: 2437299196663985756}
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
@@ -220,12 +223,21 @@ MonoBehaviour:
   minHurtKeepTime: 0.2
   hurtKeepTime: 0
   hurtChangeVelocity: 1
+  maxTime: 0
+  minTime: 6
+  maxHeight: 12
+  minHeight: 7
+  maxRotateSpeed: 20
+  minRotateSpeed: 5
+  floatTime: 20
   id: 0
   costMp: 100
   searchState: 0
   attackDistance: 1.5
   canFly: 0
   sortingOrder: 1000
+  playerID: 0
+  hasEffect: 0
 --- !u!54 &2437299196472462355
 Rigidbody:
   m_ObjectHideFlags: 0
@@ -915,6 +927,7 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  mainParent: {fileID: 2437299196472462361}
 --- !u!1 &8802879426389446295
 GameObject:
   m_ObjectHideFlags: 0

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

@@ -90,6 +90,7 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  mainParent: {fileID: 8639832132491289359}
 --- !u!1 &1637528673901708253
 GameObject:
   m_ObjectHideFlags: 0

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

@@ -156,6 +156,7 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  mainParent: {fileID: 5440846222648032759}
 --- !u!1 &4480734502875862885
 GameObject:
   m_ObjectHideFlags: 0

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

@@ -598,6 +598,7 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  mainParent: {fileID: 2437299196472462361}
 --- !u!1 &6164447163453378808
 GameObject:
   m_ObjectHideFlags: 0

+ 98 - 4
ActionTowerDefense/Assets/Resources/Prefab/Spirits_Assassin.prefab

@@ -31,7 +31,7 @@ Transform:
   m_ConstrainProportionsScale: 0
   m_Children: []
   m_Father: {fileID: 2437299196472462364}
-  m_RootOrder: 1
+  m_RootOrder: 2
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!114 &5104552355235513707
 MonoBehaviour:
@@ -140,6 +140,7 @@ GameObject:
   serializedVersion: 6
   m_Component:
   - component: {fileID: 2437299196472462364}
+  - component: {fileID: 4121013642250487013}
   - component: {fileID: 2437299196472462353}
   - component: {fileID: 2437299196472462355}
   m_Layer: 7
@@ -161,12 +162,32 @@ Transform:
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children:
+  - {fileID: 9158931676160558098}
   - {fileID: 2730232521377132808}
   - {fileID: 5061628209490452354}
   - {fileID: 8507731236713456294}
   m_Father: {fileID: 0}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &4121013642250487013
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2437299196472462361}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 650247f9c3a070a419cde11fb87b7afe, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  moveSpeed: 30
+  rb: {fileID: 2437299196472462355}
+  demonic: {fileID: 2437299196472462353}
+  isDash: 1
+  time: 0
+  dashTime: 0.5
+  dashAttackEffect: {fileID: 5100798150433256090}
 --- !u!114 &2437299196472462353
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -208,7 +229,7 @@ MonoBehaviour:
     repelValue: 50
   attackTriggers:
   - {fileID: 4347565098670608659}
-  attackType: 0
+  attackType: 2
   bulletPrefab: {fileID: 0}
   shootPos: []
   dieKeepTime: 0
@@ -251,6 +272,7 @@ MonoBehaviour:
   canFly: 0
   sortingOrder: 1000
   playerID: 0
+  hasEffect: 0
 --- !u!54 &2437299196472462355
 Rigidbody:
   m_ObjectHideFlags: 0
@@ -357,7 +379,7 @@ Transform:
   - {fileID: 1971427318739414964}
   - {fileID: 7794457276998281569}
   m_Father: {fileID: 2437299196472462364}
-  m_RootOrder: 0
+  m_RootOrder: 1
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &5854255137085934375
 GameObject:
@@ -768,7 +790,7 @@ RectTransform:
   m_Children:
   - {fileID: 6098794361404217704}
   m_Father: {fileID: 2437299196472462364}
-  m_RootOrder: 2
+  m_RootOrder: 3
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
@@ -940,6 +962,7 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  mainParent: {fileID: 2437299196472462361}
 --- !u!1 &8802879426389446295
 GameObject:
   m_ObjectHideFlags: 0
@@ -1016,3 +1039,74 @@ MonoBehaviour:
   m_FillOrigin: 0
   m_UseSpriteMesh: 0
   m_PixelsPerUnitMultiplier: 1
+--- !u!1001 &8014213950561976277
+PrefabInstance:
+  m_ObjectHideFlags: 0
+  serializedVersion: 2
+  m_Modification:
+    m_TransformParent: {fileID: 2437299196472462364}
+    m_Modifications:
+    - target: {fileID: 1162837953448672199, guid: b3895ed8d961d9d449084e8630a3293c, type: 3}
+      propertyPath: m_RootOrder
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1162837953448672199, guid: b3895ed8d961d9d449084e8630a3293c, type: 3}
+      propertyPath: m_LocalPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1162837953448672199, guid: b3895ed8d961d9d449084e8630a3293c, type: 3}
+      propertyPath: m_LocalPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1162837953448672199, guid: b3895ed8d961d9d449084e8630a3293c, type: 3}
+      propertyPath: m_LocalPosition.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1162837953448672199, guid: b3895ed8d961d9d449084e8630a3293c, type: 3}
+      propertyPath: m_LocalRotation.w
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: 1162837953448672199, guid: b3895ed8d961d9d449084e8630a3293c, type: 3}
+      propertyPath: m_LocalRotation.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1162837953448672199, guid: b3895ed8d961d9d449084e8630a3293c, type: 3}
+      propertyPath: m_LocalRotation.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1162837953448672199, guid: b3895ed8d961d9d449084e8630a3293c, type: 3}
+      propertyPath: m_LocalRotation.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1162837953448672199, guid: b3895ed8d961d9d449084e8630a3293c, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1162837953448672199, guid: b3895ed8d961d9d449084e8630a3293c, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1162837953448672199, guid: b3895ed8d961d9d449084e8630a3293c, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3022365896308084047, guid: b3895ed8d961d9d449084e8630a3293c, type: 3}
+      propertyPath: m_Name
+      value: DashAttackEffect
+      objectReference: {fileID: 0}
+    - target: {fileID: 3022365896308084047, guid: b3895ed8d961d9d449084e8630a3293c, type: 3}
+      propertyPath: m_IsActive
+      value: 0
+      objectReference: {fileID: 0}
+    m_RemovedComponents: []
+  m_SourcePrefab: {fileID: 100100000, guid: b3895ed8d961d9d449084e8630a3293c, type: 3}
+--- !u!1 &5100798150433256090 stripped
+GameObject:
+  m_CorrespondingSourceObject: {fileID: 3022365896308084047, guid: b3895ed8d961d9d449084e8630a3293c, type: 3}
+  m_PrefabInstance: {fileID: 8014213950561976277}
+  m_PrefabAsset: {fileID: 0}
+--- !u!4 &9158931676160558098 stripped
+Transform:
+  m_CorrespondingSourceObject: {fileID: 1162837953448672199, guid: b3895ed8d961d9d449084e8630a3293c, type: 3}
+  m_PrefabInstance: {fileID: 8014213950561976277}
+  m_PrefabAsset: {fileID: 0}

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

@@ -28,6 +28,7 @@ public enum AttackType
 {
     Melee = 0,//½üÕ½
     Shoot = 1,//Éä»÷
+    Dash = 2,   //Ó¢Áé´Ì¿Í
 }
 
 public class Character : MonoBehaviour
@@ -218,7 +219,9 @@ public class Character : MonoBehaviour
                 }
                 break;
             case AttackType.Shoot:
+            case AttackType.Dash:
                 break;
+
             default:
                 break;
         }
@@ -249,6 +252,7 @@ public class Character : MonoBehaviour
         switch (attackType)
         {
             case AttackType.Melee:
+            case AttackType.Dash:
                 for (int i = 0; i < attack2Infos.Count; i++)
                 {
                     attackTriggers[i].damage = attack2Infos[i].damage;

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

@@ -0,0 +1,29 @@
+using Base.Common;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class DashEffect : MonoBehaviour
+{
+    public int damage;
+    public Vector3 attackDir;
+    public float force;
+    public bool changeHurt;
+    public float repelValue;
+    private void OnTriggerEnter(Collider other)
+    {
+        if(other.name == "BeHitTrigger")
+        {
+            
+            BeHitTrigger beHitTrigger = other.GetComponent<BeHitTrigger>();
+            print(11111111);
+            print(beHitTrigger.mainParent.tag);
+            if (beHitTrigger.mainParent.CompareTag("Enemy"))
+            {
+                
+                beHitTrigger.BeHit(damage, attackDir*force, changeHurt, repelValue);
+            }
+            
+        }
+    }
+}

+ 11 - 0
ActionTowerDefense/Assets/Scripts/Spirits/DashEffect.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 028d37216b47ca446ba0037910919e25
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 41 - 1
ActionTowerDefense/Assets/Scripts/Spirits/Spirits_Dash.cs

@@ -4,5 +4,45 @@ using UnityEngine;
 
 public class Spirits_Dash : MonoBehaviour
 {
-
+    public float moveSpeed;
+    public Rigidbody rb;
+    public Demonic demonic;
+    public bool isDash;
+    [HideInInspector]
+    public float time;
+    public float dashTime = 0.5f;
+    public GameObject dashAttackEffect;
+    private void Update()
+    {
+        if (isDash)
+        {
+            time += Time.deltaTime;
+            Dash();
+            if(time >= dashTime)
+            {
+                DashAttackEffect();
+                
+            }
+            if(time >= 1.34f)
+            {
+                this.enabled = false;
+            }
+        }
+    }
+    void DashAttackEffect()
+    {
+        rb.velocity = Vector3.zero;
+        dashAttackEffect.SetActive(true);
+    }
+    private void Dash()
+    {
+        if (demonic.bodyTrans.localScale.x < 0)
+        {
+            rb.velocity = Vector3.right * moveSpeed;
+        }
+        if (demonic.bodyTrans.localScale.x > 0)
+        {
+            rb.velocity = Vector3.left * moveSpeed;
+        }
+    }
 }