123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using System;
- using UnityEngine;
- public class LightMain : MonoBehaviour
- {
- public void Awake()
- {
- this.m_light = base.GetComponent<Light>();
- NDebug.Assert(this.m_light != null, "メインライトが設定されていません。");
- }
- private void Start()
- {
- this.ResetIntensity();
- RenderSettings.ambientLight = new Color(0f, 0f, 0f);
- RenderSettings.ambientIntensity = 0f;
- }
- public void OnLevelWasLoaded(int level)
- {
- RenderSettings.ambientLight = new Color(0f, 0f, 0f);
- RenderSettings.ambientIntensity = 0f;
- }
- public void SetRotation(Vector3 f_vRot)
- {
- base.gameObject.transform.rotation = Quaternion.Euler(f_vRot);
- }
- public void SetIntensity(float f_fVal)
- {
- this.m_light.intensity = f_fVal;
- }
- public float GetIntensity()
- {
- return this.m_light.intensity;
- }
- public void ResetIntensity()
- {
- this.m_light.intensity = 0.95f;
- }
- public void SetShadowStrength(float value)
- {
- this.m_light.shadowStrength = value;
- }
- public float GetShadowStrength()
- {
- return this.m_light.shadowStrength;
- }
- public void SetColor(Color color)
- {
- this.m_light.color = color;
- }
- public Color GetColor()
- {
- return this.m_light.color;
- }
- public void Reset()
- {
- this.SetRotation(new Vector3(40f, 180f, 18f));
- this.m_light.color = Color.white;
- this.ResetIntensity();
- this.m_light.shadowStrength = 0.098f;
- this.m_light.shadowBias = 0.01f;
- RenderSettings.ambientLight = new Color(0f, 0f, 0f);
- RenderSettings.ambientIntensity = 0f;
- }
- private Light m_light;
- private const float DefaultLightIntensity = 0.95f;
- private const float DefaultShadowStrength = 0.098f;
- }
|