Version: 2017.1
public float normalDirection ;

描述

公告牌粒子法线朝向摄像机的程度。

在设置为 0 时球体化公告牌法线,在设置为 1 时将它们指向摄像机。

using UnityEngine;
using UnityEditor;
using System.Collections;

public class ExampleClass : MonoBehaviour {

private ParticleSystem ps; private ParticleSystemRenderer psr; public float normalDirection = 1.0f;

void Start() {

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

psr.material = AssetDatabase.GetBuiltinExtraResource<Material>("Default-Diffuse.mat"); }

void Update() {

psr.normalDirection = normalDirection; }

void OnGUI() {

normalDirection = GUI.HorizontalSlider(new Rect(25, 25, 100, 30), normalDirection, 0.0f, 1.0f); } }