Browse Source

Sun is working

master
Bernard Laptop 5 years ago
parent
commit
c895d40e3d
16 changed files with 49 additions and 62 deletions
  1. +2
    -1
      Assets/AmplifyShaderEditor/Examples/Official.meta
  2. +2
    -1
      Assets/AmplifyShaderEditor/Examples/Official/CustomRTRain.meta
  3. +2
    -1
      Assets/AmplifyShaderEditor/Examples/Official/SimpleTerrain.meta
  4. +2
    -1
      Assets/AmplifyShaderEditor/Examples/Official/Substance.meta
  5. +0
    -7
      Assets/AmplifyShaderEditor/Examples/Official/Substance/LegacySubstanceExample.unitypackage.meta
  6. +8
    -0
      Assets/AmplifyShaderEditor/Examples/Official/Substance2018.meta
  7. +0
    -7
      Assets/AmplifyShaderEditor/Examples/Official/Substance2018/Substance2018.unitypackage.meta
  8. +8
    -0
      Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates.meta
  9. +0
    -7
      Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/CustomRTTemplates.unitypackage.meta
  10. +8
    -0
      Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP.meta
  11. +0
    -7
      Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/HDSRPTemplates (Legacy).unitypackage.meta
  12. +0
    -7
      Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/HDSRPTemplates.unitypackage.meta
  13. +0
    -7
      Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/LWSRPTemplates (Legacy).unitypackage.meta
  14. +0
    -7
      Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/LWSRPTemplates.unitypackage.meta
  15. +5
    -2
      Assets/Scenes/MainScene.unity
  16. +12
    -7
      Assets/Scipts/Timer.cs

Assets/AmplifyShaderEditor/Examples/HD SRP Samples.unitypackage.meta → Assets/AmplifyShaderEditor/Examples/Official.meta View File

@ -1,5 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: d1c0b77896049554fa4b635531caf741
guid: d32786c99caa66e41baea4ab6d1c1cb8
folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

Assets/AmplifyShaderEditor/Examples/LW SRP Samples.unitypackage.meta → Assets/AmplifyShaderEditor/Examples/Official/CustomRTRain.meta View File

@ -1,5 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 6ecbfd0a046659943a69328c98ff0442
guid: 917f314cd7500ab41a37e0c60edaf755
folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

Assets/AmplifyShaderEditor/Examples/Official/CustomRTRain/Custom RT Samples.unitypackage.meta → Assets/AmplifyShaderEditor/Examples/Official/SimpleTerrain.meta View File

@ -1,5 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 88dfe89a073bdf748bf05396f5285cdd
guid: e14f9199031928442a76fcb851644355
folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

Assets/AmplifyShaderEditor/Examples/Official/SimpleTerrain/ApplyGrassWindToTerrain.unitypackage.meta → Assets/AmplifyShaderEditor/Examples/Official/Substance.meta View File

@ -1,5 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 11f44bcb01ea56742bb7177b439b1a4f
guid: 3a1c9292d8fac714e9091922355abcd7
folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

+ 0
- 7
Assets/AmplifyShaderEditor/Examples/Official/Substance/LegacySubstanceExample.unitypackage.meta View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 490e8164148c52c468b633dcc1c12d57
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/AmplifyShaderEditor/Examples/Official/Substance2018.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 50c3f69bf74856340867f04dd9288b24
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 0
- 7
Assets/AmplifyShaderEditor/Examples/Official/Substance2018/Substance2018.unitypackage.meta View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: af7de8b91a27c254fa1bd24c01ae6e8e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 211faf49d0bea6c4081e4e1135d19686
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 0
- 7
Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/CustomRTTemplates.unitypackage.meta View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 191365b4aece81443875ae2bb7243b55
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cc9e432e1a0a4764f80870c080173cb7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 0
- 7
Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/HDSRPTemplates (Legacy).unitypackage.meta View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 4dc1afbcc68875c4780502f5e6b80158
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 0
- 7
Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/HDSRPTemplates.unitypackage.meta View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 9a5e61a8b3421b944863d0946e32da0a
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 0
- 7
Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/LWSRPTemplates (Legacy).unitypackage.meta View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: b53d2f3b156ff104f90d4d7693d769c8
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 0
- 7
Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/LWSRPTemplates.unitypackage.meta View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 4c816894a3147d343891060451241bfe
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 5
- 2
Assets/Scenes/MainScene.unity View File

@ -1314,8 +1314,11 @@ MonoBehaviour:
MaxTimer: 180 MaxTimer: 180
Pivot: {fileID: 264010775} Pivot: {fileID: 264010775}
Sun: {fileID: 2018855991} Sun: {fileID: 2018855991}
Dawn: {r: 1, g: 0.490047, b: 0, a: 1}
Noon: {r: 1, g: 0.97088087, b: 0, a: 1}
Dawn: 125
Noon: 248
sunR: 255
sunB: 0
SunImage: {fileID: 2018855992}
mode: {fileID: 340012153} mode: {fileID: 340012153}
--- !u!4 &340012150 --- !u!4 &340012150
Transform: Transform:

+ 12
- 7
Assets/Scipts/Timer.cs View File

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

Loading…
Cancel
Save