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


C# Mesh.MarkDynamic方法代码示例

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


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

示例1: Init

            public void Init(Factory factory)
            {
                renderers = new List<IMeshRenderer>();

                mesh = new Mesh();
                mesh.name = "LWF/" + factory.data.name;
                mesh.MarkDynamic();

                meshFilter = gameObject.AddComponent<MeshFilter>();
                meshFilter.sharedMesh = mesh;

                meshRenderer = gameObject.AddComponent<UnityEngine.MeshRenderer>();
                if (!string.IsNullOrEmpty(factory.sortingLayerName))
                meshRenderer.sortingLayerName = factory.sortingLayerName;
                meshRenderer.sortingOrder = factory.sortingOrder;
                meshRenderer.castShadows = false;
                meshRenderer.receiveShadows = false;

                buffer = new CombinedMeshBuffer();
            }
开发者ID:rayyee,项目名称:lwf,代码行数:20,代码来源:lwf_combinedmesh_factory.cs

示例2: Factory

            public Factory(Data d, GameObject gObj,
			float zOff = 0, float zR = 1, int rQOff = 0, bool uAC = false,
			Camera cam = null, string texturePrfx = "", string fontPrfx = "",
			TextureLoader textureLdr = null,
			TextureUnloader textureUnldr = null)
                : base(gObj, zOff, zR, rQOff, uAC,
			cam, texturePrfx, fontPrfx, textureLdr, textureUnldr)
            {
                data = d;
                mesh = new Mesh();
                mesh.name = "LWF/" + data.name;
                #if !UNITY_3_5
                mesh.MarkDynamic();
                #endif

                if (Application.isEditor) {
                meshFilter = gameObject.GetComponent<MeshFilter>();
                if (meshFilter == null)
                meshFilter = gameObject.AddComponent<MeshFilter>();
                } else {
                meshFilter = gameObject.AddComponent<MeshFilter>();
                }
                meshFilter.sharedMesh = mesh;

                if (Application.isEditor) {
                meshRenderer = gameObject.GetComponent<UnityEngine.MeshRenderer>();
                if (meshRenderer == null)
                meshRenderer =
                    gameObject.AddComponent<UnityEngine.MeshRenderer>();
                } else {
                meshRenderer = gameObject.AddComponent<UnityEngine.MeshRenderer>();
                }
                meshRenderer.castShadows = false;
                meshRenderer.receiveShadows = false;

                textureName = texturePrefix + data.textures[0].filename;
                meshRenderer.sharedMaterial =
                ResourceCache.SharedInstance().LoadTexture(
                data.name, textureName, data.textures[0].format, true,
                    useAdditionalColor, textureLoader, textureUnloader);
                if (renderQueueOffset != 0)
                meshRenderer.sharedMaterial.renderQueue += renderQueueOffset;

                premultipliedAlpha = (data.textures[0].format ==
                (int)Format.Constant.TEXTUREFORMAT_PREMULTIPLIEDALPHA);

                buffer = new CombinedMeshBuffer();

                CreateBitmapContexts(data);
            }
开发者ID:ruipengliu,项目名称:lwf,代码行数:50,代码来源:lwf_combinedmesh_factory.cs

示例3: Init

            public void Init(Factory factory)
            {
                renderers = new List<IMeshRenderer>();

                mesh = new Mesh();
                mesh.name = "LWF/" + factory.data.name;
                mesh.MarkDynamic();

                meshFilter = gameObject.AddComponent<MeshFilter>();
                meshFilter.sharedMesh = mesh;

                meshRenderer = gameObject.AddComponent<UnityEngine.MeshRenderer>();
                #if UNITY_4_6
                meshRenderer.castShadows = false;
                #else
                meshRenderer.shadowCastingMode =
                UnityEngine.Rendering.ShadowCastingMode.Off;
                #endif
                meshRenderer.receiveShadows = false;
                UpdateSortingLayerAndOrder(factory);
                UpdateLayer(factory);

                if (factory.useAdditionalColor) {
                additionalColor = UnityEngine.Color.clear;
                property = new MaterialPropertyBlock();
                additionalColorId = Shader.PropertyToID("_AdditionalColor");
                }

                buffer = new CombinedMeshBuffer();
            }
开发者ID:degea9,项目名称:lwf,代码行数:30,代码来源:lwf_combinedmesh_factory.cs


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