This commit is contained in:
LeeJaeHyun 2024-09-12 15:31:20 +09:00
parent 79f60a877e
commit ae349648ae

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using Unity.Cinemachine; using Unity.Cinemachine;
using System; using System;
using Random = UnityEngine.Random;
[RequireComponent(typeof(AudioSource))] [RequireComponent(typeof(AudioSource))]
public class WeaponController : MonoBehaviour public class WeaponController : MonoBehaviour
@ -48,6 +49,14 @@ public class WeaponController : MonoBehaviour
//MuzzleFlash 활성화 //MuzzleFlash 활성화
muzzleFlash.enabled = true; muzzleFlash.enabled = true;
// 텍스처의 Offset 값을 추출 (0, 0), (0.5, 0), (0.5, 0.5), (0, 0.5) => 0, 0.5
// 난수 발생
/*
Random.Range(0, 10) : 0, 1, 2, ..., 9
Random.Range(0.0f, 10.0f) : 0.0f ~ 10.0f
*/
Vector2 offset = new Vector2(Random.Range(0, 2), Random.Range(0, 2))
// Waiting... // Waiting...
yield return new WaitForSeconds(0.2f); yield return new WaitForSeconds(0.2f);