mirror of
https://github.com/DerTyp7/example-top-down-unity.git
synced 2025-10-29 12:32:09 +01:00
added TimeUI
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CharSpriteManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
List<CharSprite> charSprites = new List<CharSprite>();
|
||||
|
||||
private void Start()
|
||||
{
|
||||
LoadIntoList();
|
||||
}
|
||||
void LoadIntoList()
|
||||
{
|
||||
CharSprite[] loadedRes = Resources.FindObjectsOfTypeAll<CharSprite>();
|
||||
|
||||
foreach (CharSprite sprite in loadedRes)
|
||||
{
|
||||
Debug.Log(sprite.name);
|
||||
charSprites.Add(sprite);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
8
Assets/Fonts.meta
Normal file
8
Assets/Fonts.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: abe8966a3013efb4d89db6b94c13d3e1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
2346
Assets/Fonts/Pixeled SDF.asset
Normal file
2346
Assets/Fonts/Pixeled SDF.asset
Normal file
File diff suppressed because one or more lines are too long
8
Assets/Fonts/Pixeled SDF.asset.meta
Normal file
8
Assets/Fonts/Pixeled SDF.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4311e961a11edf545ba020d711a5b017
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Fonts/Pixeled.ttf
Normal file
BIN
Assets/Fonts/Pixeled.ttf
Normal file
Binary file not shown.
21
Assets/Fonts/Pixeled.ttf.meta
Normal file
21
Assets/Fonts/Pixeled.ttf.meta
Normal file
@@ -0,0 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 18e434a1ced50c74c8947e26dc8c7698
|
||||
TrueTypeFontImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
fontSize: 16
|
||||
forceTextureCase: -2
|
||||
characterSpacing: 0
|
||||
characterPadding: 1
|
||||
includeFontData: 1
|
||||
fontNames:
|
||||
- Pixeled
|
||||
fallbackFontReferences: []
|
||||
customCharacters:
|
||||
fontRenderingMode: 3
|
||||
ascentCalculationMode: 1
|
||||
useLegacyBoundsCalculation: 0
|
||||
shouldRoundAdvanceValue: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
public class Calendar : MonoBehaviour
|
||||
{
|
||||
@@ -11,6 +12,13 @@ public class Calendar : MonoBehaviour
|
||||
[SerializeField]
|
||||
Color currentDayColor;
|
||||
Color originDayColor;
|
||||
|
||||
[SerializeField]
|
||||
TextMeshProUGUI monthText;
|
||||
[SerializeField]
|
||||
TextMeshProUGUI yearText;
|
||||
|
||||
|
||||
private void Start()
|
||||
{
|
||||
daysTransform = transform.Find("Days");
|
||||
@@ -32,6 +40,9 @@ public class Calendar : MonoBehaviour
|
||||
|
||||
int daysInMonth = DateTime.DaysInMonth(dateTime.Year, dateTime.Month);
|
||||
|
||||
monthText.text = dateTime.ToString("MMMM");
|
||||
yearText.text = dateTime.ToString("yyyy");
|
||||
|
||||
counter = 1;
|
||||
while (counter <= 31)
|
||||
{
|
||||
|
||||
23
Assets/Scripts/TimeUI.cs
Normal file
23
Assets/Scripts/TimeUI.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
|
||||
public class TimeUI : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
TextMeshProUGUI dateTimeText;
|
||||
TimeManager timeManager;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
timeManager = GameObject.Find("GameManager").GetComponent<TimeManager>();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
DateTime dateTime = timeManager.GetDateTime();
|
||||
if (dateTimeText != null)
|
||||
dateTimeText.text = dateTime.ToString("hh:mm tt / dd.MM.yyyy");
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 96eb4d4e2ea286047a0c7e6976b6f811
|
||||
guid: e980066e5baa94e4c993240ec95348fe
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -39,6 +39,7 @@ Material:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _Ambient: 0.5
|
||||
- _Bevel: 0.5
|
||||
@@ -102,6 +103,7 @@ Material:
|
||||
- _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}
|
||||
m_BuildTextureStacks: []
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -119,11 +121,11 @@ MonoBehaviour:
|
||||
materialHashCode: 225402433
|
||||
m_Version: 1.1.0
|
||||
m_SourceFontFileGUID: 8a2b9e2a607dd2143b58c44bc32410b4
|
||||
m_SourceFontFile_EditorRef: {fileID: 12800000, guid: 8a2b9e2a607dd2143b58c44bc32410b4,
|
||||
type: 3}
|
||||
m_SourceFontFile_EditorRef: {fileID: 12800000, guid: 8a2b9e2a607dd2143b58c44bc32410b4, type: 3}
|
||||
m_SourceFontFile: {fileID: 12800000, guid: 8a2b9e2a607dd2143b58c44bc32410b4, type: 3}
|
||||
m_AtlasPopulationMode: 1
|
||||
m_FaceInfo:
|
||||
m_FaceIndex: 0
|
||||
m_FamilyName: Electronic Highway Sign
|
||||
m_StyleName: Regular
|
||||
m_PointSize: 144
|
||||
@@ -267,15 +269,20 @@ Texture2D:
|
||||
Hash: 00000000000000000000000000000000
|
||||
m_ForcedFallbackFormat: 4
|
||||
m_DownscaleFallback: 0
|
||||
m_IsAlphaChannelOptional: 0
|
||||
serializedVersion: 2
|
||||
m_Width: 0
|
||||
m_Height: 0
|
||||
m_CompleteImageSize: 0
|
||||
m_MipsStripped: 0
|
||||
m_TextureFormat: 1
|
||||
m_MipCount: 1
|
||||
m_IsReadable: 1
|
||||
m_IsPreProcessed: 0
|
||||
m_IgnoreMasterTextureLimit: 0
|
||||
m_StreamingMipmaps: 0
|
||||
m_StreamingMipmapsPriority: 0
|
||||
m_VTOnly: 0
|
||||
m_AlphaIsTransparency: 0
|
||||
m_ImageCount: 1
|
||||
m_TextureDimension: 2
|
||||
@@ -289,9 +296,11 @@ Texture2D:
|
||||
m_WrapW: 0
|
||||
m_LightmapFormat: 0
|
||||
m_ColorSpace: 0
|
||||
m_PlatformBlob:
|
||||
image data: 0
|
||||
_typelessdata:
|
||||
m_StreamData:
|
||||
serializedVersion: 2
|
||||
offset: 0
|
||||
size: 0
|
||||
path:
|
||||
|
||||
Reference in New Issue
Block a user