示例#1
0
        void Start()
        {
            playerConversant = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerConversant>();
            playerConversant.onConversationUpdated += UpdateUI;

            UpdateUI();
        }
示例#2
0
        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
                    }
                }
            }
        }
示例#3
0
 private void Awake()
 {
     _playerConversant = FindObjectOfType <PlayerConversant>();
     _playerConversant.onConversationUpdated += UpdateUI;
     nextButton.onClick.AddListener(_playerConversant.Next);
     quitButton.onClick.AddListener(_playerConversant.Quit);
 }
示例#4
0
 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();
        }
示例#6
0
        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;
        }
示例#7
0
        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;
        }
示例#9
0
    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>();
 }
示例#11
0
 // 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>();
 }
示例#13
0
 private void Awake()
 {
     _playerConversant = FindObjectOfType <PlayerConversant>();
 }