public HxDummyLight DummyLightSafe() { if (myDummyLight == null) { myDummyLight = GetComponent <HxDummyLight>(); } return(myDummyLight); }
void OnEnable() { myLight = GetComponent <Light>(); myDummyLight = GetComponent <HxDummyLight>(); HxVolumetricCamera.AllVolumetricLight.Add(this); UpdatePosition(true); if (GetLightType() != LightType.Directional) { octreeNode = HxVolumetricCamera.AddLightOctree(this, minBounds, maxBounds); } else { HxVolumetricCamera.ActiveDirectionalLights.Add(this); } //if (!HasLight()) //{ // enabled = false; //} }
bool LightEnabled() { if (myLight != null) { return(myLight.enabled); } if (myDummyLight != null) { return(myDummyLight.enabled); } myLight = GetComponent <Light>(); if (myLight != null) { return(myLight.enabled); } myDummyLight = GetComponent <HxDummyLight>(); if (myDummyLight != null) { return(myDummyLight.enabled); } return(false); }
void Start() { myLight = GetComponent <Light>(); myDummyLight = GetComponent <HxDummyLight>(); }