原地址
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
usingSystem;
usingUnityEngine;
usingSystem.Collections;
usingSystem.Collections.Generic;
[ExecuteInEditMode]
publicclassEnvironmentUpdater
:
MonoBehaviour
{
publicGradient groundGradient
,
equatorGradient
,
skyGradient;
privateTimeOfDayManager m_TimeOfDayManager;
voidOnEnable
(
)
{
m_TimeOfDayManager
=
FindObjectOfType
<
timeofdaymanager
>
(
)
;
}
voidUpdate
(
)
{
floatcurrentTime
=
m_TimeOfDayManager.time;
RenderSettings.ambientGroundColor
=
groundGradient.Evaluate
(
currentTime
)
;
RenderSettings.ambientEquatorColor
=
equatorGradient.Evaluate
(
currentTime
)
;
RenderSettings.ambientSkyColor
=
skyGradient.Evaluate
(
currentTime
)
;
}
}
|
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
usingSystem;
usingUnityEngine;
usingSystem.Collections;
usingSystem.Collections.Generic;
[ExecuteInEditMode]
publicclassEnvironmentUpdater
:
MonoBehaviour
{
publicGradient groundGradient
,
equatorGradient
,
skyGradient;
privateTimeOfDayManager m_TimeOfDayManager;
voidOnEnable
(
)
{
m_TimeOfDayManager
=
FindObjectOfType
<
timeofdaymanager
>
(
)
;
}
voidUpdate
(
)
{
floatcurrentTime
=
m_TimeOfDayManager.time;
RenderSettings.ambientGroundColor
=
groundGradient.Evaluate
(
currentTime
)
;
RenderSettings.ambientEquatorColor
=
equatorGradient.Evaluate
(
currentTime
)
;
RenderSettings.ambientSkyColor
=
skyGradient.Evaluate
(
currentTime
)
;
}
}
|