Version: 5.3
public float range ;

설명

The range of the light.

See Also: Light component.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public float duration = 3.0F; public float originalRange; public Light lt; void Start() { lt = GetComponent<Light>(); originalRange = lt.range; } void Update() { float amplitude = Mathf.PingPong(Time.time, duration); amplitude = amplitude / duration * 0.5F + 0.5F; lt.range = originalRange * amplitude; } }