added TimeUI

This commit is contained in:
j.mei7
2022-02-19 13:19:03 +01:00
parent 059b62ed8a
commit b8bbd7c248
12 changed files with 3085 additions and 376 deletions

View File

@@ -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
View File

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

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4311e961a11edf545ba020d711a5b017
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Fonts/Pixeled.ttf Normal file

Binary file not shown.

View 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

View File

@@ -1,6 +1,7 @@
using System; using System;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using TMPro;
public class Calendar : MonoBehaviour public class Calendar : MonoBehaviour
{ {
@@ -11,6 +12,13 @@ public class Calendar : MonoBehaviour
[SerializeField] [SerializeField]
Color currentDayColor; Color currentDayColor;
Color originDayColor; Color originDayColor;
[SerializeField]
TextMeshProUGUI monthText;
[SerializeField]
TextMeshProUGUI yearText;
private void Start() private void Start()
{ {
daysTransform = transform.Find("Days"); daysTransform = transform.Find("Days");
@@ -32,6 +40,9 @@ public class Calendar : MonoBehaviour
int daysInMonth = DateTime.DaysInMonth(dateTime.Year, dateTime.Month); int daysInMonth = DateTime.DaysInMonth(dateTime.Year, dateTime.Month);
monthText.text = dateTime.ToString("MMMM");
yearText.text = dateTime.ToString("yyyy");
counter = 1; counter = 1;
while (counter <= 31) while (counter <= 31)
{ {

23
Assets/Scripts/TimeUI.cs Normal file
View 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");
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 96eb4d4e2ea286047a0c7e6976b6f811 guid: e980066e5baa94e4c993240ec95348fe
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2

View File

@@ -39,6 +39,7 @@ Material:
m_Texture: {fileID: 0} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats: m_Floats:
- _Ambient: 0.5 - _Ambient: 0.5
- _Bevel: 0.5 - _Bevel: 0.5
@@ -102,6 +103,7 @@ Material:
- _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1} - _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1} - _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5} - _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}
m_BuildTextureStacks: []
--- !u!114 &11400000 --- !u!114 &11400000
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -119,11 +121,11 @@ MonoBehaviour:
materialHashCode: 225402433 materialHashCode: 225402433
m_Version: 1.1.0 m_Version: 1.1.0
m_SourceFontFileGUID: 8a2b9e2a607dd2143b58c44bc32410b4 m_SourceFontFileGUID: 8a2b9e2a607dd2143b58c44bc32410b4
m_SourceFontFile_EditorRef: {fileID: 12800000, guid: 8a2b9e2a607dd2143b58c44bc32410b4, m_SourceFontFile_EditorRef: {fileID: 12800000, guid: 8a2b9e2a607dd2143b58c44bc32410b4, type: 3}
type: 3}
m_SourceFontFile: {fileID: 12800000, guid: 8a2b9e2a607dd2143b58c44bc32410b4, type: 3} m_SourceFontFile: {fileID: 12800000, guid: 8a2b9e2a607dd2143b58c44bc32410b4, type: 3}
m_AtlasPopulationMode: 1 m_AtlasPopulationMode: 1
m_FaceInfo: m_FaceInfo:
m_FaceIndex: 0
m_FamilyName: Electronic Highway Sign m_FamilyName: Electronic Highway Sign
m_StyleName: Regular m_StyleName: Regular
m_PointSize: 144 m_PointSize: 144
@@ -267,15 +269,20 @@ Texture2D:
Hash: 00000000000000000000000000000000 Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4 m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0 m_DownscaleFallback: 0
m_IsAlphaChannelOptional: 0
serializedVersion: 2 serializedVersion: 2
m_Width: 0 m_Width: 0
m_Height: 0 m_Height: 0
m_CompleteImageSize: 0 m_CompleteImageSize: 0
m_MipsStripped: 0
m_TextureFormat: 1 m_TextureFormat: 1
m_MipCount: 1 m_MipCount: 1
m_IsReadable: 1 m_IsReadable: 1
m_IsPreProcessed: 0
m_IgnoreMasterTextureLimit: 0
m_StreamingMipmaps: 0 m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0 m_StreamingMipmapsPriority: 0
m_VTOnly: 0
m_AlphaIsTransparency: 0 m_AlphaIsTransparency: 0
m_ImageCount: 1 m_ImageCount: 1
m_TextureDimension: 2 m_TextureDimension: 2
@@ -289,9 +296,11 @@ Texture2D:
m_WrapW: 0 m_WrapW: 0
m_LightmapFormat: 0 m_LightmapFormat: 0
m_ColorSpace: 0 m_ColorSpace: 0
m_PlatformBlob:
image data: 0 image data: 0
_typelessdata: _typelessdata:
m_StreamData: m_StreamData:
serializedVersion: 2
offset: 0 offset: 0
size: 0 size: 0
path: path:

View File

@@ -86,7 +86,7 @@ MonoBehaviour:
m_HSlider: 0 m_HSlider: 0
m_VSlider: 0 m_VSlider: 0
m_IgnoreScrollWheelUntilClicked: 0 m_IgnoreScrollWheelUntilClicked: 0
m_EnableMouseInput: 0 m_EnableMouseInput: 1
m_EnableSliderZoomHorizontal: 0 m_EnableSliderZoomHorizontal: 0
m_EnableSliderZoomVertical: 0 m_EnableSliderZoomVertical: 0
m_UniformScale: 1 m_UniformScale: 1
@@ -186,8 +186,8 @@ MonoBehaviour:
y: 0 y: 0
width: 305 width: 305
height: 615 height: 615
m_MinSize: {x: 200, y: 200} m_MinSize: {x: 201, y: 221}
m_MaxSize: {x: 4000, y: 4000} m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 6} m_ActualView: {fileID: 6}
m_Panes: m_Panes:
- {fileID: 6} - {fileID: 6}
@@ -224,9 +224,9 @@ MonoBehaviour:
m_SceneHierarchy: m_SceneHierarchy:
m_TreeViewState: m_TreeViewState:
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 0}
m_SelectedIDs: 02a4ffff m_SelectedIDs: c2e4ffff
m_LastClickedID: -23550 m_LastClickedID: -6974
m_ExpandedIDs: da36ffff02a4ffff20fbfffffa6a0000 m_ExpandedIDs: 2efbffff806b0000946b0000406c0000
m_RenameOverlay: m_RenameOverlay:
m_UserAcceptedRename: 0 m_UserAcceptedRename: 0
m_Name: m_Name:
@@ -269,8 +269,8 @@ MonoBehaviour:
y: 0 y: 0
width: 1172 width: 1172
height: 615 height: 615
m_MinSize: {x: 100, y: 100} m_MinSize: {x: 102, y: 121}
m_MaxSize: {x: 4000, y: 4000} m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 2} m_ActualView: {fileID: 2}
m_Panes: m_Panes:
- {fileID: 8} - {fileID: 8}
@@ -524,9 +524,9 @@ MonoBehaviour:
m_PlayAudio: 0 m_PlayAudio: 0
m_AudioPlay: 0 m_AudioPlay: 0
m_Position: m_Position:
m_Target: {x: 750.26764, y: 190.90263, z: 12.011427} m_Target: {x: 709.718, y: 439.9017, z: 11.596173}
speed: 2 speed: 2
m_Value: {x: 750.26764, y: 190.90263, z: 12.011427} m_Value: {x: 705.57996, y: 435.271, z: 11.689445}
m_RenderMode: 0 m_RenderMode: 0
m_CameraMode: m_CameraMode:
drawMode: 0 drawMode: 0
@@ -577,9 +577,9 @@ MonoBehaviour:
speed: 2 speed: 2
m_Value: {x: 0, y: 0, z: 0, w: 1} m_Value: {x: 0, y: 0, z: 0, w: 1}
m_Size: m_Size:
m_Target: 249.03864 m_Target: 216.59595
speed: 2 speed: 2
m_Value: 249.03864 m_Value: 207.26884
m_Ortho: m_Ortho:
m_Target: 1 m_Target: 1
speed: 2 speed: 2
@@ -672,22 +672,22 @@ MonoBehaviour:
m_SkipHidden: 0 m_SkipHidden: 0
m_SearchArea: 1 m_SearchArea: 1
m_Folders: m_Folders:
- Assets/Sprites - Assets/TextMesh Pro
m_Globs: [] m_Globs: []
m_OriginalText: m_OriginalText:
m_ViewMode: 1 m_ViewMode: 1
m_StartGridSize: 74 m_StartGridSize: 74
m_LastFolders: m_LastFolders:
- Assets/Sprites - Assets/TextMesh Pro
m_LastFoldersGridSize: 74 m_LastFoldersGridSize: 74
m_LastProjectPath: M:\UnityProjects\2d-top-down m_LastProjectPath: M:\UnityProjects\2d-top-down
m_LockTracker: m_LockTracker:
m_IsLocked: 0 m_IsLocked: 0
m_FolderTreeState: m_FolderTreeState:
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 181}
m_SelectedIDs: 966f0000 m_SelectedIDs: 2e710000
m_LastClickedID: 28566 m_LastClickedID: 28974
m_ExpandedIDs: 00000000826f0000846f0000946f0000966f0000d46f000000ca9a3bffffff7f m_ExpandedIDs: 00000000fc700000fe70000000710000027100001e7100002e710000ca73000000ca9a3bffffff7f
m_RenameOverlay: m_RenameOverlay:
m_UserAcceptedRename: 0 m_UserAcceptedRename: 0
m_Name: m_Name:
@@ -715,7 +715,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 0}
m_SelectedIDs: m_SelectedIDs:
m_LastClickedID: 0 m_LastClickedID: 0
m_ExpandedIDs: 00000000826f0000846f0000 m_ExpandedIDs: 00000000fc700000fe7000000071000002710000
m_RenameOverlay: m_RenameOverlay:
m_UserAcceptedRename: 0 m_UserAcceptedRename: 0
m_Name: m_Name:
@@ -740,10 +740,10 @@ MonoBehaviour:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_ResourceFile: m_ResourceFile:
m_ListAreaState: m_ListAreaState:
m_SelectedInstanceIDs: 02a4ffff m_SelectedInstanceIDs: c2e4ffff
m_LastClickedInstanceID: -23550 m_LastClickedInstanceID: -6974
m_HadKeyboardFocusLastEvent: 1 m_HadKeyboardFocusLastEvent: 1
m_ExpandedInstanceIDs: c62300006a8e0000f25e00008861000000000000586d0000 m_ExpandedInstanceIDs: c62300006a8e0000f25e00008861000000000000586d00007ea700006cedffff
m_RenameOverlay: m_RenameOverlay:
m_UserAcceptedRename: 0 m_UserAcceptedRename: 0
m_Name: m_Name:
@@ -818,8 +818,8 @@ MonoBehaviour:
y: 0 y: 0
width: 443 width: 443
height: 939 height: 939
m_MinSize: {x: 275, y: 50} m_MinSize: {x: 276, y: 71}
m_MaxSize: {x: 4000, y: 4000} m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 13} m_ActualView: {fileID: 13}
m_Panes: m_Panes:
- {fileID: 13} - {fileID: 13}
@@ -856,7 +856,7 @@ MonoBehaviour:
m_ObjectsLockedBeforeSerialization: [] m_ObjectsLockedBeforeSerialization: []
m_InstanceIDsLockedBeforeSerialization: m_InstanceIDsLockedBeforeSerialization:
m_PreviewResizer: m_PreviewResizer:
m_CachedPref: 160 m_CachedPref: -160
m_ControlHash: -371814159 m_ControlHash: -371814159
m_PrefName: Preview_InspectorPreview m_PrefName: Preview_InspectorPreview
m_LastInspectedObjectInstanceID: -1 m_LastInspectedObjectInstanceID: -1