void Start() { playerConversant = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerConversant>(); playerConversant.onConversationUpdated += UpdateUI; UpdateUI(); }
public void SetPlayerConversant(GameObject obj) { if (obj != null || obj.GetComponent <PlayerConversant>() != null) { playerConversant = obj.GetComponent <PlayerConversant>(); try { playerConversant.OnConversationUpdated += UpdateUI; } catch { //We don't care about that } GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); for (int i = 0; i < players.Length; i++) { try { players[i].GetComponent <ElementalInteractionController>().ActivateInteraction(); } catch { //We don't care about that } } } }
private void Awake() { _playerConversant = FindObjectOfType <PlayerConversant>(); _playerConversant.onConversationUpdated += UpdateUI; nextButton.onClick.AddListener(_playerConversant.Next); quitButton.onClick.AddListener(_playerConversant.Quit); }
private void Start() { playerConversant = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerConversant>(); playerConversant.onConversationUpdated += UpdateUI; nextButton.onClick.AddListener(() => Next()); quitButton.onClick.AddListener(() => playerConversant.Quit()); UpdateUI(); }
void Start() { playerConversant = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerConversant>(); playerConversant.onConversationUpdated += UpdateUI; nextButton.onClick.AddListener(() => playerConversant.Next()); // Lambda function: playerConversant.Next() only called when its button is clicked. quitButton.onClick.AddListener(() => playerConversant.Quit()); UpdateUI(); }
private void Awake() { foreach (Transform item in choiceRoot) { choiceButtons.Add(item.GetComponent <Button>()); item.gameObject.SetActive(false); } // Hotkey list for choice buttons hotkeys = new List <string> { "Button0", "Button1", "Button2", "Button3", "Button4" }; playerConversant = GetComponent <PlayerConversant>(); playerConversant.onConversationStart += StartCoroutine; }
private void Start() { playerConversant = GameObject.FindWithTag("Player").GetComponent <PlayerConversant>(); playerConversant.onConversationUpdated += UpdateUI; if (nextButton) { nextButton.onClick.AddListener(playerConversant.Next); } if (quitButton) { quitButton.onClick.AddListener(playerConversant.QuitDialogue); } UpdateUI(); }
private void Awake() { uiWindow = GetComponent <RectTransform>(); foreach (Transform item in choiceRoot) { choiceButtons.Add(item.GetComponent <Button>()); item.gameObject.SetActive(false); } hotkeys = new List <string> { "Button0", "Button1", "Button2", "Button3", "Button4", "Button5", "Button6", "Button7", "Button8", "Button9" }; playerConversant = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerConversant>(); nextButton.onClick.AddListener(() => playerConversant.Next()); quitButton.onClick.AddListener(() => playerConversant.Quit()); playerConversant.onConversationUpdated += UpdateUI; }
public void Init(PlayerConversant player) { _player = player; _player.onConversationUpdated += UpdateUI; conversantName.text = _player.GetCurrentConversantName(); if (nextButton) { nextButton.onClick.AddListener(_player.Next); } if (quitButton) { quitButton.onClick.AddListener(Game.Instance.ReturnPlayerToStandingPosition); quitButton.onClick.AddListener(_player.QuitDialogue); } }
private void Awake() { playerAnimator = GetComponent <Animator>(); playerInputControls = new Player_Inputs(); playerConversant = GetComponent <PlayerConversant>(); }
// Start is called before the first frame update void Start() { playerConversant = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerConversant>(); AIText.text = playerConversant.GetText(); }
private void Awake() { playerConversant = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerConversant>(); }
private void Awake() { _playerConversant = FindObjectOfType <PlayerConversant>(); }