private void SetPositionsAndEnter() { SetCameraRotation(); if (PlayTableKeyboard.Instance.CurrentState == KeyboardState.Closed) { PlayTableKeyboard.Instance.Open(_keyboardPosition); } else { NamesWindow.List.Open(); } RepositionPlayerInfo(); PlayerInformations.Open(_namesToAdd[_actualNameIndexToAdd].PlayerAlias, _namesToAdd[_actualNameIndexToAdd].PlayerImage); if (NamesList.ListEmpty) { PlayAudio(PYAudioTags.Voice_ptBR_EscrevaONomeQueDeseja, null, 0.35f); } else { PlayAudio(PYAudioTags.Voice_ptBR_SelecioneNaListaOu, null, 0.35f); } NamesWindow.OpenVertical(); ClassWindow.OpenVertical(); }
private void BaseOpen() { // Reposição do teclado e chamada para entrada DEVE sempre vir antes da reposição de itens, uma vez que o teclado utiliza de dados da camera para se posicinar. RepositionKeyboard(); PlayTableKeyboard.Instance.Open(_keyboardPosition); SetCameraRotation(); RepositionPlayerInfo(); // Quando estamos registrando apenas um único user não precisamos mostrar o PlayerInformations if (_isRegisteringSingleUser) { PlayerInformations.gameObject.SetActive(false); } else { PlayerInformations.Open(_namesToAdd[_actualNameIndexToAdd].PlayerAlias, _namesToAdd[_actualNameIndexToAdd].PlayerImage); } NamesWindow.OpenHorizontal(); for (int i = 0; i < _filterNames.Count; i++) // Adicionar ao filtro de nomes os nomes que já foram registrados na sequencia { if (_filterNames[i] != null) { NamesWindow.List.AddFilter(_filterNames[i]); } } ClassWindow.OpenHorizontal(); //if (SoundControlButton.Instance != null) // SoundControlButton.Instance.TurnDiscrete(); Opened(); }
public override void OnInspectorGUI() { PlayerInformations player = (PlayerInformations)target; EditorGUILayout.LabelField("Name", player.name); gender = player.male ? "Male" : "Female"; EditorGUILayout.LabelField("Gender", gender); player.stamina = EditorGUILayout.Slider("Stamina", player.stamina, 1, 10); player.speed = EditorGUILayout.Slider("Speed", player.speed, 1, 10); }
void Create() { GameObject player = new GameObject(); player.name = name; player.AddComponent <CanvasRenderer> (); player.AddComponent <Image> (); player.AddComponent <PlayerInformations> (); PlayerInformations constructor = player.GetComponent <PlayerInformations> (); constructor.name = name; constructor.stamina = stamina; constructor.speed = speed; constructor.male = male; }
public override GameObject OnLobbyServerCreateLobbyPlayer(NetworkConnection conn, short playerControllerId) { GameObject obj = base.OnLobbyServerCreateLobbyPlayer(conn, playerControllerId); PlayerInformations player = obj.GetComponent <PlayerInformations>(); if (Scientist == null) { player.SetType(PlayerInformations.PlayerType.SCIENTIST); Scientist = obj; } else if (Robot == null) { player.SetType(PlayerInformations.PlayerType.ROBOT); Robot = obj; } return(obj); }
public override void Close() { if (_actualNameIndexToAdd < _namesToAdd.Length) // No caso de clicar em cancelar do teclado e ainda estiver nome para registrar { AddName(string.Empty); return; } PlayTableKeyboard.Instance.Close(); PlayTableKeyboard.Instance.onConfirm.RemoveAllListeners(); PlayTableKeyboard.Instance.onCancel.RemoveAllListeners(); PlayTableKeyboard.Instance.OnTextChange -= OnKeyboardTextChange; PlayerInformations.Close(); NamesWindow.CloseHorizontal(); ClassWindow.CloseHorizontal(); Invoke("BaseClose", 1.3f); }
private void RepositionPlayerInfo() { switch (_actualPosition) { case KeyboardPositions.DownLeft: PlayerInformations.SetQuadrant(new Vector3(Mathf.Abs(PlayerInformations.transform.position.x) * -1, PlayerInformations.transform.position.y, PlayerInformations.transform.position.z)); break; case KeyboardPositions.DownRight: PlayerInformations.SetQuadrant(new Vector3(Mathf.Abs(PlayerInformations.transform.position.x), PlayerInformations.transform.position.y, PlayerInformations.transform.position.z)); break; case KeyboardPositions.UpperRight: PlayerInformations.SetQuadrant(new Vector3(Mathf.Abs(PlayerInformations.transform.position.x) * -1, PlayerInformations.transform.position.y, PlayerInformations.transform.position.z)); break; case KeyboardPositions.UpperLeft: PlayerInformations.SetQuadrant(new Vector3(Mathf.Abs(PlayerInformations.transform.position.x), PlayerInformations.transform.position.y, PlayerInformations.transform.position.z)); break; default: break; } }
private void NextName() { PlayerInformations.Close(); _actualPosition = _namesToAdd[_actualNameIndexToAdd].Position; KeyboardPositions previousPosition = _namesToAdd[_actualNameIndexToAdd - 1].Position; RepositionKeyboard(); if (KeyboardChangedOrientation(previousPosition)) { NamesWindow.CloseVertical(); ClassWindow.CloseVertical(); PlayTableKeyboard.Instance.Close(); } else { PlayTableKeyboard.Instance.Open(_keyboardPosition); } ClassWindow.ClearLabel(); Invoke("SetPositionsAndEnter", 1.5f); }
public override void OnLobbyServerSceneLoadedForPlayer(NetworkManager manager, GameObject lobbyPlayer, GameObject gamePlayer) { PlayerInformations infos = lobbyPlayer.GetComponent <PlayerInformations>(); gamePlayer.GetComponent <PlayerInformations>().SetType(infos.Type); }
// ------------------------------------------------------ private void Awake() { if (informationsToSave == null) informationsToSave = new PlayerInformations(); // Carregar as informações do player LoadFileWithPlayerInformations(); // Carregar as informações de todas as skills LoadAllSkillsFileInformations(); // Preencher HUD com as skills do arquivo PopulateListWithAllSkills(); // Colocar a xp no script de Game Controller LoadPlayerInformations(listPlayerInformations); textPlayerCurrentXP.text = informationsToSave.xp + " XP"; Player player = GameObject.FindWithTag("Player").GetComponent<Player>(); //Debug.Log("Skill ativa: " + informationsToSave.activeSkill); player.hability = informationsToSave.activeSkill; }
private void Start() { m_informations = GetComponent <PlayerInformations>(); }