File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Assets/AWSIM/Scripts/Environments Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ public class EmissionConfig
105
105
const string EmissiveColor = "_EmissiveColor" ;
106
106
const string EmissiveIntensity = "_EmissiveIntensity" ;
107
107
const string EmissiveExposureWeight = "_EmissiveExposureWeight" ;
108
+ const string LightOnFlag = "_LightOn" ;
108
109
const float flashIntervalSec = 0.5f ; // flash bulb lighting interval(sec).
109
110
110
111
float timer = 0 ; // used for flashing status. NOTE: Might as well make it static and refer to the same time.
@@ -210,13 +211,21 @@ void Set(bool isLightOn)
210
211
var config = bulbColorConfigPairs [ color ] ;
211
212
material . SetColor ( EmissiveColor , config . Color * config . Intensity ) ;
212
213
material . SetFloat ( EmissiveExposureWeight , config . ExposureWeight ) ;
214
+ if ( material . HasProperty ( LightOnFlag ) )
215
+ {
216
+ material . SetInt ( LightOnFlag , 1 ) ;
217
+ }
213
218
this . isLightOn = true ;
214
219
timer = 0 ;
215
220
}
216
221
else
217
222
{
218
223
material . SetColor ( EmissiveColor , defaultEmissiveColor ) ;
219
224
material . SetFloat ( EmissiveExposureWeight , defaultEmissiveExposureWeight ) ;
225
+ if ( material . HasProperty ( LightOnFlag ) )
226
+ {
227
+ material . SetInt ( LightOnFlag , 0 ) ;
228
+ }
220
229
this . isLightOn = false ;
221
230
timer = 0 ;
222
231
}
You can’t perform that action at this time.
0 commit comments