当前位置: 首页>>代码示例>>C#>>正文


C# Material.Load方法代码示例

本文整理汇总了C#中Material.Load方法的典型用法代码示例。如果您正苦于以下问题:C# Material.Load方法的具体用法?C# Material.Load怎么用?C# Material.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Material的用法示例。


在下文中一共展示了Material.Load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialize

        /// <summary>
        /// Initialize the world manager
        /// </summary>
        public void Initialize(SceneManager sceneManager, ITerrainGenerator gen, ILODSpec clientLodSpec, SceneNode root)
        {
            Debug.Assert(!initialized, "Attempt to initialize already initialized TerrainManager");
            scene = sceneManager;
            terrainGenerator = gen;
            terrainGenerator.TerrainChanged += TerrainGenerator_OnTerrainChanged;
            lodSpec = clientLodSpec ?? defaultLODSpec;

            pageSize = lodSpec.PageSize;
            visPageRadius = lodSpec.VisiblePageRadius;
            pageArraySize = (visPageRadius * 2) + 1;

            // Compute the size of a "subPage", which is the same as the smalles tile size.
            // We assume that the page containing the camera will have the smallest sized tiles.
            subPageSize = pageSize / TilesPerPage(0);

            minMetersPerSample = lodSpec.MetersPerSample(Vector3.Zero, 0, 0);
            maxMetersPerSample = lodSpec.MetersPerSample(Vector3.Zero, visPageRadius, visPageRadius * pageSize / subPageSize);

            rootSceneNode = root;
            worldRootSceneNode = rootSceneNode.CreateChildSceneNode("TerrainRoot");
            oceanSceneNode = rootSceneNode.CreateChildSceneNode("OceanNode");

            terrainMaterialConfig = new AutoSplatConfig();

            terrainDecalManager = new TerrainDecalManager(pageArraySize);

            shadowConfig = new ShadowConfig(scene);

            oceanConfig = new OceanConfig();
            oceanConfig.ConfigChange += OceanConfigChanged;
            ocean = new OceanPage(oceanConfig);

            oceanSceneNode.AttachObject(ocean);
            //ocean.ShowBoundingBox = true;
            showOcean = true;

            detailVeg = new DetailVeg(65, rootSceneNode);

            // allocate the page array
            pages = new Page[pageArraySize, pageArraySize];

            InitPages();

            heightFieldsCreated = false;

            boundaries = new List<Boundary>();
            roads = new Roads();

            SpeedTreeWrapper.SetDropToBillboard(true);

            // make sure variables based on camera location are up to date
            CameraLocation = cameraLocation;

            // set up material used by water boundaries
            waterMaterial = MaterialManager.Instance.GetByName("MVSMWater");
            if (waterMaterial != null)
                waterMaterial.Load();

            initialized = true;
        }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:64,代码来源:TerrainManager.cs


注:本文中的Material.Load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。