[UnityCommunity]Продуманная стрельба + перезарядка + патроны и анимация со звуком RayCast
public int modes = 0; // переменная для определения режимов стрельбы public bool canShoot = true; // триггер public int currentMode; // текущий режим стрельбы public int bulletsToGo; // переменная необходимая для реализации режима стрельбы очередями с отсечкой по 3 выстрела
public void Awake()
public void Update ()
// index0 - стрельба одиночными // index1 - стрельба очередью с отсечкой по 3 выстрела // index2 - непрерывными очередями public void GunModes (bool index0, bool index1, bool index2)
// index0 - переменная для определения режимов стрельбы // index1 - режим стрельбы (0, 1, 2) public int BitOn (int index0, int index1)
public int BitRead (int modes, int B)
// index0 - режим стрельбы (0, 1, 2) public int ChangeGunMode (int index0)
// сопрограмма стрельбы public IEnumerator CoroutineShoot() >
// сопрограмма перезарядки public IEnumerator CoroutineReload()
>