فهرست منبع

冰雨范围增加z轴

WGL 1 ماه پیش
والد
کامیت
85edcd21c1
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      ActionTowerDefense/Assets/Scripts/Conduct/IceRainController.cs

+ 2 - 1
ActionTowerDefense/Assets/Scripts/Conduct/IceRainController.cs

@@ -14,6 +14,7 @@ public class IceRainController : MonoBehaviour
     private int dir;
     public int damage;
     public Vector2 PosRangeX;
+    public float PosRangeZ;
     public bool start;
     public float time;
     public int num;
@@ -27,7 +28,7 @@ public class IceRainController : MonoBehaviour
             GameObject obj = PoolManager.Instantiate(sword);
             owner.attackController.curAttackMethod.attackInfo.damage = damage;
             owner.attackController.curAttackMethod.attackInfo.attackMethod_Type = AttackMethod_Type.Attack_Summon;
-            Vector3 targetPos = new Vector3(dir * Random.Range(PosRangeX.x,PosRangeX.y), height, 0);
+            Vector3 targetPos = new Vector3(dir * Random.Range(PosRangeX.x,PosRangeX.y), height, Random.Range(-PosRangeZ, PosRangeZ));
             targetPos = pos + targetPos;
             obj.GetComponent<Bullet>().BeShoot(owner, targetPos, Vector3.down, false);
             num++;