Kaynağa Gözat

弓箭手attack1能被传送门传送

LAPTOP-OM1V99U2\永远de小亡灵 1 yıl önce
ebeveyn
işleme
78168e0c0c

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

@@ -1039,6 +1039,7 @@ MonoBehaviour:
   beLarger: 0
   toLargeSize: 0
   cookEffect: {fileID: 0}
+  attack1ShootCanTransmit: 1
   matState: 1
   spinee: {fileID: 0}
   mesh: {fileID: 0}

+ 59 - 71
ActionTowerDefense/Assets/Resources/Prefab/Enemy_Arrow.prefab

@@ -970,13 +970,6 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 7475a7d33f657b146a4994b1e02710ad, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  isTran: 0
-  pc: {fileID: 0}
-  isSpirit: 0
-  HitCols:
-  - {fileID: 5388987656270167698}
-  - {fileID: 1190225091429982147}
-  cookNum: 3
   mecanim: {fileID: 3354085511906294621}
   meshRenderer: {fileID: 0}
   ani: {fileID: 5978259926173120695}
@@ -984,19 +977,32 @@ MonoBehaviour:
   rb: {fileID: 8639832132491289349}
   bodyTrans: {fileID: 5769591908339262981}
   beSearchTrigger: {fileID: 316813748882225178}
-  beHitTrigger: {fileID: 9020361017135710302}
+  searchTrigger: {fileID: 3566347593191160092}
   bodyCollider: {fileID: 2616922587087395095}
   uiHp: {fileID: 3586716274361854270}
   state: 0
+  totalHp: 100
+  hp: 0
+  isDie: 0
+  isRevive: 0
+  linked: 0
+  canNotAddForce: 0
+  canNotChangeHurt: 0
+  invincibleTime: 0
+  totalDieKeepTime: 2
+  dieKeepTime: 0
+  canHitFly: 1
+  isNonAttack: 0
   attackTime: 0
   totalAttack1Time: 1.8
   totalAttack2Time: 1.3
-  isNonAttack: 0
-  hptp: 0
-  isDie: 0
-  isRevive: 0
-  totalHp: 100
-  hp: 0
+  attackType: 1
+  bulletPrefab: {fileID: 7473170563405908938, guid: 0460e8750cef0df4292f6d2bb56a4843, type: 3}
+  shootPos:
+  - {fileID: 8482269351142858204}
+  - {fileID: 776105162125788029}
+  - {fileID: 6220414675483084992}
+  shootTrack: 1
   attack1Infos:
   - damage: 10
     attackDir: {x: -1, y: 0, z: 0}
@@ -1020,74 +1026,55 @@ MonoBehaviour:
     changeHurt: 0
     repelValue: 0
   attackTriggers: []
-  attackType: 1
-  bulletPrefab: {fileID: 7473170563405908938, guid: 0460e8750cef0df4292f6d2bb56a4843, type: 3}
-  shootPos:
-  - {fileID: 8482269351142858204}
-  - {fileID: 776105162125788029}
-  - {fileID: 6220414675483084992}
-  dieKeepTime: 0
-  totalDieKeepTime: 2
-  attackTarget: {fileID: 0}
-  shootTrack: 1
-  invincibleTime: 0
-  totalInvincibleTime: 0
+  targetTypes: 010000000300000002000000
   targetCharacter: {fileID: 0}
+  attackTarget: {fileID: 0}
   beTargetCharacter: []
-  searchTrigger: {fileID: 3566347593191160092}
-  targetTypes: 010000000300000002000000
-  canHitFly: 1
-  linked: 0
+  isSpirit: 0
+  isTran: 0
+  pc: {fileID: 0}
+  hptp: 0
   joint: {fileID: 0}
   rope: {fileID: 0}
-  hasHpUp: 0
   beLarger: 0
-  canHitFloat: 0
-  floatProbability: 0
-  attackToFloat: 0
-  floatTimes: 0
-  hasFloatTimes: 0
-  criticalChance: 0
-  criticalMultiplier: 0
-  canMove: 1
+  toLargeSize: 0
+  cookEffect: {fileID: 0}
+  attack1ShootCanTransmit: 1
+  matState: 1
+  spinee: {fileID: 0}
+  mesh: {fileID: 0}
+  mats: []
+  outlineMats:
+  - {fileID: 2100000, guid: b634d447d9a02a14abc964532eedfc35, type: 2}
+  outline1Mats:
+  - {fileID: 2100000, guid: 916bb121eaeae3b43914636f946abdcd, type: 2}
   foot: {fileID: 8639832132450015562}
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
+  canMove: 1
   moveSpeed: 5
