Exemplo n.º 1
0
 public override void Render()
 {
     base.Render();
     productImage.texture = mainPage.Logo;
     SetTextureTool.SetTexture(productImage, produce.tempTexture, "notLocal");
     modelName.text = produce.name;
     no.text        = produce.seekId;
     collecte.isOn  = MainPageUIData.Instance.GetCollected(itemData.seekId);
 }
 public override void Render()
 {
     base.Render();
     if (materialData.special)
     {
         return;
     }
     SetTextureTool.SetTexture(image, materialData.textureURL, materialData.seekId);
 }
    public override void Render()
    {
        base.Render();
        if (itemData == null)
        {
            Debug.LogError("itemData == null");
            return;
        }
        Product product = uiData.getProduct(itemData.seekId);

        SetTextureTool.SetTexture(itemImage, product.tempTexture, "notlocal");
    }
 public override void Render()
 {
     base.Render();
     productImage.texture = mainPage.Logo;
     SetTextureTool.SetTexture(productImage, produce.tempTexture, "notLocal");
     productName.text = produce.name;
     brand.text       = produce.vendor;
     no.text          = produce.seekId;
     unitPrice.text   = "";
     number.text      = itemData.count.ToString();
     totalPrice.text  = "";
 }
 public override void Render()
 {
     base.Render();
     productImage.texture = mainPage.Logo;
     SetTextureTool.SetTexture(productImage, produce.tempTexture, "notLocal");
     //Debug.Log(produceData.name);
     productName.text  = produce.name;
     brand.text        = produce.vendor;
     no.text           = produce.seekId;
     unitPrice.text    = "";
     number.text       = itemData.count.ToString();
     totalPrice.text   = "";
     selectToggle.isOn = MainPageUIData.Instance.GetCollected(produce.seekId);//itemData.seekId;
 }
    public void SetDraggingIcon(MaterialItemData itemdata)
    {
        DraggingIcon = new GameObject("Material", typeof(RectTransform), typeof(RawImage)).GetComponent <RectTransform>();
        DraggingIcon.SetParent(GlobalConfig.UIParentObj.transform);
        DraggingIcon.SetAsLastSibling();
        DraggingIcon.localScale = Vector3.one;
        RawImage image = DraggingIcon.GetComponent <RawImage>();

        image.raycastTarget = false;
        SetTextureTool.SetTexture(image, itemdata.textureURL, itemdata.seekId);
        if (deleDropMaterial != null)
        {
            deleDropMaterial(itemdata);
        }
    }
Exemplo n.º 7
0
 public override void enter()
 {
     base.enter();
     //在物体附近打开详情面板
     if (toggleButton.onDown == false)
     {
         UITool.SetActionFalse(particular.particular.gameObject);
         setState(EditTypeOnSelect.Free);
         return;
     }
     UITool.SetActionTrue(particular.particular.gameObject);
     SetTextureTool.SetTexture(particular.produceImage, targetProduct.tempTexture, targetProduct.seekId);
     particular.ProduceName.text = string.Format("产品名称:{0}", targetProduct.name);
     particular.price.text       = string.Format("单价:{0:C}", 0);
     particular.brand.text       = string.Format("品牌:{0}", targetProduct.vendor);
     particular.no.text          = string.Format("产品编号:{0}", targetProduct.seekId);
 }
    public override void Render()
    {
        base.Render();
        productImage.texture = mainPage.Logo;
        SetTextureTool.SetTexture(productImage, produce.tempTexture, "notLocal");

        productName.text  = produce.name;
        brand.text        = produce.vendor;
        productNo.text    = produce.seekId;
        unitPrice.text    = "";
        editorNumber.text = itemData.count.ToString();
        totalText.text    = "";

        selectToggle.isOn = itemData.isSelect;

        //if (selectDeleteFunc != null) selectDeleteFunc(this);
        //itemData.isCollect = true;
        //selectToggle.isOn = isEditor;
    }
