using System.Collections; using System.Collections.Generic; using UnityEngine; namespace JamTools { public class Player : MonoBehaviour { [SerializeField] private GameObject m_Bullet; private FPSCharacterController m_Controller; private void Awake() { m_Controller = GetComponent(); } private void Start() { m_Controller.shootTarget = ShootTarget; m_Controller.checkHit = CheckHit; } bool CheckHit(RaycastHit hit) { return true; } void ShootTarget(Vector3 target, Transform muzzle) { GameObject go = GameObject.Instantiate(m_Bullet); go.transform.position = muzzle.position; go.GetComponent().velocity = (target - muzzle.position).normalized * 100; } } }