public void SetPlayerController(int playerID) { if (playerID == 1) { playerControlling = PlayerControlling.Player1; } else if (playerID == 2) { playerControlling = PlayerControlling.Player2; } else { playerControlling = PlayerControlling.None; SubmarineRigidbody.velocity = Vector2.zero; } }
// Start is called before the first frame update void Start() { parPlayer = GetComponentInParent <PlayerControlling>(); }
void Awake() { PlayerStatus = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerControlling>(); }