|
|
@ -15,14 +15,17 @@ public class Timer : MonoBehaviour { |
|
|
|
public float Dawn = 125; //FF7D00 125
|
|
|
|
public float Noon = 248; //FFF800 248
|
|
|
|
|
|
|
|
public float sunR; |
|
|
|
public float sunB; |
|
|
|
float sunG; |
|
|
|
float colorDif; |
|
|
|
Image SunImage; |
|
|
|
public Image SunImage; |
|
|
|
|
|
|
|
public GameMode mode; |
|
|
|
|
|
|
|
void Start() |
|
|
|
{ |
|
|
|
SunImage = Sun.gameObject.GetComponent<Image>(); |
|
|
|
sunG = Dawn; |
|
|
|
colorDif = Mathf.Abs(Noon - Dawn); |
|
|
|
} |
|
|
|
|
|
|
@ -33,17 +36,19 @@ public class Timer : MonoBehaviour { |
|
|
|
mode.PreGameLose(); |
|
|
|
} |
|
|
|
|
|
|
|
// Color newColor;
|
|
|
|
|
|
|
|
|
|
|
|
float offset = colorDif * (2 / MaxTimer) * Time.deltaTime; |
|
|
|
if (curTime > MaxTimer / 2) |
|
|
|
{ |
|
|
|
// newColor = new Color(SunImage.color.r, SunImage.color.g - (colorDif / (1/(0.5 * MaxTimer))), SunImage.color.b);
|
|
|
|
sunG -= offset; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
// newColor = new Color(SunImage.color.r, SunImage.color.g + (colorDif / (1/(0.5 * MaxTimer))), SunImage.color.b);
|
|
|
|
sunG += offset; |
|
|
|
} |
|
|
|
// SunImage.color = newColor;
|
|
|
|
Color32 col = new Color32((byte)sunR, (byte)sunG, (byte)sunB, (byte)255); |
|
|
|
Debug.Log(col); |
|
|
|
SunImage.color = col; |
|
|
|
Sun.RotateAround(Pivot.transform.position, -1 * Sun.transform.forward, (180 / MaxTimer) * Time.deltaTime); |
|
|
|
|
|
|
|
} |
|
|
|