Add new meta files and interfaces for project structure
This commit is contained in:
19
Assets/Scripts/Weapons/AutoWeapon.cs
Normal file
19
Assets/Scripts/Weapons/AutoWeapon.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Interfaces;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Weapons
|
||||
{
|
||||
public class AutoWeapon : Weapon, IWeapon
|
||||
{
|
||||
[SerializeField] private GameObject projectilePrefab;
|
||||
[SerializeField] private Transform firePoint;
|
||||
|
||||
public override void Fire()
|
||||
{
|
||||
var projectile = Instantiate(projectilePrefab, firePoint.position, firePoint.rotation);
|
||||
projectile.TryGetComponent<IDamageInflectorSetup>(out var inflector);
|
||||
|
||||
inflector?.Setup(character);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user