示例#1
0
    public void save(int num)
    {
        GameManager.control.Save(num);
        UI_SaveCrystal.SetActive(false);
        PlayerControlsOverworld playerScript = player.GetComponent <PlayerControlsOverworld>();

        playerScript.interacting = false;
        playerScript.canMove     = true;
    }
    //interacting with objects/people
    public IEnumerator Interact()
    {
        UI_DialogueSystem = GameObject.Find("UI_DialogueSystem");
        UI_DialogueText   = GameObject.Find("UI_DialogueText");    //finding the UI_DialogueText gameObject
        UI_PortraitImage  = GameObject.Find("UI_PortraitImage");
        UI_PortraitImage.GetComponent <Image>().sprite = portrait; // setting the sprite to be the portrait
        myText = UI_DialogueText.GetComponent <Text>();            //references the text object in UI_DialogueText
        foreach (string myString in Dialogue)
        {
            myText.text = myString;
            yield return(StartCoroutine(WaitForKeyDown(KeyCode.Z)));
        }
        //yield return null;
        UI_DialogueSystem.SetActive(false);
        GameObject player = GameObject.FindGameObjectWithTag("Player");
        PlayerControlsOverworld playerScript = player.GetComponent <PlayerControlsOverworld>();

        playerScript.interacting = false;
        playerScript.canMove     = true;
    }