-  beRepelValue: 0
   totalBeRepelValue: 20
+  beRepelValue: 0
   weakTime: 0
   totalWeakTime: 10
-  weakUpSpeed: 10
+  weakHitRate: 2
+  easyToGetHit: 0.2
+  isDamageReduction: 0
+  reductionDegree: 0
+  reductionEffect: {fileID: 0}
   decelerationRatio: 2
-  minHurtKeepTime: 0.2
-  hurtKeepTime: 0
-  hurtChangeVelocity: 1
   comaTime: 5
   pastComaTime: 0
-  isCaughtByCook: 0
-  isBeDropped: 0
+  floatState: 0
   maxTime: 1.5
   minTime: 0.1
   maxHeight: 9
   minHeight: 4
+  floatTime: 10
   maxRotateSpeed: 20
   minRotateSpeed: 5
-  floatTime: 10
   isFloat: 0
-  dropDamage: 100
   normalFallSpeed: 10
-  rapidFallSpeed: 30
-  curFallSpeed: 0
-  floatState: 0
-  matState: 1
-  spinee: {fileID: 0}
-  mesh: {fileID: 0}
-  mats: []
-  outlineMats:
-  - {fileID: 2100000, guid: b634d447d9a02a14abc964532eedfc35, type: 2}
-  outline1Mats:
-  - {fileID: 2100000, guid: 916bb121eaeae3b43914636f946abdcd, type: 2}
   playerMe: {fileID: 0}
   playerAni: {fileID: 0}
   playerCol: {fileID: 0}
@@ -1100,49 +1087,50 @@ MonoBehaviour:
   playerMesh: {fileID: 0}
   playerMats: []
   playerOut: []
-  canNotChangeHurt: 0
   soulPrefab: {fileID: 1723151111827507807, guid: e2b65aa482f2f1447a4074208d72b778, type: 3}
   soulStartSpeed: 1
   isInvisible: 0
   invisibleTime: 0
   velocityAddition: 0
-  easyToGetHit: 0.2
+  haveTransmit: 0
+  transmitTime: 0
+  portalsController: {fileID: 0}
   id: 0
+  sortingOrder: 2000
+  canFly: 1
+  isBack: 0
+  flyHeight: 0
+  flyUpSpeed: 10
   jumpSpeed: 10
+  maxMoveSpeed: 12
+  minMoveSpeed: 8
+  runSpeed: 0
   searchState: 0
   attackDistance: 10
   maxAttackDis: 15
   minAttackDis: 9
   needToChange: 1
-  canFly: 1
-  flyHeight: 0
-  flyUpSpeed: 10
-  sortingOrder: 2000
   attackRatio: 0
-  maxMoveSpeed: 12
-  minMoveSpeed: 8
-  runSpeed: 0
   dropSoul: 1
   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}
-  aimEffect: {fileID: 0}
   aimDistance: 0
   rushTime: 0
   rushSpeed: 0
   time: 0
   readyCD: 0
-  dashEffect: {fileID: 0}
   targetDir: {x: 0, y: 0, z: 0}
   haveDownRush: 0
   rushHaveAttack: 0
   downRushTime: 0
   finishRushTime: 0
-  isBack: 0
 --- !u!54 &8639832132491289349
 Rigidbody:
   m_ObjectHideFlags: 0

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

@@ -128,6 +128,8 @@ public class Character : MonoBehaviour
     [Header("特效")]
     public GameObject cookEffect;       //吃串加血
 
+    [Header("传送门")]
+    public bool attack1ShootCanTransmit;    //普攻1弓箭可以被传送
     public virtual void Init()
     {
         //确保组件不丢失
@@ -236,6 +238,10 @@ public class Character : MonoBehaviour
         {
             attackDir.x = -attackDir.x;
         }
+        if (attackId == 1 && attack1ShootCanTransmit)
+        {
+            bullet.canTransmit = true;
+        }
         bullet.BeShoot(this, shootPos[shootId].position, attackDir, attackInfo.damage, attackInfo.force, attackInfo.changeHurt, attackInfo.repelValue, shootTrack, attackTarget ? attackTarget : null);
     }