コード例 #1
0
    public void Init(QuestMenu questMenu, int key, out GetQuset getQuset)
    {
        m_QuestMenu         = questMenu;
        m_DicQuestInterface = questMenu.m_DicQuestInterface;
        getQuset            = this;

        QuestTxt.text = questMenu.m_QuestTxt.text;
        GoalTxt.text  = questMenu.m_nCount.ToString();
        CountTxt.text = m_nCount.ToString();
        m_nGoal       = questMenu.m_nCount;


        m_nkey = key;

        m_DicSaveQuest   = questMenu.m_DicSaveQuest;
        m_CancleQuestObj = questMenu.m_CancleQuestObj;

        m_Color = new Color(0.0f, 1.0f, 0.0f);

        m_nMoney    = questMenu.m_nMoney;
        m_RewardObj = questMenu.m_RewardObj;

        m_Inventory = questMenu.m_Iventory;
        m_Buymenu   = questMenu.m_BuyMenu;
    }
コード例 #2
0
ファイル: UIOutput.cs プロジェクト: fan950/Unity3D-RPG
    public void Init(out GetQuset getQuset, MakeBoss makeBoss, PlayerAbility playerAbility)
    {
        DamageObj = Resources.Load("UI/Box/DamegeTxt") as GameObject;
        NameObj   = Resources.Load("UI/Box/NameTxt") as GameObject;
        HpObj     = Resources.Load("UI/Box/HpImg") as GameObject;

        m_LisLoadNPC.Add(Resources.Load("UI/NPC/Buy_NPC") as GameObject);
        m_LisLoadNPC.Add(Resources.Load("UI/NPC/Quest_NPC") as GameObject);
        m_LisLoadNPC.Add(Resources.Load("UI/NPC/Portion_NPC") as GameObject);
        m_LisLoadNPC.Add(Resources.Load("UI/NPC/Boss_NPC") as GameObject);
        m_LisLoadNPC.Add(Resources.Load("UI/NPC/Clear_NPC") as GameObject);

        //데미지 부분 미리 10개 생성
        for (int i = 0; i < 10; ++i)
        {
            GameObject damageObj = Instantiate(DamageObj);

            DamageTxt damageTxt = damageObj.GetComponent <DamageTxt>();
            damageObj.transform.SetParent(DamageBox);

            m_LisDamageTxt.Add(damageObj);
            m_DicDamageTxt.Add(m_LisDamageTxt[i], damageTxt);

            damageTxt.Init();
            damageObj.SetActive(false);
        }

        for (int i = 0; i < 5; ++i)
        {
            GameObject hpObj = Instantiate(HpObj, HpBox.transform);
            Image      hpimg = hpObj.GetComponent <Image>();
            m_LisHpImg.Add(hpObj);
            m_DicHpImg.Add(i, hpimg);
            hpObj.SetActive(false);

            GameObject nameObj = Instantiate(NameObj, NameBox.transform);
            Text       nameTxt = nameObj.GetComponent <Text>();
            m_LisNameTxt.Add(nameObj);
            m_DicNameTxt.Add(i, nameTxt);
            nameObj.SetActive(false);

            ++m_nAddCount;
        }

        m_DicIndexObj.Add(m_BuyMenu.gameObject, 0);
        m_DicIndexObj.Add(m_QuestMenu.gameObject, 1);
        m_DicIndexObj.Add(m_PortionMenu.gameObject, 2);
        m_DicIndexObj.Add(m_BossClearAsk.gameObject, 3);

        m_DicIndex.Add(0, m_BuyMenu.gameObject);
        m_DicIndex.Add(1, m_QuestMenu.gameObject);
        m_DicIndex.Add(2, m_PortionMenu.gameObject);
        m_DicIndex.Add(3, m_GateAsk.gameObject);
        m_DicIndex.Add(4, m_BossClearAsk.gameObject);

        Object[] weaponbtnObj = null;
        Object[] defenseObj   = Resources.LoadAll("UI/EquipmentBtn/Armor");
        Object[] portionObj   = Resources.LoadAll("UI/EquipmentBtn/Portion");

        switch (playerAbility.m_nIndex)
        {
        case 1:
            weaponbtnObj = Resources.LoadAll("UI/EquipmentBtn/Weapon/TowHandSword");
            break;

        case 2:
            weaponbtnObj = Resources.LoadAll("UI/EquipmentBtn/Weapon/Magician");
            break;
        }

        for (int i = 0; i < weaponbtnObj.Length; ++i)
        {
            m_LisWeaponBtnObj.Add(weaponbtnObj[i] as GameObject);
        }
        for (int i = 0; i < defenseObj.Length; ++i)
        {
            m_LisDefenseBtnObj.Add(defenseObj[i] as GameObject);
        }
        for (int i = 0; i < portionObj.Length; ++i)
        {
            m_LisPortionBtnObj.Add(portionObj[i] as GameObject);
        }
        m_BuyMenu.Init(m_LisWeaponBtnObj, m_LisDefenseBtnObj, playerAbility);
        m_QuestMenu.Init(out getQuset);
        m_PortionMenu.Init(m_LisPortionBtnObj);

        PlayerPos _playerPos = m_BossClearAsk.Init();

        m_GateAsk.Init(makeBoss, _playerPos, QuestBox.gameObject);
    }
コード例 #3
0
 public void Init(out GetQuset m_GetQuest)
 {
     DataMng.AddTable(TableType.QuestTable);
     m_QuestBar = Resources.Load("UI/Box/QuestBar") as GameObject;
     m_GetQuest = this;
 }