Exemple #1
0
    //这个部位的衣服 相性不匹配
    public void InitNoLock(ItemSlotData slotData)
    {
        NoPropBg.SetActive(false);
        PropBg.SetActive(true);
        PropLock.SetActive(true);
        MagicObj.SetActive(false);
        UseObj.SetActive(false);

        PropStatus = 1;

        MSlotData = slotData;

        PropIcon.mainTexture = Resources.Load("Icon/ItemIcon/" + slotData.MItemData.BasicData.Icon, typeof(Texture2D)) as Texture2D;

        if (gPropInfo.GetPropInfoElementList().ContainsKey(MSlotData.MItemData.BasicData.ItemConfigElement.Item_Theme))
        {
            MPropInfo = gPropInfo.GetPropInfoElementList()[MSlotData.MItemData.BasicData.ItemConfigElement.Item_Theme];
        }

        UseMaxNum = 1;
    }
Exemple #2
0
 public void ShowPropInfo(ItemSlotData slotData, int isUse)
 {
     if (gPropInfo == null)
     {
         gPropInfo = Globals.Instance.MDataTableManager.GetConfig <GPropInfo> ();
     }
     if (gPropInfo.GetPropInfoElementList().ContainsKey(slotData.MItemData.BasicData.ItemConfigElement.Item_Theme))
     {
         GPropInfo.PropInfoElement info = gPropInfo.GetPropInfoElementList() [slotData.MItemData.BasicData.ItemConfigElement.Item_Theme];
         PropIcon.mainTexture = Resources.Load("Icon/ItemIcon/" + slotData.MItemData.BasicData.Icon, typeof(Texture2D)) as Texture2D;
         PropName.text        = slotData.MItemData.BasicData.Name;
         UseMagicNum.text     = info.MagicPoint.ToString();
         PropDec.text         = Globals.Instance.MDataTableManager.GetWordText(info.PropDesc);
         if (isUse == 0)
         {
             UseStatus.text = Globals.Instance.MDataTableManager.GetWordText("6022");
         }
         else if (isUse == 1)
         {
             UseStatus.text = Globals.Instance.MDataTableManager.GetWordText("6023");
         }
         else if (isUse == 2)
         {
             UseStatus.text = Globals.Instance.MDataTableManager.GetWordText("6011");
         }
         else if (isUse == 3)
         {
             UseStatus.text = Globals.Instance.MDataTableManager.GetWordText("6024");
         }
         this.gameObject.SetActive(true);
     }
     else
     {
         this.gameObject.SetActive(false);
     }
 }
Exemple #3
0
    void Awake()
    {
        gPropInfo = Globals.Instance.MDataTableManager.GetConfig <GPropInfo> ();


        UIEventListener.Get(UsePropBtn.gameObject).onClick += delegate(GameObject go) {
            if (EliminationMgr.Instance.GameStatus != GameStatusEnum.Playing)
            {
                if (MSlotData != null)
                {
                    MPropInfoDec.ShowPropInfo(MSlotData, PropStatus);
                    if (this.transform.localPosition.x > 0)
                    {
                        MPropInfoDec.transform.localPosition = new Vector3(this.transform.localPosition.x - 30f, MPropInfoDec.transform.localPosition.y, MPropInfoDec.transform.localPosition.z);
                    }
                    else
                    {
                        MPropInfoDec.transform.localPosition = new Vector3(this.transform.localPosition.x + 30f, MPropInfoDec.transform.localPosition.y, MPropInfoDec.transform.localPosition.z);
                    }
                }
                return;
            }

            if (PropStatus == 1)
            {
                Globals.Instance.MGUIManager.ShowSimpleCenterTips(6009);
                return;
            }
            else if (PropStatus == 2)
            {
                Globals.Instance.MGUIManager.ShowSimpleCenterTips(6011);
                return;
            }
            else if (PropStatus == 3)
            {
                Globals.Instance.MGUIManager.ShowSimpleCenterTips(6024);
                return;
            }
            if (MSlotData != null)
            {
                if (gPropInfo.GetPropInfoElementList().ContainsKey(MSlotData.MItemData.BasicData.ItemConfigElement.Item_Theme))
                {
                    GPropInfo.PropInfoElement info = gPropInfo.GetPropInfoElementList()[MSlotData.MItemData.BasicData.ItemConfigElement.Item_Theme];
                    if (UseMaxNum <= 0)
                    {
                        Globals.Instance.MGUIManager.ShowSimpleCenterTips(6008);
                        return;
                    }
                    if (EliminationMgr.Instance.MagicPower >= info.MagicPoint)
                    {
//					info = gPropInfo.GetPropInfoElementList()[12300501];
                        UsePropTipsObj.ShowPropInfo(MSlotData.MItemData.BasicData.Name, info.PropDesc, delegate() {
                            EliminationMgr.Instance.UsePropMethod(info, PropIcon);
                            UseMaxNum -= 1;
                            if (UseMaxNum <= 0)
                            {
                                UseObj.SetActive(true);
                            }
                        });
                    }
                    else
                    {
                        Globals.Instance.MGUIManager.ShowSimpleCenterTips(6010);
                    }
                }
            }
        };
    }