Exemplo n.º 1
0
    public Skill_Blue GetSkill_Blue(SpawnCode skillcode, GameObject _child)
    {
        if (!unlock.CheckCode(skillcode))
        {
            return(null);
        }

        Skill_Blue dump = _child.GetComponent <Skill_Blue>();

        if (dump != null)
        {
            Destroy(dump);
        }

        Skill_Blue tmp;

        switch (skillcode)
        {
        case SpawnCode.B001: tmp = _child.AddComponent <Skill_Blue_Barrier>(); break;

        case SpawnCode.B002: tmp = _child.AddComponent <Skill_Blue_Wall>(); break;

        case SpawnCode.B003: tmp = _child.AddComponent <Skill_Blue_Invisible>(); break;

        case SpawnCode.B004: tmp = _child.AddComponent <Skill_Blue_Shield>(); break;

        case SpawnCode.B005: tmp = _child.AddComponent <Skill_Blue_DefenceBuff>(); break;

        default: return(null);
        }

        //여기에 라우터로 장비 바꿨다는 포스트 날려야함
        return(tmp);
    }
Exemplo n.º 2
0
    //주석
    public void SkillUISetting()
    {
        //플레이어의 착용중인 장비 가져오기
        Skill_Red tmpr = ps.skill.GetComponent <Skill_Red>();

        SkillImage1.sprite = spriteSupplier.GetSource(tmpr.m_code);
        SkillText1.text    = tmpr.m_title;

        Skill_Green tmpb = ps.skill.GetComponent <Skill_Green>();

        SkillImage2.sprite = spriteSupplier.GetSource(tmpb.m_code);
        SkillText2.text    = tmpb.m_title;

        Skill_Blue tmpg = ps.skill.GetComponent <Skill_Blue>();

        SkillImage3.sprite = spriteSupplier.GetSource(tmpg.m_code);
        SkillText3.text    = tmpg.m_title;
    }
Exemplo n.º 3
0
    public void SkillSlotSetting()
    {
        if (skillType == 0) //Red
        {
            // for (int i = 0; i < list_red.Count; i++)
            //skillImageArray[i].sprite = list_red[i].m_spritePath;
            Skill_Red tmp = ps.skill.GetComponent <Skill_Red>();
            skillNameText.text        = tmp.m_title;
            cooldownText.text         = "쿨타임 : " + tmp.m_delay.ToString();
            SkillDescriptionText.text = tmp.m_description;

            useSkillImage.sprite = spriteSupplier.GetSource(list_red[0].m_code);

            for (int i = 0; i < list_red.Count; i++)
            {
                if (sc.GetIsUnlocked(list_red[i].m_code) == false)
                {
                    skillImageArray[i].transform.GetChild(0).gameObject.SetActive(false);
                    skillImageArray[i].GetComponent <Button>().interactable = false;

                    if (list_red[i].m_code != tmp.m_code)
                    {
                        skillImageArray[i].transform.GetChild(1).gameObject.SetActive(false);
                    }
                }
                skillImageArray[i].sprite = spriteSupplier.GetSource(list_red[i].m_code);
            }
        }

        else if (skillType == 1)//Green
        {
            //SkillList = RedSkillLIst
            //for(int i =0; i<skillImageArray.Length;i++)
            //skillImageArray[i].sprite = SkillList[i].Image;
            Skill_Green tmp = ps.skill.GetComponent <Skill_Green>();
            skillNameText.text        = tmp.m_title;
            cooldownText.text         = "쿨타임 : " + tmp.m_delay.ToString();
            SkillDescriptionText.text = tmp.m_description;

            useSkillImage.sprite = spriteSupplier.GetSource(list_green[0].m_code);

            for (int i = 0; i < list_green.Count; i++)
            {
                if (sc.GetIsUnlocked(list_green[i].m_code) == false)
                {
                    skillImageArray[i].transform.GetChild(0).gameObject.SetActive(false);
                    skillImageArray[i].GetComponent <Button>().interactable = false;
                }
                if (list_green[i].m_code != tmp.m_code)
                {
                    skillImageArray[i].transform.GetChild(1).gameObject.SetActive(false);
                }
                skillImageArray[i].sprite = spriteSupplier.GetSource(list_green[i].m_code);
            }
        }

        else
        {
            //SkillList = RedSkillLIst
            //for(int i =0; i<skillImageArray.Length;i++)
            //skillImageArray[i].sprite = SkillList[i].Image;

            Skill_Blue tmp = ps.skill.GetComponent <Skill_Blue>();
            skillNameText.text        = tmp.m_title;
            cooldownText.text         = "쿨타임 : " + tmp.m_delay.ToString();
            SkillDescriptionText.text = tmp.m_description;

            useSkillImage.sprite = spriteSupplier.GetSource(list_blue[0].m_code);

            for (int i = 0; i < list_blue.Count; i++)
            {
                if (sc.GetIsUnlocked(list_blue[i].m_code) == false)
                {
                    skillImageArray[i].transform.GetChild(0).gameObject.SetActive(false);
                    skillImageArray[i].GetComponent <Button>().interactable = false;
                }
                if (list_blue[i].m_code != tmp.m_code)
                {
                    skillImageArray[i].transform.GetChild(1).gameObject.SetActive(false);
                }
                skillImageArray[i].sprite = spriteSupplier.GetSource(list_blue[i].m_code);
            }
        }

        //for (int i = 0; i < skillList.Count; i++)
        //{
        //    if (skillList[i].unlock == false)   //해금시 이미지 안보이게
        //        skillImageArray[i].transform.GetChild(0).GetComponent<Image>().enabled = false;
        //    if(skillList[i].Use == false)       //비장착시 이미지 안보이게
        //        skillImageArray[i].transform.GetChild(1).GetComponent<Image>().enabled = false;
        //}
    }