void GeneratePlayer() { if (CP_GameManager.Instance.PlayerOfflineGO != null) { GameObject playerGO = Instantiate(CP_GameManager.Instance.PlayerOfflineGO); _player = playerGO.GetComponent <CP_PlayerController>(); if (_player != null) { _player.SetSceneManager(this); if (ProgressBar != null) { ProgressBar.AddPlayerToFollow(playerGO, _sceneMapLastChekpointIndex); } } } }
void Awake() { _playerController = transform.GetComponent <CP_PlayerController>(); }