SW 중심대학 OSS GIT 서버
박건태, 이승준, 고기완, 이준호
새로운 배포
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
using UnityEngine;using System.Collections;
// Cartoon FX - (c) 2015 Jean Moreno
// Randomly changes a light's intensity over time.
[RequireComponent(typeof(Light))]public class CFX_LightFlicker : MonoBehaviour{ // Loop flicker effect
public bool loop; // Perlin scale: makes the flicker more or less smooth
public float smoothFactor = 1f; /// Max intensity will be: baseIntensity + addIntensity
public float addIntensity = 1.0f; private float minIntensity; private float maxIntensity; private float baseIntensity; void Awake() { baseIntensity = GetComponent<Light>().intensity; } void OnEnable() { minIntensity = baseIntensity; maxIntensity = minIntensity + addIntensity; } void Update () { GetComponent<Light>().intensity = Mathf.Lerp(minIntensity, maxIntensity, Mathf.PerlinNoise(Time.time * smoothFactor, 0f)); }}
|