AwesomeRunner/Assets/Scripts/Player/WeaponController.cs
VladimirPirozhenko 45b277e7d1 Initial commit
2022-08-07 07:31:16 +03:00

23 lines
611 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//enum EWeaponState {iShooting,CanShoot,CannotShoot,Reloading}
public class WeaponController : MonoBehaviour
{
[SerializeField] List<Weapon> weapons;
[SerializeField] Transform weaponPoint;
private Weapon currentWeapon;
public bool canShoot { get; set;} //player
void Start()
{
currentWeapon = weapons[0];
currentWeapon.Equip(weaponPoint);
canShoot = true;
}
public void PerfomShoot()
{
if (canShoot)
StartCoroutine(currentWeapon.Shoot());
}
}