Cozy Wather + buld systeme
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
namespace DistantLands.Cozy
|
||||
{
|
||||
public class CZY_UIManager : MonoBehaviour
|
||||
{
|
||||
CozyWeather weatherSphere;
|
||||
public Image fuzzyTimeIcon;
|
||||
public Sprite sunriseIcon;
|
||||
public Sprite sunsetIcon;
|
||||
public Sprite dayIcon;
|
||||
public Sprite nightIcon;
|
||||
|
||||
public TMP_Text currentTime;
|
||||
public TMP_Text currentDate;
|
||||
public TMP_Text currentWeather;
|
||||
public TMP_Text currentTemp;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
weatherSphere = CozyWeather.instance;
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
if (weatherSphere.dayPercentage < new MeridiemTime(5, 30))
|
||||
fuzzyTimeIcon.sprite = nightIcon;
|
||||
else if (weatherSphere.dayPercentage < new MeridiemTime(9, 30))
|
||||
fuzzyTimeIcon.sprite = sunriseIcon;
|
||||
else if (weatherSphere.dayPercentage < new MeridiemTime(17, 00))
|
||||
fuzzyTimeIcon.sprite = dayIcon;
|
||||
else if (weatherSphere.dayPercentage < new MeridiemTime(21, 00))
|
||||
fuzzyTimeIcon.sprite = sunsetIcon;
|
||||
else
|
||||
fuzzyTimeIcon.sprite = nightIcon;
|
||||
|
||||
currentTime.text = $"{(weatherSphere.timeModule.currentTime.hours % 12 == 0 ? 12 : weatherSphere.timeModule.currentTime.hours % 12):D2}:{weatherSphere.timeModule.currentTime.minutes:D2} {(weatherSphere.timeModule.currentTime.hours > 12 ? "PM" : "AM")}";
|
||||
currentWeather.text = weatherSphere.weatherModule.ecosystem.currentWeather.name;
|
||||
|
||||
weatherSphere.timeModule.GetCurrentMonth(out string monthName, out int monthDay, out float monthPercentage);
|
||||
currentDate.text = $"{monthName.Substring(0, 3)} {monthDay}";
|
||||
|
||||
currentTemp.text = $"{Mathf.Floor(weatherSphere.climateModule.currentTemperature)}° F";
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 83b3b267b2877a94aae11c1f9dc2f3e8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Samples~/UI Samples/Runtime/CZY_UIManager.cs
|
||||
uploadId: 939148
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "DistantLands.Cozy.UI.Runtime",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:5492a51f516277543a92d676903897bf",
|
||||
"GUID:6055be8ebefd69e48b49212b09b47b2f"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a01a0643e7a4d1e4999649520f460e07
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Samples~/UI Samples/Runtime/DistantLands.Cozy.UI.Runtime.asmdef
|
||||
uploadId: 939148
|
||||
Reference in New Issue
Block a user