public void SetMeshes (Mesh[] meshes);
public void SetMeshes (Mesh[] meshes, int size);

Parameters

meshes 要使用的网格的数组。
size 要应用的网格数组中的元素数。

Description

设置在 ParticleSystemRenderer.renderMode 设置为 ParticleSystemRenderMode.Mesh 时要用作粒子的网格的数组。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {

private ParticleSystem ps; private ParticleSystemRenderer psr;

void Start() {

ps = GetComponent<ParticleSystem>(); psr = GetComponent<ParticleSystemRenderer>();

psr.renderMode = ParticleSystemRenderMode.Mesh; psr.SetMeshes(new Mesh[]{ Resources.GetBuiltinResource<Mesh>("Capsule.fbx"), Resources.GetBuiltinResource<Mesh>("Cube.fbx"), Resources.GetBuiltinResource<Mesh>("Sphere.fbx") }); }

void OnGUI() { GUI.Label(new Rect(25, 40, 200, 30), "Mesh Count: " + psr.meshCount.ToString()); } }