コード例 #1
0
ファイル: HelpScene.cs プロジェクト: maestun/wonderboy
        private HelpPageComponent CreatePageComponent(int yPosition, string title, string paragraph, EquipItemType type)
        {
            Point textureCell = new Point(0, 0);
            switch (type)
            {
                case EquipItemType.Arm:
                    textureCell = new Point(1, 0);
                    break;

                case EquipItemType.Shield:
                    textureCell = new Point(2, 0);
                    break;

                case EquipItemType.Armor:
                    textureCell = new Point(3, 0);
                    break;
            }
            return this.CreatePageComponent(yPosition, title, paragraph, ObjectType.ItemPickup, AnimType.Stopped, textureCell);
        }
コード例 #2
0
    //오브젝트에 붙어있는 아이템 정보 가져오기
    void Chk_getItemInfo(Dictionary <uint, GameObject> dicObj, EquipItemType type)
    {
        Transform[] trLst = null;
        Dictionary <uint, Infos_Weapon> dic_infosweapon = null;
        Dictionary <uint, Infos_Deco>   dic_infosDeco   = null;

        if (type == EquipItemType.FACE)
        {
            trLst = Tr_Items[(int)EquipItemType.Head].GetComponentsInChildren <Transform>();
        }
        else
        {
            trLst = Tr_Items[(int)type].GetComponentsInChildren <Transform>();
        }


        //우선 아이템 다 false
        for (int i = 0; i < trLst.Length; i++)
        {
            if (type == EquipItemType.Head)
            {
                break;                                         // face 부분에서 확인후 setAtvie(false) 할테니 나가자
            }
            if (i == 0)
            {
                continue;
            }

            if (trLst[i].name.Contains("Item_") || trLst[i].name.Contains("Weapon_"))
            {
                trLst[i].gameObject.SetActive(false);
            }
        }

        if (type == EquipItemType.Head)
        {
            dic_infosDeco = TableDataManager.instance.Infos_Decos;
            foreach (var deco in dic_infosDeco)
            {
                for (int i = 0; i < trLst.Length; i++)
                {
                    if (i == 0)
                    {
                        continue;
                    }

                    if (string.Equals(trLst[i].name, "Item_" + deco.Value.DecoIdx))
                    {
                        if (deco.Value.DecoPart == DECOPART_TYPE.HEAD)
                        {
                            trLst[i].gameObject.SetActive(false);
                            dicObj[deco.Value.DecoIdx] = trLst[i].gameObject;
                        }
                    }
                }
            }
        }
        else if (type == EquipItemType.FACE)
        {
            dic_infosDeco = TableDataManager.instance.Infos_Decos;
            foreach (var deco in dic_infosDeco)
            {
                for (int i = 0; i < trLst.Length; i++)
                {
                    if (i == 0)
                    {
                        continue;
                    }

                    if (string.Equals(trLst[i].name, "Item_" + deco.Value.DecoIdx))
                    {
                        if (deco.Value.DecoPart == DECOPART_TYPE.FACE)
                        {
                            trLst[i].gameObject.SetActive(false);
                            dicObj[deco.Value.DecoIdx] = trLst[i].gameObject;
                        }
                    }
                }
            }
        }
        else if (type == EquipItemType.Body)
        {
            dic_infosDeco = TableDataManager.instance.Infos_Decos;
            foreach (var deco in dic_infosDeco)
            {
                for (int i = 0; i < trLst.Length; i++)
                {
                    if (i == 0)
                    {
                        continue;
                    }

                    if (string.Equals(trLst[i].name, "Item_" + deco.Value.DecoIdx))
                    {
                        trLst[i].gameObject.SetActive(false);
                        dicObj[deco.Value.DecoIdx] = trLst[i].gameObject;
                    }
                }
            }
        }
        else if (type == EquipItemType.RWeapon)
        {
            dic_infosweapon = TableDataManager.instance.Infos_weapons;
            foreach (var wpn in dic_infosweapon)
            {
                for (int i = 0; i < trLst.Length; i++)
                {
                    if (i == 0)
                    {
                        continue;
                    }


                    if (string.Equals(trLst[i].name, "Weapon_" + wpn.Value.WpnIdx))
                    {
                        trLst[i].gameObject.SetActive(false);
                        dicObj[wpn.Value.WpnIdx] = trLst[i].gameObject;
                    }
                }
            }
        }
        else if (type == EquipItemType.LWeapon)
        {
            dic_infosweapon = TableDataManager.instance.Infos_weapons;
            foreach (var wpn in dic_infosweapon)
            {
                for (int i = 0; i < trLst.Length; i++)
                {
                    if (i == 0)
                    {
                        continue;
                    }


                    if (string.Equals(trLst[i].name, "Weapon_" + wpn.Value.WpnIdx + "_1"))
                    {
                        trLst[i].gameObject.SetActive(false);
                        dicObj[wpn.Value.WpnIdx] = trLst[i].gameObject;
                    }
                }
            }
        }
        else if (type == EquipItemType.Over)
        {
            Dictionary <uint, infos_unit> dicInfoUnit = TableDataManager.instance.Infos_units;
            for (int i = 0; i < trLst.Length; i++)
            {
                if (i == 0)
                {
                    continue;
                }

                foreach (var infoUnit in dicInfoUnit)
                {
                    for (int h = 0; h < OVER_OBJ_MAX; h++)
                    {
                        if (string.Equals(trLst[i].name, string.Format("ch_{0}_OverOJ_{1}", infoUnit.Value.UnitIdx, h)))
                        {
                            //dic에 담기
                            dicObj[infoUnit.Value.UnitIdx] = trLst[i].gameObject;
                        }
                    }
                }
                //비활성 해놓기
                trLst[i].gameObject.SetActive(false);
            }
        }
    }
コード例 #3
0
ファイル: EquipableItem.cs プロジェクト: maestun/wonderboy
 public EquipableItem(string p_name, int p_strength, EquipItemType p_type, ObjectType p_bonusTransform, int p_bonusStrength)
 {
     this.Init(p_name, p_strength, p_type, p_bonusTransform, p_bonusStrength);
 }
コード例 #4
0
ファイル: EquipableItem.cs プロジェクト: maestun/wonderboy
 public EquipableItem(string p_name, int p_strength, EquipItemType p_type)
 {
     this.Init(p_name, p_strength, p_type, ObjectType.Nothing, 0);
 }
コード例 #5
0
ファイル: EquipableItem.cs プロジェクト: maestun/wonderboy
        private void Init(string p_name, int p_strength, EquipItemType p_type, ObjectType p_bonusTransform, int p_bonusStrength)
        {
            this.bonusTransform = p_bonusTransform;
            this.bonusStrength = p_bonusStrength;
            this.name = p_name;
            this.strength = p_strength;
            this.type = p_type;
            this.State = EquipItemState.NotFound;
            switch (this.type)
            {
                case EquipItemType.Arm:
                    this.iconPoint = new Point(1, 0);
                    return;

                case EquipItemType.Shield:
                    this.iconPoint = new Point(2, 0);
                    return;

                case EquipItemType.Armor:
                    this.iconPoint = new Point(3, 0);
                    return;
            }
        }
コード例 #6
0
ファイル: GameData.cs プロジェクト: maestun/wonderboy
        public EquipableItem GetItemByIndex(EquipItemType type, int index)
        {
            switch (type)
            {
                case EquipItemType.Arm:
                    return this.arms[index];

                case EquipItemType.Shield:
                    return this.shields[index];

                case EquipItemType.Armor:
                    return this.armor[index];
            }
            return null;
        }