コード例 #1
0
        private void CreatePlayer(User user)
        {
            _initialPlayerPos = user.Character.Position.Value;
            var view = Instantiate(_playerPrefab, _initialPlayerPos, user.Character.Rotation, transform);

            view.gameObject.SetActive(true);

            var player = new PlayerFacade(user, view, _moveProjectiles, _spawnProjectiles);

            _activePlayers.Add(user.Id, player);
            SubscribeToAllPlayers(player);
            if (user.IsLocalUser)
            {
                _cameraToFolow.Follow             = view.Animator.transform;
                _cameraToFolow.LookAt             = view.Animator.transform;
                CurrentPlayer                     = player;
                CurrentPlayer.View.gameObject.tag = _settings.ArenaSettings.LocalPlayerTag;
                SubscribeToMainPlayer(player);
            }
            else
            {
                view.Rigidbody.isKinematic = true;
            }
        }