[統一]軽(軽)



  • モード:固定シャドウ、リアルタイムなど

  • 密度みつど:光の強さひかりのつよさ

  • Indirect Multiplier:間接光強度

  • シャドウタイプシャドウタイプ:シャドウシャドウ

  • window - lighting

  • きらめき
  • 
    public class light : MonoBehaviour
    {
        private Light theLight;
        private float targetIntensity;
        private float currenIntensity;
        void Start()
        {
            theLight = GetComponent<Light>();
            currenIntensity = theLight.intensity;
            targetIntensity = Random.Range(0.4f, 1f);
        }
    
        // Update is called once per frame
        void Update()
        {
            if(Mathf.Abs(targetIntensity - currenIntensity) >= 0.01)
            {
                if (targetIntensity - currenIntensity >= 0)
                    currenIntensity += Time.deltaTime * 3f;
                else
                    currenIntensity -= Time.deltaTime * 3f;
                theLight.intensity = currenIntensity;
                theLight.range = currenIntensity + 10;
            }
            else
            {
                targetIntensity = Random.Range(0.4f, 1f);
            }
    
        }
    }