private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.TryGetComponent(out Player player)) { CloseDoor(); BattleStarted?.Invoke(); _cameraFollow.ChangeCameraSize(_battleCameraSize); _spawner.gameObject.SetActive(true); } }
private void OnBattleStart(string[] data) { IsInBattle = true; Battle = new Battle(data, PlayerName); _movements.Clear(); _battleTimeout.Set(); BattleStarted?.Invoke(); string[] messages = Battle.Message.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); foreach (string message in messages) { if (!Battle.ProcessMessage(Team, message)) { BattleMessage?.Invoke(message); } } }