Exemplo n.º 9
0
    protected override void RefreshGameObjs()
    {
        base.RefreshGameObjs();

        SetGameObjCountEquleList(data.wallList.Count, wallLines, prefabs.GetNewInstance_grey);

        SetGameObjCountEquleList(data.wallList.Count, wallsideLines, prefabs.GetNewInstance_black, 2);

        SetGameObjCountEquleList(data.wallList.Count, wallEndLines, prefabs.GetNewInstance_black, 2);

        SetGameObjCountEquleList(data.pointList.Count, wallPoints, prefabs.GetNewInstance_point);

        SetGameObjCountEquleList(data.wallList.Count, showLenLines, prefabs.GetNewInstance_line, 2);

        SetGameObjCountEquleList(data.wallList.Count, showLenPoints, prefabs.GetNewInstance_fork, 4);

        SetGameObjCountEquleList(data.wallList.Count, showWords, prefabs.GetNewInstance_text, 2);

        SetGameObjCountEquleList(data.roomList.Count, floors, prefabs.GetNewInstance_floor);

        SetGameObjCountEquleList(data.roomList.Count, areas, prefabs.GetNewInstance_area);

        SetGameObjCountEquleList(selectPackedProductdatas.Count, selectPackedproducts, prefabs.GetNewInstance_selectGoods);

        for (int i = 0; i < showLenLines.Count; i++)
        {
            showLenLines[i].gameObject.SetActive(false);
        }
        for (int i = 0; i < showLenPoints.Count; i++)
        {
            showLenPoints[i].gameObject.SetActive(false);
        }
        for (int i = 0; i < showWords.Count; i++)
        {
            showWords[i].gameObject.SetActive(false);
        }



        for (int i = 0; i < data.productDataList.Count; i++)
        {
            int id = data.productDataList[i].id;
            if (products.ContainsKey(id) == false)
            {
                products.Add(id, new List <GameObject>());
            }
        }
        goodsViewList.Clear();
        removeListId.Clear();
        foreach (int id in products.Keys)
        {
            hasIndexList.Clear();
            for (int i = 0; i < data.productDataList.Count; i++)
            {
                ProductData productData = data.productDataList[i];
                if (productData.id == id)
                {
                    hasIndexList.Add(i);
                    if (products.ContainsKey(id) && products[id].Count >= hasIndexList.Count)
                    {
                        GameObject go   = products[id][hasIndexList.Count - 1];
                        Vector3    size = mainPageData.getProduct(productData.seekId).size;
                        GoodsVO    vo   = mainPageData.getGoods(productData.seekId);
                        ResourcesPool.DisposTexture(go);
                        SetTextureTool.SetTexture(go, vo.uri2D, vo.seekId);
                        Product product = mainPageData.getProduct(vo.seekId);
                        float   y       = productData.height;
                        switch (productData.type)
                        {
                        case 2:    //门窗
                        {
                            //if (product.entityType == "window")
                            //{
                            //    y = 1;
                            //}
                        }
                        break;

                        case 3:    //吊顶
                        {
                            if (product == null)
                            {
                                break;
                            }
                            y = defaultSetting.DefaultHeight + productData.height - product.size.y;
                        }
                        break;

                        case 4:    //地毯
                        {
                            y = productData.height + -0.001f;
                        }
                        break;

                        case 5:    //天花板
                        {
                            y = defaultSetting.DefaultHeight + productData.height - 0.001f;
                        }
                        break;

                        case 6:    //吸附各个平面 暂时不做
                        {
                            //world3d.y = defaultSetting.DefaultHeight - 0.01f;
                        }
                        break;

                        default:    //不吸附
                            break;
                        }
                        productData.setData(go, size, y, true);
                        GoodsView goodsView = go.GetComponent <GoodsView>();
                        goodsView.SetData(productData);
                        if (selectObjData == productData)
                        {
                            if (selectGoods == null)
                            {
                                selectGoods = prefabs.GetNewInstance_selectGoods().gameObject;
                            }
                            selectGoods.transform.localRotation = go.transform.localRotation;
                            selectGoods.transform.localScale    = go.transform.localScale;
                            selectGoods.transform.localPosition = go.transform.localPosition - Vector3.forward;
                            selectGoods.SetActive(true);
                            if (productData.hide == true)
                            {
                                selectGoods.SetActive(false);
                            }
                        }
                        for (int k = 0; k < selectPackedProductdatas.Count; k++)
                        {
                            if (selectPackedProductdatas[k] == productData)
                            {
                                GameObject obj = selectPackedproducts[k];
                                //if (obj == null) obj = prefabs.GetNewInstance_selectGoods().gameObject;
                                obj.transform.localRotation = go.transform.localRotation;
                                obj.transform.localScale    = go.transform.localScale;
                                obj.transform.localPosition = go.transform.localPosition - Vector3.forward;
                                obj.SetActive(true);
                                if (productData.hide == true)
                                {
                                    obj.SetActive(false);
                                }
                                break;
                            }
                        }

                        if (productData.hide == true)
                        {
                            go.SetActive(false);
                        }
                        else
                        {
                            go.SetActive(true);
                        }
                        goodsViewList.Add(goodsView);
                    }
                }
            }
            int minCount = hasIndexList.Count < products[id].Count ? hasIndexList.Count : products[id].Count;
            for (int i = minCount; i < products[id].Count; i++)
            {
                GameObject.DestroyImmediate(products[id][i], true);
                products[id].RemoveAt(i);
                i--;
            }
            for (int i = minCount; i < hasIndexList.Count; i++)
            {
                int         index   = hasIndexList[i];
                ProductData product = data.productDataList[index];
                LoadMode(product);
            }
            if (products[id].Count == 0)
            {
                removeListId.Add(id);
            }
        }

        if ((selectObjData == null || selectObjData is ProductData == false) && selectGoods != null)
        {
            selectGoods.SetActive(false);
        }

        for (int i = 0; i < removeListId.Count; i++)
        {
            products.Remove(removeListId[i]);
        }

        if (inputWallLengths.Count == 0)
        {
            for (int i = 0; i < 5; i++)
            {
                GameObject go = prefabs.GetNewInstance_inputWallLength().gameObject;
                go.AddComponent <SetLengthHandleView>();
                go.SetActive(false);
                inputWallLengths.Add(go);
            }
        }
    }
