本文整理汇总了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();
}
示例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);
}
示例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();
}