SZAND\msx_2 vor 7 Monaten
Ursprung
Commit
4faa7754a9

+ 5 - 4
ActionTowerDefense/Assets/Resources/Prefab/Arrow.prefab

@@ -131,8 +131,8 @@ BoxCollider:
   m_IsTrigger: 1
   m_Enabled: 1
   serializedVersion: 2
-  m_Size: {x: 2, y: 2, z: 20}
-  m_Center: {x: 0, y: 0, z: 0}
+  m_Size: {x: 0.44393843, y: 2, z: 20}
+  m_Center: {x: -0.15355927, y: 0, z: 0}
 --- !u!114 &7485360237884938143
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -145,6 +145,8 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 9a4a2dbc1e482cd4b9f1532e1fddcb30, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  canStop: 1
+  stopTime: 1.5
   owner: {fileID: 0}
   rb: {fileID: 0}
   trigedObjs: []
@@ -158,9 +160,8 @@ MonoBehaviour:
   maxFlyTime: 2
   flyTime: 0
   isTrack: 0
+  canAlwaysTrack: 0
   trackTarget: {fileID: 0}
-  isBack: 0
-  stayTime: 0
   canTransmit: 0
   haveTransmit: 0
   transmitTime: 0

+ 2 - 2
ActionTowerDefense/Assets/Resources/Prefab/BaGua/Demonic_Giant_Yang.prefab

@@ -95,6 +95,7 @@ MonoBehaviour:
   type: 0
   owner: {fileID: 0}
   isSingleAttack: 0
+  cantSingleAttack: 0
   trigedObjs: []
   damage: 0
   force: {x: 0, y: 0, z: 0}
@@ -544,6 +545,7 @@ MonoBehaviour:
   bulletPrefab: {fileID: 0}
   shootPos: []
   shootTrack: 0
+  shootAlwaysTrack: 0
   Attack_summonInfos:
   - damage: 10
     attackDir: {x: 0, y: 0, z: 0}
@@ -578,8 +580,6 @@ MonoBehaviour:
   isTran: 0
   pc: {fileID: 0}
   hptp: 0
-  joint: {fileID: 0}
-  rope: {fileID: 0}
   beLarger: 0
   toLargeSize: 0
   cookEffect: {fileID: 0}

+ 2 - 2
ActionTowerDefense/Assets/Resources/Prefab/BaGua/Demonic_Giant_Yin.prefab

@@ -95,6 +95,7 @@ MonoBehaviour:
   type: 0
   owner: {fileID: 0}
   isSingleAttack: 0
+  cantSingleAttack: 0
   trigedObjs: []
   damage: 0
   force: {x: 0, y: 0, z: 0}
@@ -544,6 +545,7 @@ MonoBehaviour:
   bulletPrefab: {fileID: 0}
   shootPos: []
   shootTrack: 0
+  shootAlwaysTrack: 0
   Attack_summonInfos:
   - damage: 10
     attackDir: {x: 0, y: 0, z: 0}
@@ -578,8 +580,6 @@ MonoBehaviour:
   isTran: 0
   pc: {fileID: 0}
   hptp: 0
-  joint: {fileID: 0}
-  rope: {fileID: 0}
   beLarger: 0
   toLargeSize: 0
   cookEffect: {fileID: 0}

+ 2 - 2
ActionTowerDefense/Assets/Resources/Prefab/Conduct/Demonic_BigGiant.prefab

@@ -95,6 +95,7 @@ MonoBehaviour:
   type: 0
   owner: {fileID: 0}
   isSingleAttack: 0
+  cantSingleAttack: 0
   trigedObjs: []
   damage: 0
   force: {x: 0, y: 0, z: 0}
@@ -506,6 +507,7 @@ MonoBehaviour:
   bulletPrefab: {fileID: 0}
   shootPos: []
   shootTrack: 0
+  shootAlwaysTrack: 0
   Attack_summonInfos:
   - damage: 50
     attackDir: {x: 0, y: 0, z: 0}
