void TryFindDefaultPlayerTarget() { if (GlobalPlayerController.localInstance != null) { gpc = GlobalPlayerController.localInstance; rb = gpc.gameObject.GetComponent <Rigidbody>(); playerHealth = gpc.gameObject.GetComponent <PlayerHealth>(); grind = gpc.gameObject.GetComponent <GrindPlayerController>(); } }
// Start is called before the first frame update void Awake() { isGrounded = false; health = GetComponent<PlayerHealth>(); rb = GetComponent<Rigidbody>(); defaultPlayerController = GetComponent<DefaultPlayerController>(); wallPlayerController = GetComponent<WallPlayerController>(); grindPlayerController = GetComponent<GrindPlayerController>(); input = GetComponent<InputController>(); cc = GetComponent<CapsuleCollider>(); recentAction = RecentActionType.None; currentJumps = 0; currentDashes = 0; isResetCRRunning = false; angleOfNearestWall = 0f; }