Ejemplo n.º 1
0
 // i : the index in player's quest list
 private void OnSelectQuest(int i)
 {
     fuckRPGLib.GameCode.QuestCaption qc = PlayerData.GetInstance().questCaptions[i];
     texts[0].text      = qc.name;
     m_attempQuestScene = texts[1].text = qc.scene;
     texts[2].text      = qc.description;
 }
Ejemplo n.º 2
0
    private void UpdateAvalibleQuestList( )
    {
        // adjust the size of th grid
        AdjustQuestListUISize();
        // show the avalible quest list on the quest grid UI
        for (int i = 0; i < m_avaCount; i++)
        {
            GameObject questUI = PoolManager.GetInstance().GetPool(questListItemUIPrefab).GetObject();
            questUI.GetComponent <Image>().sprite        = GetQuestButtonSprite(m_avalibleQusets[i].isMain);
            questUI.GetComponentInChildren <Text>().text = m_avalibleQusets[i].name;
            questUI.transform.SetParent(questGridUI);
            questUI.transform.localScale = Vector3.one;

            // add a click event, by passing a index of avalible quest
            Button bt = questUI.GetComponent <Button>();
            bt.onClick.RemoveAllListeners();

            // a new int must be claimed used for the arg in the callback
            // we pass a value, not reference, to the listner
            fuckRPGLib.GameCode.QuestCaption questCaption = new fuckRPGLib.GameCode.QuestCaption(m_avalibleQusets[i].name, m_avalibleQusets[i].description, m_avalibleQusets[i].scene);
            int index = i;
            bt.onClick.AddListener(delegate()
            {
                this.OnSelectQuest(index, questCaption);
            });
            m_questUIs.Add(questUI);
        }
    }
Ejemplo n.º 3
0
 protected void OnSelectQuest(int index, fuckRPGLib.GameCode.QuestCaption questCaption)
 {
     // show the detail of a quest
     questDetailsUI.SetActive(true);
     questNameText.text        = questCaption.name;
     questDescriptionText.text = questCaption.description;
     m_attemptQuestClaim       = index;
     m_questClaimCaption       = questCaption;
 }
Ejemplo n.º 4
0
 protected void OnSelectQuest(int index, fuckRPGLib.GameCode.QuestCaption questCaption)
 {
     // show the detail of a quest
     questDetailsUI.SetActive(true);
     questNameText.text = questCaption.name;
     questDescriptionText.text = questCaption.description;
     m_attemptQuestClaim = index;
     m_questClaimCaption = questCaption;
 }
Ejemplo n.º 5
0
    private void UpdateAvalibleQuestList( )
    {
        // adjust the size of th grid
        AdjustQuestListUISize();
        // show the avalible quest list on the quest grid UI
        for (int i = 0; i < m_avaCount; i++)
        {
            GameObject questUI = PoolManager.GetInstance().GetPool(questListItemUIPrefab).GetObject();
            questUI.GetComponent<Image>().sprite = GetQuestButtonSprite(m_avalibleQusets[i].isMain);
            questUI.GetComponentInChildren<Text>().text = m_avalibleQusets[i].name;
            questUI.transform.SetParent(questGridUI);
            questUI.transform.localScale = Vector3.one;

            // add a click event, by passing a index of avalible quest
            Button bt = questUI.GetComponent<Button>();
            bt.onClick.RemoveAllListeners();

            // a new int must be claimed used for the arg in the callback
            // we pass a value, not reference, to the listner
            fuckRPGLib.GameCode.QuestCaption questCaption = new fuckRPGLib.GameCode.QuestCaption(m_avalibleQusets[i].name, m_avalibleQusets[i].description, m_avalibleQusets[i].scene);
            int index = i;
            bt.onClick.AddListener(delegate( )
            {
                this.OnSelectQuest(index, questCaption);
            });
            m_questUIs.Add(questUI);
        }
    }