@@ -540,8 +542,6 @@ MonoBehaviour:
   isTran: 0
   pc: {fileID: 0}
   hptp: 0
-  joint: {fileID: 0}
-  rope: {fileID: 0}
   beLarger: 0
   toLargeSize: 0
   cookEffect: {fileID: 0}

+ 2 - 20
ActionTowerDefense/Assets/Resources/Prefab/Enemy/Enemy_Giant.prefab

@@ -95,6 +95,7 @@ MonoBehaviour:
   type: 0
   owner: {fileID: 0}
   isSingleAttack: 0
+  cantSingleAttack: 0
   trigedObjs: []
   damage: 0
   force: {x: 0, y: 0, z: 0}
@@ -488,6 +489,7 @@ MonoBehaviour:
   bulletPrefab: {fileID: 0}
   shootPos: []
   shootTrack: 0
+  shootAlwaysTrack: 0
   Attack_summonInfos:
   - damage: 0
     attackDir: {x: 0, y: 0, z: 0}
@@ -522,8 +524,6 @@ MonoBehaviour:
   isTran: 0
   pc: {fileID: 0}
   hptp: 0
-  joint: {fileID: 0}
-  rope: {fileID: 0}
   beLarger: 0
   toLargeSize: 0
   cookEffect: {fileID: 0}
@@ -620,24 +620,6 @@ MonoBehaviour:
   dropSoulMax: 5
   dropSoulMin: 5
   dropSoulAngle: 90
-  aimEffect: {fileID: 0}
-  dashEffect: {fileID: 0}
-  noOnSearchState: 0
-  isFindingPlayer: 0
-  isFindPlayer: 0
-  hateDistance: 0
-  distance: 0
-  rushEndPos: {x: 0, y: 0, z: 0}
-  aimDistance: 0
-  rushTime: 0
-  rushSpeed: 0
-  time: 0
-  readyCD: 0
-  targetDir: {x: 0, y: 0, z: 0}
-  haveDownRush: 0
-  rushHaveAttack: 0
-  downRushTime: 0
-  finishRushTime: 0
   upFirstAfterWeaknessOrNot: 0
 --- !u!54 &5440846222648032765
 Rigidbody:

+ 2 - 2
ActionTowerDefense/Assets/Resources/Prefab/MySoldier/Demonic_Giant.prefab

@@ -95,6 +95,7 @@ MonoBehaviour:
   type: 0
   owner: {fileID: 0}
   isSingleAttack: 0
+  cantSingleAttack: 0
   trigedObjs: []
   damage: 0
   force: {x: 0, y: 0, z: 0}
@@ -489,6 +490,7 @@ MonoBehaviour:
   bulletPrefab: {fileID: 0}
   shootPos: []
   shootTrack: 0
+  shootAlwaysTrack: 0
   Attack_summonInfos:
   - damage: 20
     attackDir: {x: 0, y: 0, z: 0}
@@ -523,8 +525,6 @@ MonoBehaviour:
   isTran: 0
   pc: {fileID: 0}
   hptp: 0
-  joint: {fileID: 0}
-  rope: {fileID: 0}
   beLarger: 0
   toLargeSize: 0
   cookEffect: {fileID: 0}

+ 29 - 1
ActionTowerDefense/Assets/Resources/Spine/demon_sword/demon_sword_Controller.controller

@@ -808,7 +808,35 @@ AnimationClip:
     m_KeepOriginalPositionXZ: 0
     m_HeightFromFeet: 0
     m_Mirror: 0
