I have this code (basically not my invention) which is working fine, but I have a problem with it Is suppressed. I do not seem to present the second submarine with the other material.
I can not understand the problem contained in the [renderer] part or the second "novel" which is probably never a combination.
@script RequireComponent (MeshFilter) @ script requiredCompany (Meshrenderer) Private Variant Material: Content [] = New Content [2]; Var mat: material; Var Matt 2: Material; Start function () {mater [0] = mat; Mater [1] = matte 2; For (different children in change) child.position == transform.position; Transform.position = Vector3.zero; Change. Rotation = quatorian Var MeshFilters = GetComponentsInChildren (MeshFilter); Vardhan Alliance: Judaistance [] = New Combination Device [MeshFilters. Length-1]; Var Index = 0; For (var i = 0; i & lt; meshFilters.Length; i ++) {if (meshFilters [i] .sharedMesh == tap) released; Coalition [index] .mesh = meshfilters [i] .sharedMesh; [Index ++] Coalition Transform = meshfilters [i] .transform.localToWorldMatrix; Renderer Shared content = butterfly; MeshFilters [i] .active = false; } GetComponent (MeshFilter). Mess = new mesh (); GetComponent (MeshFilter) .mesh.CombineMeshes (Alliance); Renderer.active = True; // Here seems trouble is the renderer. Shared content = butterfly; }
Alternatively I have tried,
renderer.sharedMaterials [1] = mortar [1];
In short, I am in trouble I have to save some draw calls, which is not good until it gets cured.
No comments:
Post a Comment