/// <summary>
        /// 按钮响应事件:移除卡槽中的符文
        /// </summary>
        public void OnRemoveInscripteFromSlot()
        {
            InscriptionSlotButton insbu = InscriptionSlotButton.currentButton.GetComponent <InscriptionSlotButton>();

            InscriptionSlotButton.currentButton.GetComponent <Image>().sprite = nullSprite;
            insbu.isInscription = false;
            switch (insbu.slotColor)
            {
            case InscriptionColor.BLUE:
                InscriptionPageUIController.Instance.inscriptionPage.blueInscription.Remove(insbu.slotId);
                break;

            case InscriptionColor.GREEN:
                InscriptionPageUIController.Instance.inscriptionPage.greenInscription.Remove(insbu.slotId);
                break;

            case InscriptionColor.RED:
                InscriptionPageUIController.Instance.inscriptionPage.redInscription.Remove(insbu.slotId);
                break;
            }
            insbu.inscriptionId = 0;

            ///===============================================
            //当移除符文是需要将移除后的数据提交给服务器
            //this.gameObject.SetActive(false);
            //InscriptionAttribueUIController.Instance.inscriptionPagePanel.SetActive(true);
            //InscriptionAttribueUIController.Instance.inscriptionPagePanel.SendMessage("OnReciveFromInscriptionPage", InscriptionPageUIController.Instance.inscriptionPage);
            this.gameObject.SetActive(false);
            InscriptionAttribueUIController.Instance.inscriptionSettingPanel.SetActive(true);
            InscriptionAttribueUIController.Instance.inscriptionSettingPanel.SendMessage("OnReceiveMessage");
        }
Exemplo n.º 2
0
        public void OnClickAddInscription()
        {
            InscriptionSlotButton insbu = InscriptionSlotButton.currentButton.GetComponent <InscriptionSlotButton>();

            if (insbu.isInscription)
            {
                switch (insbu.slotColor)
                {
                case InscriptionColor.BLUE:
                    InscriptionPageUIController.Instance.inscriptionPage.blueInscription.Remove(insbu.slotId);
                    break;

                case InscriptionColor.GREEN:
                    InscriptionPageUIController.Instance.inscriptionPage.greenInscription.Remove(insbu.slotId);
                    break;

                case InscriptionColor.RED:
                    InscriptionPageUIController.Instance.inscriptionPage.redInscription.Remove(insbu.slotId);
                    break;
                }
            }

            Inscription a = InscriptionFactory.Instance.GetInscriptionById(inscriptionId);

            insbu.GetComponent <Image>().enabled = true;

            insbu.GetComponent <Image>().sprite = a._inscriptionIcon;

            insbu.inscriptionId = inscriptionId;

            insbu.isInscription = true;
            switch (a._inscriptionColor)
            {
            case InscriptionColor.BLUE:
                InscriptionPageUIController.Instance.inscriptionPage.SetBlueInsciption(a, insbu.slotId);
                break;

            case InscriptionColor.GREEN:
                InscriptionPageUIController.Instance.inscriptionPage.SetGreenInscription(a, insbu.slotId);
                break;

            case InscriptionColor.RED:
                InscriptionPageUIController.Instance.inscriptionPage.SetRedInscription(a, insbu.slotId);
                break;
            }
            //测试
            InscriptionAttribueUIController.Instance.inscriptionSettingPanel.SetActive(false);
            InscriptionAttribueUIController.Instance.inscriptionPagePanel.SetActive(true);
            InscriptionAttribueUIController.Instance.inscriptionPagePanel.SendMessage("OnReciveFromInscriptionPage", InscriptionPageUIController.Instance.inscriptionPage);
        }