public bool allowRoll ;

Descripción

Allow billboard particles to roll around their z-axis.

Allows billboards to roll with the Camera. It is often useful to disable this option when using VR, to give particles a more believable grounding in the world.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {

private ParticleSystemRenderer psr; public bool allowRoll = true;

void Start() { psr = GetComponent<ParticleSystemRenderer>(); psr.material = new Material(Shader.Find("Sprites/Default")); }

void Update() { var psr = GetComponent<ParticleSystemRenderer>(); psr.allowRoll = allowRoll;

Camera.main.transform.rotation = Quaternion.Euler(0.0f, 0.0f, Mathf.Sin(Time.time * 0.2f) * 90.0f); }

void OnGUI() { allowRoll = GUI.Toggle(new Rect(25, 45, 200, 30), allowRoll, "Allow Roll"); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961