Пример #1
0
    public void Init()
    {
        DataMng.AddTable(TableType.WeaponTable);
        DataMng.AddTable(TableType.ArmorTable);
        DataMng.AddTable(TableType.AccessoryTable);
        DataMng.AddTable(TableType.PortionTable);

        foreach (UIType t in Enum.GetValues(typeof(UIType)))
        {
            UIAdd.Load <Component>(t);
        }
        m_MakeBoss = FindObjectOfType <MonsterManager>();
    }
Пример #2
0
    public void Init(MakeBoss makeBoss, PlayerPos pos, GameObject box)
    {
        m_Player         = GameObject.FindGameObjectWithTag("Player");
        m_BossOpeningObj = Resources.Load("UI/BossOpening") as GameObject;

        //위치를 아예 이동시켰다.
        m_SandPos = new Vector3(-125.34f, 0, 15.92f);

        m_PlayerNav = m_Player.GetComponent <NavMeshAgent>();
        m_MakeBoss  = makeBoss;
        m_PlayerPos = pos;

        m_BoxObj        = box;
        m_UIPlayerState = FindObjectOfType <JoyStickBtn>().gameObject;
        m_JoystickObj   = FindObjectOfType <UIPlayerState>().gameObject;
    }
Пример #3
0
    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);
    }