Пример #1
0
        /// <summary>
        /// 获取到地形资源;
        /// </summary>
        public LandformTextures Get(string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentNullException(nameof(name));
            }

            ModificationLandformInfo info;

            if (descriptionDictionary.TryGetValue(name, out info))
            {
                LandformTextures res = new LandformTextures()
                {
                    DiffuseTex      = LoadTexture(info.Modification, info.Description.DiffuseTex),
                    DiffuseBlendTex = LoadTexture(info.Modification, info.Description.DiffuseBlendTex),
                    HeightTex       = LoadTexture(info.Modification, info.Description.HeightTex),
                    HeightBlendTex  = LoadTexture(info.Modification, info.Description.HeightBlendTex),
                };
                return(res);
            }
            else
            {
                throw new KeyNotFoundException();
            }
        }
 public void DisplayHeight(LandformTextures landformResource)
 {
     meterial.SetTexture("_MainTex", landformResource.HeightTex);
     meterial.SetTexture("_BlendTex", landformResource.HeightBlendTex);
 }
 public void DisplayDiffuse(LandformTextures landformResource)
 {
     meterial.SetTexture("_MainTex", landformResource.DiffuseTex);
     meterial.SetTexture("_BlendTex", landformResource.DiffuseBlendTex);
 }