diff --git a/Assets/02_Scripts/WeaponController.cs b/Assets/02_Scripts/WeaponController.cs index 90e0a51..f5e8f6b 100644 --- a/Assets/02_Scripts/WeaponController.cs +++ b/Assets/02_Scripts/WeaponController.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using UnityEngine; using Unity.Cinemachine; using System; +using Random = UnityEngine.Random; [RequireComponent(typeof(AudioSource))] public class WeaponController : MonoBehaviour @@ -48,6 +49,14 @@ public class WeaponController : MonoBehaviour //MuzzleFlash 활성화 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... yield return new WaitForSeconds(0.2f);