|
|
@@ -8,7 +8,10 @@ public class IceRainController : MonoBehaviour
|
|
|
public PlayerController owner;
|
|
|
public int swordsNum;
|
|
|
public float totalTime;
|
|
|
+ public float minInterval;
|
|
|
private float interval;
|
|
|
+ private Vector3 pos;
|
|
|
+ private int dir;
|
|
|
public int damage;
|
|
|
public Vector2 PosRangeX;
|
|
|
public bool start;
|
|
|
@@ -24,16 +27,8 @@ 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(Random.Range(PosRangeX.x,PosRangeX.y), 0, 0);
|
|
|
- if (owner.bodyTrans.localScale.x >= 0)
|
|
|
- {
|
|
|
- targetPos = owner.transform.position - targetPos;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- targetPos = owner.transform.position - targetPos;
|
|
|
- }
|
|
|
- targetPos.y = height;
|
|
|
+ Vector3 targetPos = new Vector3(dir * Random.Range(PosRangeX.x,PosRangeX.y), height, 0);
|
|
|
+ targetPos = pos + targetPos;
|
|
|
obj.GetComponent<Bullet>().BeShoot(owner, targetPos, Vector3.down, false);
|
|
|
num++;
|
|
|
time = interval;
|
|
|
@@ -48,7 +43,16 @@ public class IceRainController : MonoBehaviour
|
|
|
{
|
|
|
time = 0;
|
|
|
num = 0;
|
|
|
- interval = totalTime / swordsNum;
|
|
|
+ interval = totalTime/swordsNum;
|
|
|
+ pos = owner.transform.position;
|
|
|
+ if (owner.bodyTrans.localScale.x >= 0)
|
|
|
+ {
|
|
|
+ dir = -1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dir = 1;
|
|
|
+ }
|
|
|
start = true;
|
|
|
}
|
|
|
}
|