-  m_EditorCurves: []
+  m_EditorCurves:
+  - curve:
+      serializedVersion: 2
+      m_Curve:
+      - serializedVersion: 3
+        time: 0
+        value: 0
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 0
+        weightedMode: 0
+        inWeight: 0
+        outWeight: 0
+      - serializedVersion: 3
+        time: 1.8333
+        value: 0
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 0
+        weightedMode: 0
+        inWeight: 0
+        outWeight: 0
+      m_PreInfinity: 2
+      m_PostInfinity: 2
+      m_RotationOrder: 4
+    attribute: dummy
+    path: 
+    classID: 1
+    script: {fileID: 0}
   m_EulerEditorCurves: []
   m_HasGenericRootTransform: 0
   m_HasMotionFloatCurves: 0

+ 1 - 1
ActionTowerDefense/Assets/Resources/Spine/demonic_giant/demon_giant_SkeletonData.asset

@@ -28,4 +28,4 @@ MonoBehaviour:
   toAnimation: []
   duration: []
   defaultMix: 0.2
-  controller: {fileID: 0}
+  controller: {fileID: 9100000, guid: 0302d6d228ad10d4387af648ad292a2d, type: 2}

+ 30 - 1
ActionTowerDefense/Assets/Scripts/Bullet.cs

@@ -12,6 +12,11 @@ public enum BulletType
 }
 public class Bullet : MonoBehaviour
 {
+    [Header("是否留下箭种")]
+    public bool canStop;
+    public float stopTime;
+    
+    [Header("组件")]
     public Character owner;
     public Rigidbody rb;
     public List<BeHitTrigger> trigedObjs;
@@ -24,8 +29,10 @@ public class Bullet : MonoBehaviour
     public float speed;
     public float maxFlyTime = 2f;
     public float flyTime;
+
     [Header("子弹是否追踪,不勾选则水平往前射出")]
     public bool isTrack;
+
     [Header("子弹是否始终追踪,勾选:子弹会跟着目标转,不勾选:子弹斜着往前直飞")]
     public bool canAlwaysTrack;
     public Character trackTarget;
@@ -175,7 +182,29 @@ public class Bullet : MonoBehaviour
                                 hitTrigger.owner.DebugAttackFrom(owner.name, curDamage);
                             }
                             isGetTarget = true;
-                            gameObject.SetActive(false);
+                            if (!canStop)
+                            {
+                                gameObject.SetActive(false);
+                            }
+                            else
+                            {
+                                rb.velocity = Vector3.zero;
+                                rb.isKinematic = true;
+                                GetComponent<Collider>().enabled = false;
+                                transform.parent = hitTrigger.transform;
+                                BulletStop bs = GetComponent<BulletStop>();
+                                if (bs)
+                                {
+                                    bs.enabled = true;
+                                }
+                                else
+                                {
+                                    bs = gameObject.AddComponent<BulletStop>();
+                                }
+                                bs.SetDisappearTime(stopTime);
+                                enabled = false;
+                            }
+                            
                             break;
                         case BulletType.Penetrate:
                             hitTrigger.BeHit(curDamage, force * (-transform.right), changeHurt, repelValue);

+ 36 - 0
ActionTowerDefense/Assets/Scripts/BulletStop.cs

@@ -0,0 +1,36 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class BulletStop : MonoBehaviour
+{
+    private List<SpriteRenderer> pics = new List<SpriteRenderer>();
+
+    private void OnEnable()
+    {
+        pics.Clear();
+        foreach(SpriteRenderer sr in GetComponentsInChildren<SpriteRenderer>())
+        {
+            pics.Add(sr);
+            sr.sortingOrder = -1;
+        }
+    }
+
+    public void SetDisappearTime(float time)
+    {
+        Invoke("Disappear", time);
+    }
+
+    private void Disappear()
+    {
+        gameObject.SetActive(false);
+        GetComponent<Rigidbody>().isKinematic = false;
+        GetComponent<Collider>().enabled = true;
+        transform.parent = null;
+        foreach (SpriteRenderer sr in pics)
+        {
+            sr.sortingOrder = 1;
+        }
+        enabled = false;
+    }
+}

+ 11 - 0
ActionTowerDefense/Assets/Scripts/BulletStop.cs.meta

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