private void OnTriggerEnter(Collider other) { if (other.GetComponent <CS_Logic_Checkpoint>()) { _CheckPoint = other.GetComponent <CS_Logic_Checkpoint>(); } }
// Use this for initialization void Start() { _player = GameObject.Instantiate(_playerPrefab, transform.position, Quaternion.identity); _checkpoint = gameObject.GetComponent <CS_Logic_Checkpoint>(); _player.GetComponent <CS_PlayerLife>()._CheckPoint = _checkpoint; }