Exemple #1
0
    void populateInfoPanel(ChoiceGlossary glossy)
    {
//    ChoiceInfo choice = glossy.options[idx].GetComponent<ChoiceMain>().choice;
        GameObject.Find("InfoHeader").GetComponent <Text> ().text      = choice.name;
        GameObject.Find("InfoDescription").GetComponent <Text> ().text = choice.openingGreeting;

        populateInfoButtons(choice.options);
    }
Exemple #2
0
    //At the start we need to pull out the player
    //and attach it to the panel gameobject
    void Start()
    {
        infoBtns = new GameObject[6];
        for (int i = 0; i < 6; i++)
        {
            infoBtns [i] = GameObject.Find("Button_0" + (i + 1).ToString());
        }
        infoPnl = GameObject.Find("InfoPanel");

        glossy = cGlossary.GetComponent <ChoiceGlossary> ();

        Debug.Log("Character: " + BaseSaver.getChoiceCharacter().ToString());

        bool callBack = BaseSaver.getPicked() > -1;

        idx = -1;

        if (BaseSaver.getChoiceQuest() != null)
        {
            Debug.Log("Quest Callback");
            choice = BaseSaver.getChoiceQuest();
        }
        else if (callBack)
        {
            Debug.Log("Character Callback");
            idx = BaseSaver.getCharIdx();
            Debug.Log("IDX: " + idx.ToString());
            choice = glossy.options [idx].GetComponent <ChoiceMain> ().choice;
        }
        else if (BaseSaver.getChoiceCharacter() != TileInfo.tileType.None)
        {
            Debug.Log("Tile Character Select");
            idx = getCharacterIdx(glossy.options, BaseSaver.getChoiceCharacter());
            Debug.Log("IDX: " + idx.ToString());
            choice = glossy.options [idx].GetComponent <ChoiceMain> ().choice;
        }
        else
        {
            Debug.Log("Error ChoicePanel");
        }

//    Debug.Log ("Populating: " + idx.ToString());

        populateInfoPanel(glossy);

        if (callBack)
        {
            Debug.Log("Picked: " + BaseSaver.getPicked().ToString());
            selectChoice(BaseSaver.getPicked(), idx, true);
        }

//    populateInfoPanel (glossy);
        if (idx > -1)
        {
            GameObject.Find("ForegroundImage").GetComponent <Image> ().sprite = glossy.options [idx].GetComponent <Image> ().sprite;
        }
        else
        {
            GameObject.Find("ForegroundImage").GetComponent <Image> ().sprite = QuestLogo;
        }
    }