private void OnTriggerExit2D(Collider2D collision) { if (collision.gameObject.CompareTag("WinArea")) { SwitchMazeManager.GetInstance().PlayerLeftWinArea(); } }
// Start is called before the first frame update void Start() { animator = GetComponent <Animator>(); velocity = new Vector3(0, 0, 0); rb = GetComponent <Rigidbody2D>(); if (playernum == PersistentPlayer.localAuthority.playerNum) { localAuthority = true; Camera cam = SwitchMazeManager.GetInstance().cam; cam.transform.parent = gameObject.transform; cam.transform.localPosition = new Vector3(0, 0, -10f); DPad.Instance.Setup(this); } BattlePlayerBase player = players.Where(x => x.playerNum == playernum).First(); SetAnimator(player.characterType); }