Ejemplo n.º 1
0
    private async void OnDragOutFromUp(PointerEventData eventData)
    {
        //更新庄园装扮红点
        ManorRedDotTool.isOpenManorDecorateRedDot = false;
        RedDotManager.UpdateRedDot(RedDotManager.RedDotKey.ManorDecorate);
        //默认装饰物是第一个下标0的模型
        var goDecorate = await Root2dSceneManager._instance.GenerateDecorate(NameModel, currDecorateDefine.DecorateId);

        goDecorate.GetComponent <TileComponent>().Init(goRootTab, currDecorateDefine.DecorateType);
        //设置回去,下次打开的时候看到已经复位
        uiPanelDrag.OnEndDrag(eventData);
        goRootTab.SetActive(false);
    }
Ejemplo n.º 2
0
    private void OnDragOutFromPanel(PointerEventData eventData)
    {
        int seedCount = StaticData.GetWareHouseItem(CropGoodId).GoodNum;

        if (seedCount <= 0)
        {
            //判定金钱
            if (StaticData.GetWareHouseItem(currPlantSeed.coinPriceId).GoodNum < currPlantSeed.price)
            {
                ToBuyCurrency();
                uiPanelDrag.OnEndDrag(eventData);
                return;
            }
        }
        PlantSeedDragComponent plantSeedDragComponent = StaticData.GetUIWorldHandleComponent().plantSeedDragComponent;

        plantSeedDragComponent.gameObject.SetActive(true);
        uiPanelDrag.OnEndDrag(eventData);
        StaticData.GetUIWorldHandleComponent().SetHandleTileUIClose();
        plantSeedDragComponent.GetComponent <Image>().sprite = uiPanelDrag.GetComponent <Image>().sprite;
        plantSeedDragComponent.BeginDrag(this);
    }