private void OnTriggerEnter2D(Collider2D collision) { playerInfo = collision.GetComponent <PlayerInfo>(); if (playerInfo && playerInfo.GetPlayerType() == playerType) { activated = true; playerMovementController = collision.GetComponent <PlayerMovementController>(); gameRule.CheckControllers(); } }
void Awake() { playerMovementController = GetComponent <PlayerMovementController>(); animator = GetComponent <Animator>(); }