# 创建3D均匀粒子网格

Part 1：粒子系统设置

Part 2：发射均匀网格

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class ParticleGrid : MonoBehaviour

{

}

public class ParticleGrid : MonoBehaviour

{

ParticleSystem particleSystem;

public Vector3 bounds = new Vector3(25.0f, 25.0f, 25.0f);

public Vector3Int resolution = new Vector3Int(10, 10, 10);

}

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class ParticleGrid : MonoBehaviour

{

ParticleSystem particleSystem;

public Vector3 bounds = new Vector3(25.0f, 25.0f, 25.0f);

public Vector3Int resolution = new Vector3Int(10, 10, 10);

void OnEnable()

{

particleSystem = GetComponent

();

Vector3 scale;

Vector3 boundsHalf = bounds / 2.0f;

scale.x = bounds.x / resolution.x;

scale.y = bounds.y / resolution.y;

scale.z = bounds.z / resolution.z;

ParticleSystem.EmitParams ep = new ParticleSystem.EmitParams();

for (int i = 0; i

{

for (int j = 0; j

{

for (int k = 0; k

{

Vector3 position;

position.x = (i * scale.x) - boundsHalf.x;

position.y = (j * scale.y) - boundsHalf.y;

position.z = (k * scale.z) - boundsHalf.z;

ep.position = position;

particleSystem.Emit(ep, 1);

}

}

}

}

}

Part 3：变形

https://assetstore.unity.com/packages/vfx/particles/ultimate-vfx-26701

Mirza创作了一系列由浅入深的教程，帮助大家学习制作VFX：

http://www.mirzabeig.com/tutorials/

Unity面向全球的学生推出－Unity全球学生开发挑战赛，寻找全世界最具创意，展现自我的学生开发者团队。［

https://connect.unity.com/challenges/gsc2018

https://connect.unity.com/challenges/2dchallenge

Asset Store年终巨惠Cyber Week劲爆来袭

Asset Store资源商店年终巨惠Cyber Week劲爆来袭！多至2千余款人气热销资源参与促销，低至5折优惠，更有4.5折特惠组合资源包，好资源和低价格一包打尽！

https://assetstore.unity.com

• 发表于:
• 原文链接https://kuaibao.qq.com/s/20181130A0NH3C00?refer=cp_1026
• 腾讯「云+社区」是腾讯内容开放平台帐号（企鹅号）传播渠道之一，根据《腾讯内容开放平台服务协议》转载发布内容。
• 如有侵权，请联系 yunjia_community@tencent.com 删除。

2021-12-01

2021-12-01

2021-12-01

2021-12-01

2021-12-01

2021-12-01

2021-12-01

2021-12-01

2021-12-01

2021-12-01

2021-12-01

2021-12-01