Added: unity project for SOLID
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using Solid.Interfaces;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Solid.Shooters
|
||||
{
|
||||
public class BulletShooter : MonoBehaviour, IShooter
|
||||
{
|
||||
[SerializeField] private Transform shootSpawn;
|
||||
[SerializeField] private Rigidbody projectilePrefab;
|
||||
[SerializeField] private float shootForce = 10.0f;
|
||||
|
||||
public void Fire()
|
||||
{
|
||||
Rigidbody projectile = Instantiate(projectilePrefab, shootSpawn.position, shootSpawn.rotation);
|
||||
projectile.AddForce(shootSpawn.forward * shootForce, ForceMode.Impulse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7ba1ecc1f5474dd6baa9d5ac02e15744
|
||||
timeCreated: 1790266576
|
||||
Reference in New Issue
Block a user