Unity 6.3
0 онлайн 34 гостей 3 в системе
Вход

ParticleSystemRenderer.normalDirection

Declaration

public float normalDirection;

Описание

Указывает, как рассчитать освещение для рекламного щита.

Значение 0 означает, что Unity рассчитывает освещение, как если бы билборд был сферой. Это приводит к тому, что билборд выглядит больше как сфера. Значение 1 означает, что Unity рассчитывает освещение для билборда как плоский квадрант.

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); } }