Beispiel #1
0
    public static CityMaterialParamList CreateFromMaterialEntity()
    {
        CityMaterialParamList paramList = new CityMaterialParamList();


        return(paramList);
    }
Beispiel #2
0
    public static CityMaterialParamList CreateFromJson(JsonData jdArr)
    {
        CityMaterialParamList paramList = new CityMaterialParamList();

        paramList.paramList = jdArr.ToItemVOList <CityMaterialParam>();

        return(paramList);
    }
Beispiel #3
0
    public bool FindMaterial(CityMaterial cityMat, out ProceduralMaterial outMat)
    {
        outMat = null;
        string targetMatName = Utils.RemovePostfix_Instance(cityMat.matName);


        if (matLibrary.ContainsKey(targetMatName))
        {
            var mlist = matLibrary[targetMatName];
            return(mlist.GetSamiliarMaterial(CityMaterialParamList.CreateFromJson(cityMat.matParams),
                                             Matlevel, out outMat));
        }
        return(false);
    }
Beispiel #4
0
    //level 是压缩等级 1 表示r g b 各有256阶
    //                2 表示r g b 各有128阶
    //                3 表示r g b 各有 64阶
    // 如果没有会返回NULL
    public bool GetSamiliarMaterial(CityMaterialParamList paramList, int level, out ProceduralMaterial samiliarMat)
    {
        samiliarMat = null;
        if (matList.Count == 0)
        {
            return(false);
        }

        for (int i = 0; i < matList.Count; ++i)
        {
            if (paramList.BeSamiliar(matList[i], level))
            {
                samiliarMat = matList[i];
                return(true);
            }
        }
        return(false);
    }