Exemplo n.º 10
0
    private void LoadMode(ProductData productData)
    {
        GoodsVO vo = mainPageData.getGoods(productData.seekId);

        if (vo == null)
        {
            Debug.LogWarning("proxy.getGood(id) == null seekId = " + productData.seekId);
            return;
        }

        Vector3 size    = mainPageData.getProduct(vo.seekId).size;
        Product product = mainPageData.getProduct(vo.seekId);
        float   y       = productData.height;

        switch (productData.type)
        {
        case 2:    //门窗
        {
            //if (product.entityType == "window")
            //{
            //    y = 1;
            //}
        }
        break;

        case 3:    //吊顶
        {
            if (product == null)
            {
                break;
            }
            y = defaultSetting.DefaultHeight + productData.height - product.size.y;
        }
        break;

        case 4:    //地毯
        {
            y = -0.001f + productData.height;
        }
        break;

        case 5:    //天花板
        {
            y = defaultSetting.DefaultHeight + productData.height - 0.001f;
        }
        break;

        case 6:    //吸附各个平面 暂时不做
        {
            //world3d.y = defaultSetting.DefaultHeight - 0.01f;
        }
        break;

        default:    //不吸附
            break;
        }

        GameObject instanceObj;
        Vector3    pos;
        GoodsView  goodsView;

        if (productData.type == 2)
        {
            instanceObj = prefabs.GetNewInstance_doorwhiteground().gameObject;
            //float width = size.z;
            instanceObj.transform.localScale = Vector2.right * size.x + Vector2.up * size.z;
            instanceObj.layer = LayerMask.NameToLayer("UI");
            AddProductGameObj(productData.id, instanceObj);

            productData.setData(instanceObj, size, y, true);
            pos   = instanceObj.transform.localPosition;
            pos.z = -5;
            instanceObj.transform.localPosition = pos;
            goodsView = instanceObj.GetComponent <GoodsView>();
            goodsView.SetData(productData);
            if (productData.hide == true)
            {
                instanceObj.SetActive(false);
            }
            else
            {
                instanceObj.SetActive(true);
            }
            goodsViewList.Add(goodsView);
            return;
        }
        instanceObj = prefabs.GetNewQuad();
        //float width = size.z;
        instanceObj.transform.localScale = Vector2.right * size.x + Vector2.up * size.z;
        instanceObj.layer = LayerMask.NameToLayer("UI");
        AddProductGameObj(productData.id, instanceObj);

        productData.setData(instanceObj, size, y, true);
        pos   = instanceObj.transform.localPosition;
        pos.z = -5;
        instanceObj.transform.localPosition = pos;
        goodsView = instanceObj.GetComponent <GoodsView>();
        goodsView.SetData(productData);
        if (productData.hide == true)
        {
            instanceObj.SetActive(false);
        }
        else
        {
            instanceObj.SetActive(true);
        }
        goodsViewList.Add(goodsView);
        SetTextureTool.SetTexture(instanceObj, vo.uri2D, vo.seekId);
        //AssetBoundleLoader loader = new AssetBoundleLoader(vo.modelUri, LoadDataType.assetBoundle, onLoaded, new object[2] { vo, product });
        //loader.Load();
    }
Exemplo n.º 11
0
 private void LoadTexture()
 {
     SetTextureTool.SetTexture(targetObj, targetVO.uri2D, targetVO.seekId);
     //string outUrl = targetVO.uri2D;// "http://midea-products.oss-cn-shanghai.aliyuncs.com/8b7df9b0-28f5-4c88-a412-324284ccc923/model.assetbundle";//10.0.21.27/yy/model.assetbundle";
     //loader = LoaderPool.OutterLoad(outUrl, SimpleLoadDataType.prefabAssetBundle, onloaded, new object[1] { targetVO });
 }