Beispiel #1
0
    public void PlayExpAnim(TileComponent tile, int addCount)
    {
        var goExp = ResourcesHelper.InstantiatePrefabFromABSetDefaultNotStretch(goPrefabItemExp, tranParentExp);

        //设置位置
        goExp.GetComponent <RectTransform>().anchoredPosition = StaticData.ManorWorldPointToUICameraAnchorPos(tile.transform.position) + new Vector2(-50f, 50f);
        goExp.GetComponent <UIItemExpEffect>().ShowInfo(addCount);
    }
Beispiel #2
0
    public void PlayWateringAnim(TileComponent tile)
    {
        var goWatering = ResourcesHelper.InstantiatePrefabFromABSetDefaultNotStretch(prefabUiWatering, TransWateringParent);

        //设置位置
        goWatering.GetComponent <RectTransform>().anchoredPosition = StaticData.ManorWorldPointToUICameraAnchorPos(tile.transform.position);
        goWatering.SetActive(true);
    }
Beispiel #3
0
    public async void PlayItemHarvestEffect(TileComponent tile, int addCount)
    {
        var goPlant = ResourcesHelper.InstantiatePrefabFromABSetDefaultNotStretch(goPrefabItemPlant, transParentOneKey);

        //设置位置
        goPlant.GetComponent <RectTransform>().anchoredPosition = StaticData.ManorWorldPointToUICameraAnchorPos(tile.transform.position);
        //设置图片个数
        int    cropId       = tile.CropGoodId;
        int    gameDefineId = StaticData.configExcel.GetManorCropByCropId(cropId).IdGainGameItem;
        string iconName     = StaticData.configExcel.GetGameItemByID(gameDefineId).Icon;

        goPlant.GetComponent <UIItemPlantEffect>().ShowInfo(iconName, addCount);
    }