Update
This commit is contained in:
@@ -302,6 +302,15 @@ namespace Invector.vShooter
|
||||
var rotation = Quaternion.LookRotation(dir);
|
||||
GameObject bulletObject = null;
|
||||
var velocityChanged = 0f;
|
||||
|
||||
if (projectile == null)
|
||||
{
|
||||
Debug.LogError($"<color=red>WEAPON ERROR:</color> No Projectile Prefab assigned to {gameObject.name}!");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"<color=white>WEAPON SHOOT:</color> Spawning projectile. HitLayer: {hitLayer.value}");
|
||||
|
||||
if (dispersion > 0 && projectile)
|
||||
{
|
||||
for (int i = 0; i < projectilesPerShot; i++)
|
||||
@@ -311,6 +320,12 @@ namespace Invector.vShooter
|
||||
bulletObject = Instantiate(projectile, startPoint, spreadRotation);
|
||||
|
||||
var pCtrl = bulletObject.GetComponent<vProjectileControl>();
|
||||
if (pCtrl == null)
|
||||
{
|
||||
Debug.LogError($"<color=red>PROJECTILE ERROR:</color> {projectile.name} does not have vProjectileControl script!");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pCtrl.debugTrajetory && i == 0)
|
||||
{
|
||||
startPoint.DebugPoint(Color.red, 10, 0.1f);
|
||||
@@ -338,6 +353,13 @@ namespace Invector.vShooter
|
||||
{
|
||||
bulletObject = Instantiate(projectile, startPoint, rotation);
|
||||
var pCtrl = bulletObject.GetComponent<vProjectileControl>();
|
||||
|
||||
if (pCtrl == null)
|
||||
{
|
||||
Debug.LogError($"<color=red>PROJECTILE ERROR:</color> {projectile.name} does not have vProjectileControl script!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (pCtrl.debugTrajetory)
|
||||
{
|
||||
startPoint.DebugPoint(Color.red, 10, 0.1f);
|
||||
|
||||
Reference in New Issue
Block a user