コード例 #1
0
 void LazyIntialize()
 {
     if (meshGenerator != null)
     {
         return;
     }
     meshGenerator = new ArraysSubmeshSetMeshGenerator();
     meshFilter    = GetComponent <MeshFilter>();
     meshRenderer  = GetComponent <MeshRenderer>();
 }
コード例 #2
0
        private void HandleRender(SkeletonRenderer.SmartMesh.Instruction instruction)
        {
            int count = this.partsRenderers.Count;

            if (count <= 0)
            {
                return;
            }
            int i = 0;

            if (this.copyPropertyBlock)
            {
                this.mainMeshRenderer.GetPropertyBlock(this.copiedBlock);
            }
            ExposedList <SubmeshInstruction> submeshInstructions = instruction.submeshInstructions;

            SubmeshInstruction[] items = submeshInstructions.Items;
            int num = submeshInstructions.Count - 1;
            SkeletonPartsRenderer skeletonPartsRenderer = this.partsRenderers[i];
            bool calculateNormals  = this.skeletonRenderer.calculateNormals;
            bool calculateTangents = this.skeletonRenderer.calculateTangents;
            bool pmaVertexColors   = this.skeletonRenderer.pmaVertexColors;
            int  j            = 0;
            int  startSubmesh = 0;

            while (j <= num)
            {
                if (items[j].forceSeparate || j == num)
                {
                    ISubmeshSetMeshGenerator meshGenerator = skeletonPartsRenderer.MeshGenerator;
                    meshGenerator.AddNormals              = calculateNormals;
                    meshGenerator.AddTangents             = calculateTangents;
                    meshGenerator.PremultiplyVertexColors = pmaVertexColors;
                    if (this.copyPropertyBlock)
                    {
                        skeletonPartsRenderer.SetPropertyBlock(this.copiedBlock);
                    }
                    skeletonPartsRenderer.RenderParts(instruction.submeshInstructions, startSubmesh, j + 1);
                    startSubmesh = j + 1;
                    i++;
                    if (i >= count)
                    {
                        break;
                    }
                    skeletonPartsRenderer = this.partsRenderers[i];
                }
                j++;
            }
            while (i < count)
            {
                this.partsRenderers[i].ClearMesh();
                i++;
            }
        }
コード例 #3
0
		void LazyIntialize () {
			if (meshGenerator != null) return;
			meshGenerator = new ArraysSubmeshSetMeshGenerator();
			meshFilter = GetComponent<MeshFilter>();
			meshRenderer = GetComponent<MeshRenderer>();
		}