diff --git a/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/RadioComponent.prefab b/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/RadioComponent.prefab index 928718e..88a6cc7 100644 --- a/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/RadioComponent.prefab +++ b/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/RadioComponent.prefab @@ -243,6 +243,7 @@ RectTransform: m_Children: - {fileID: 8830349552323726862} - {fileID: 5831318964179428642} + - {fileID: 1672302704265545114} m_Father: {fileID: 6553454962824877765} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -288,6 +289,141 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!1 &3169894272624406815 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1672302704265545114} + - component: {fileID: 4775938652859990520} + - component: {fileID: 2773999932382198781} + m_Layer: 17 + m_Name: EditUnderline + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1672302704265545114 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3169894272624406815} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7165789494254489964} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 1.5, y: 8.1} + m_SizeDelta: {x: 200, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &4775938652859990520 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3169894272624406815} + m_CullTransparentMesh: 1 +--- !u!114 &2773999932382198781 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3169894272624406815} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: ___.___ + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 4b68adbcc8fecb04899ef4099b51d83d, type: 2} + m_sharedMaterial: {fileID: 1138958138483197462, guid: 4b68adbcc8fecb04899ef4099b51d83d, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4291948924 + m_fontColor: {r: 0.4862745, g: 0.94509804, b: 0.81960785, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 30 + m_fontSizeBase: 30 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: -6 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!1 &3400891327296201365 GameObject: m_ObjectHideFlags: 0 @@ -988,6 +1124,7 @@ MonoBehaviour: _frequencyText: {fileID: 1745892785861053448} _standByFrequencyText: {fileID: 8151093581666850098} _isSelectedIcon: {fileID: 2970647689031799624} + _editingUnderline: {fileID: 3169894272624406815} --- !u!114 &2333064660428131205 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/Scripts/Components/RadioComponent.asset b/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/Scripts/Components/RadioComponent.asset index c4f6da1..11ecc29 100644 --- a/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/Scripts/Components/RadioComponent.asset +++ b/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/Scripts/Components/RadioComponent.asset @@ -44,7 +44,7 @@ MonoBehaviour: Data: - Name: Entry: 12 - Data: 10 + Data: 11 - Name: Entry: 7 Data: @@ -592,6 +592,60 @@ MonoBehaviour: - Name: Entry: 8 Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: _editingUnderline + - Name: $v + Entry: 7 + Data: 33|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _editingUnderline + - Name: k__BackingField + Entry: 9 + Data: 17 + - Name: k__BackingField + Entry: 9 + Data: 17 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 34|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 35|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/DRAIMS/Scripts/Components/RadioComponent.cs b/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/Scripts/Components/RadioComponent.cs index 7868f75..310175d 100644 --- a/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/Scripts/Components/RadioComponent.cs +++ b/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/Scripts/Components/RadioComponent.cs @@ -25,6 +25,8 @@ public class RadioComponent : UdonSharpBehaviour { [SerializeField] private GameObject _isSelectedIcon; + [SerializeField] private GameObject _editingUnderline; + [PublicAPI] public void _InitComponent(FDMiFloat frequency, FDMiFloat standByFrequency, FDMiBool isReceive, FDMiBool isTransmit, DRAIMS draims) { @@ -56,5 +58,13 @@ public void _OnTransmitChange() { _transmitIcon.SetActive(_isTransmit.Data); } + + public void _SwipeFrequency() { + // ReSharper disable once SwapViaDeconstruction + var newStandByFrequency = _frequency.Data; + + _frequency.Data = _standByFrequency.Data; + _standByFrequency.Data = newStandByFrequency; + } } } diff --git a/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/Scripts/Pages/DraimsVHFPage.cs b/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/Scripts/Pages/DraimsVHFPage.cs index 2365b37..d61efc7 100644 --- a/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/Scripts/Pages/DraimsVHFPage.cs +++ b/src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/Scripts/Pages/DraimsVHFPage.cs @@ -48,7 +48,22 @@ public override void _FirstInitPage(DRAIMS draims) { _vhf1Component._InitComponent(_vhf1Frequency, _vhf1StandByFrequency, _isVHF1Receive, _isVHF1Transmit, draims); _vhf2Component._InitComponent(_vhf2Frequency, _vhf2StandByFrequency, _isVHF2Receive, _isVHF2Transmit, draims); _vhf3Component._InitComponent(_vhf3Frequency, _vhf3StandByFrequency, _isVHF3Receive, _isVHF3Transmit, draims); + } + + public override void _OnKeyPressed(DRAIMSKeyType keyType) { + base._OnKeyPressed(keyType); + switch (keyType) { + case DRAIMSKeyType.SelectionLeft1: + _vhf1Component._SwipeFrequency(); + break; + case DRAIMSKeyType.SelectionLeft2: + _vhf2Component._SwipeFrequency(); + break; + case DRAIMSKeyType.SelectionLeft3: + _vhf3Component._SwipeFrequency(); + break; + } } } }