diff --git a/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/Clock/Clock.asset b/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/Clock/Clock.asset index ef2a108..9b99d0d 100644 --- a/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/Clock/Clock.asset +++ b/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/Clock/Clock.asset @@ -44,7 +44,7 @@ MonoBehaviour: Data: - Name: Entry: 12 - Data: 7 + Data: 8 - Name: Entry: 7 Data: @@ -489,6 +489,72 @@ MonoBehaviour: - Name: Entry: 8 Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: _isDateShow + - Name: $v + Entry: 7 + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _isDateShow + - Name: k__BackingField + Entry: 9 + Data: 29 + - Name: k__BackingField + Entry: 9 + Data: 29 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 3 + - Name: + Entry: 7 + Data: 36|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 37|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 38|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: - Name: Entry: 13 Data: diff --git a/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/Clock/Clock.cs b/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/Clock/Clock.cs index 511d3d9..0cfff57 100644 --- a/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/Clock/Clock.cs +++ b/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/Clock/Clock.cs @@ -19,6 +19,8 @@ public class Clock : UdonSharpBehaviour { [HideInInspector] [UdonSynced] [SerializeField] private float _chronoOffsetTime; [HideInInspector] [UdonSynced] [SerializeField] private bool _isChronoRunning; + [HideInInspector] [UdonSynced] [SerializeField] private bool _isDateShow; + [PublicAPI] public void _OnInit() { if (Networking.IsOwner(gameObject)) _ResetChrono(); @@ -32,8 +34,14 @@ public void _OnLostPower() { private void LateUpdate() { var currentDateTime = DateTime.UtcNow; - _dateTimeText.text = currentDateTime.ToString("HH:MM"); - _secondYearText.text = currentDateTime.ToString("ss"); + if (_isDateShow) { + _dateTimeText.text = currentDateTime.ToString("MM:dd"); + _secondYearText.text = currentDateTime.ToString("yy"); + } + else { + _dateTimeText.text = currentDateTime.ToString("HH:MM"); + _secondYearText.text = currentDateTime.ToString("ss"); + } if (float.IsNaN(_chronoStartTime)) { _chronoText.text = ""; @@ -90,5 +98,14 @@ private void _TakeOwnership() { if (Networking.IsOwner(gameObject)) return; Networking.SetOwner(Networking.LocalPlayer, gameObject); } + + [PublicAPI] + public void _ToggleDate() { + _TakeOwnership(); + + _isDateShow = !_isDateShow; + + RequestSerialization(); + } } } diff --git a/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Prefab/V320neo.prefab b/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Prefab/V320neo.prefab index c7cc7ea..658993d 100644 --- a/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Prefab/V320neo.prefab +++ b/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Prefab/V320neo.prefab @@ -48175,6 +48175,7 @@ Transform: m_Children: - {fileID: 3691487593711279355} - {fileID: 4785755772916647149} + - {fileID: 3846737398644536512} m_Father: {fileID: 6201961823668611207} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &3066462451155329133 @@ -63616,6 +63617,116 @@ Transform: - {fileID: 5041555298105131643} m_Father: {fileID: 5828276618077622785} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &4603785348176206502 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3846737398644536512} + - component: {fileID: 6798902213543827725} + - component: {fileID: 2556402753523877529} + - component: {fileID: 46158173117493365} + m_Layer: 27 + m_Name: ToggleDateButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3846737398644536512 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4603785348176206502} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.1477, y: 1.605, z: 11.874} + m_LocalScale: {x: 0.01, y: 0.01, z: 0.01} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1023587924125399084} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &6798902213543827725 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4603785348176206502} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &2556402753523877529 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4603785348176206502} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6effb45436024fa4e83a0b5f933b29b3, type: 3} + m_Name: + m_EditorClassIdentifier: + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: [] + _udonSharpBackingUdonBehaviour: {fileID: 46158173117493365} + controlName: Toggle Date + _targetBehaviour: {fileID: 4096691667790793828} + _leftClickEventName: _ToggleDate + _rightClickEventName: + _middleClickEventName: + _scrollUpEventName: + _scrollDownEventName: +--- !u!114 &46158173117493365 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4603785348176206502} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3} + m_Name: + m_EditorClassIdentifier: + interactTextPlacement: {fileID: 0} + interactText: Use + interactTextGO: {fileID: 0} + proximity: 2 + SynchronizePosition: 0 + AllowCollisionOwnershipTransfer: 0 + Reliable: 0 + _syncMethod: 0 + serializedProgramAsset: {fileID: 11400000, guid: 29d4ae005176b804facc1191240b9de2, + type: 2} + programSource: {fileID: 11400000, guid: 6740a87533fb9214082ee378ad845cb9, type: 2} + serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBt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GwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUHBQcF + publicVariablesUnityEngineObjects: [] + publicVariablesSerializationDataFormat: 0 --- !u!1 &4649262741577984520 GameObject: m_ObjectHideFlags: 0