|
|
@@ -384,13 +384,22 @@ public class Enemy : MoveCharacter
|
|
|
|
|
|
public void DropSouls()
|
|
|
{
|
|
|
- for (int i = 0; i < dropSoul; i++)
|
|
|
+ if (dropSoul > 1)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < dropSoul; i++)
|
|
|
+ {
|
|
|
+ float angleInterval = dropSoulAngle / (float)(dropSoul - 1);
|
|
|
+ float angle = 90 + ((float)i - (float)(dropSoul - 1) / 2) * angleInterval;
|
|
|
+ angle = angle / 180 * Mathf.PI;
|
|
|
+ GameObject soulObj = PoolManager.Instantiate(soulPrefab, transform.position);
|
|
|
+ Vector3 dir = new Vector3(Mathf.Cos(angle), Mathf.Sin(angle), 0);
|
|
|
+ soulObj.GetComponent<Soul>().Burst(dir * soulStartSpeed);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- float angleInterval = dropSoulAngle / (float)(dropSoul - 1);
|
|
|
- float angle = 90 + ((float)i - (float)(dropSoul - 1) / 2) * angleInterval;
|
|
|
- angle = angle / 180 * Mathf.PI;
|
|
|
GameObject soulObj = PoolManager.Instantiate(soulPrefab, transform.position);
|
|
|
- Vector3 dir = new Vector3(Mathf.Cos(angle), Mathf.Sin(angle), 0);
|
|
|
+ Vector3 dir = Vector3.up;
|
|
|
soulObj.GetComponent<Soul>().Burst(dir * soulStartSpeed);
|
|
|
}
|
|
|
}
|