Version: 5.3 (switch to 5.4b)
言語English
  • C#
  • JS

スクリプト言語

好きな言語を選択してください。選択した言語でスクリプトコードが表示されます。

LensFlare.color

マニュアルに切り替える
public Color color;

説明

フレアのカラーを設定する。

いくつかの(有効になっている "Use Light Color" を持っている)フレアエレメントの色を制御します 。

See Also: Lens flare component, flare assets.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public LensFlare lf; public Transform tr; void Update() { float percentage = 1 / Vector3.Distance(lf.transform.position, tr.position); lf.color = new Color(percentage, percentage, percentage); } }