public void SetActivePlayer(string playerId) { if (_activeAvatarController != null) { _activeAvatarController.ActivePlayer = false; } _activeAvatarController = _pieces.FirstOrDefault(p => p.name == playerId).GetComponent<IAvatarController>(); _activeAvatarController.ActivePlayer = true; }
private void CreateRemotePlayerForLocalPlayer() { Debug.Log("Will create Remote Player for Local Player."); IAvatar avatar = _avatarService.GetMain(); if (_mainAvatarController == null) { _mainAvatarController = avatar.AvatarController; } _infra.CreateRemotePlayer(); _infra.RegisterMainAvatar(avatar.AvatarID); }
void IMultiplayerNetworkSystem.CreateRemotePlayerForLocalPlayer(NetworkArgs args) { Debug.Log("Will create Remote Player for Local Player."); IAvatar avatar = _avatarService.GetMain(); if (_mainAvatarController == null) { _mainAvatarController = avatar.AvatarController; } _infra.RegisterMainAvatar(avatar.AvatarID); _infra.CreateRemotePlayer(args); }
void IAvatar.SetAvatarController(IAvatarController controller) { _hasAvatarController = controller != null; _avatarController = controller; }
public AvatarControllerTests() { m_avatar = new Avatar("", 0, "Pingu", 0, Vector2.Zero, Vector2.One); m_avatarController = new AvatarController(m_avatar); }
public AvatarControllerTests() { m_avatar = new Avatar("", 0, "Pingu", 0, Vector2.Zero, Vector2.One); m_avatarController = new AvatarController(m_avatar); }
public void CreateGamePieces(string player1Id, string player2Id) { _pieces = new GameObject[2]; var cat = Instantiate(CatPrefab); cat.name = player1Id; _pieces[0] = cat; MovePlayerToTile(player1Id, 0, 0); _activeAvatarController = cat.GetComponent<IAvatarController>(); _activeAvatarController.ActivePlayer = true; var mouse = Instantiate(MousePrefab); mouse.name = player2Id; _pieces[1] = mouse; MovePlayerToTile(player2Id, NumberOfTilesX -1, NumberOfTilesY - 1); }