Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


normalDirection

Specifies how to calculate lighting for the billboard.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.ParticleSystemModule
public float normalDirection { get; set; }

Remarks

A value of 0 means Unity calculates lighting as though the billboard was a sphere. This results in the billboard looking more like a sphere. A value of 1 means Unity calculates lighting for the billboard as a flat quad.

Examples

using UnityEngine;using UnityEditor;using System.Collections;[RequireComponent(typeof(ParticleSystem))]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 = new Material(Shader.Find("Sprites/Default")); } void Update() { psr.normalDirection = normalDirection; } void OnGUI() { normalDirection = GUI.HorizontalSlider(new Rect(25, 25, 100, 30), normalDirection, 0.0f, 1.0f); }}