using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class 라이트 : MonoBehaviour
{
private Light theLight;
private float targetlntensity;
private float currentlntensity;
private void Start()
{
theLight = GetComponet<Light>();
currentlntensity = theLight.intensity;
targetlntensity = Random.Range(0.4f, 1f);
}
// Update is called once per frame
void Update()
{
if(Mathf.Abs(targetlntensity - currentlntensity) >= 0.01)
{
if(targetlntensity - currentlntensity >= 0)
currentlntensity += Time.deltaTime * 3f;
else
currentlntensity -= Time.deltaTime * 3f;
theLight.intensity = currentlntensity;
theLight.range = currentlntensity + 10;
}
else
{
targetlntensity = Random.Range(0.4f, 1f);
}
}뭔가 계속 틀려서 오류가난다는데 먼지모르겠어요
https://www.youtube.com/watch?v=CJm1vsbh_78&list=PLUZ5gNInsv_PR72-V9bTABaZu2py4DJq8&index=7 분명 이거 보고 따라했는데