public Projectile SpawnProjectile(Projectile projectilePrefab, int x, int y, Direction direction) { if (projectilePrefab != null) { Projectile projectile = Instantiate(projectilePrefab); projectile.transform.parent = projectileHolderObject.transform; projectile.MovingDirection = direction; projectile.pos.Set(x, y); return(projectile); } Debug.Log("Null reference : Projectile prefab not found."); return(null); }
public Vector2i Neighbor(Direction dir) { return(this + DirectionHelper.ToVector2i(dir)); }