Feat: 场景视图mod,UI框架更换标题
This commit is contained in:
@@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UIFrame", "UIFrame\UIFrame.
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Theme", "Theme\Theme.csproj", "{7CCF2612-AF15-42F0-B472-8C8F8CAB9B20}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SceneView", "SceneView\SceneView.csproj", "{87AA16B9-C7F9-456E-8F57-CE05F393D91F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -39,6 +41,10 @@ Global
|
||||
{7CCF2612-AF15-42F0-B472-8C8F8CAB9B20}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7CCF2612-AF15-42F0-B472-8C8F8CAB9B20}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7CCF2612-AF15-42F0-B472-8C8F8CAB9B20}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{87AA16B9-C7F9-456E-8F57-CE05F393D91F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{87AA16B9-C7F9-456E-8F57-CE05F393D91F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{87AA16B9-C7F9-456E-8F57-CE05F393D91F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{87AA16B9-C7F9-456E-8F57-CE05F393D91F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=D_003A_005Csteam_005Csteamapps_005Ccommon_005CEscape_0020from_0020Duckov_005CDuckov_005FData_005CManaged_005CFMODUnity_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=D_003A_005Csteam_005Csteamapps_005Ccommon_005CEscape_0020from_0020Duckov_005CDuckov_005FData_005CManaged_005CSodaLocalization_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=D_003A_005Csteam_005Csteamapps_005Cworkshop_005Ccontent_005C3167020_005C3589088839_005CHarmonyLoadMod_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=D_003A_005Csteam_005Csteamapps_005Cworkshop_005Ccontent_005C3167020_005C3590674339_005CModConfig_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=D_003A_005Csteam_005Csteamapps_005Cworkshop_005Ccontent_005C3167020_005C3591672666_005Cqingye_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=D_003A_005Csteam_005Csteamapps_005Cworkshop_005Ccontent_005C3167020_005C3596659565_005CCustomQuack_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAIMainBrain_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003F52_003F7c426cea_003FAIMainBrain_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAimTargetFinder_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F492b6cef9eac4cd497c1ffcbfcb9161f197200_003Fa9_003F4ac92f25_003FAimTargetFinder_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAudioManager_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003F95_003F5092a809_003FAudioManager_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ABehaviour_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fc39a522eee05469b8171a6cfeb646c591543b0_003Fc1_003Faa1a31b2_003FBehaviour_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
@@ -18,6 +21,7 @@
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACharacterEquipmentController_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003F35_003F0c1fbbe5_003FCharacterEquipmentController_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACharacterMainControl_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F492b6cef9eac4cd497c1ffcbfcb9161f197200_003F2c_003Fe5626d7e_003FCharacterMainControl_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACharacterMainControl_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003F4c_003Faffc257a_003FCharacterMainControl_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACharacterRandomPreset_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003Fd5_003Fb696ff66_003FCharacterRandomPreset_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACopyTextButton_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003Fc4_003F9995fb11_003FCopyTextButton_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACustomFaceInstance_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003Ff5_003F7e299618_003FCustomFaceInstance_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADamageInfo_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003F0b_003F36368d2b_003FDamageInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
@@ -25,8 +29,10 @@
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADuckovScreenCapturer_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F492b6cef9eac4cd497c1ffcbfcb9161f197200_003F59_003F92754824_003FDuckovScreenCapturer_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFadeElement_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003F9b_003Fbe78cf8b_003FFadeElement_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFadeGroup_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003F4e_003F69f8fcae_003FFadeGroup_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFogOfWarManager_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003Fd3_003Fb21152a5_003FFogOfWarManager_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AGameCamera_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F492b6cef9eac4cd497c1ffcbfcb9161f197200_003Fd2_003F4160411a_003FGameCamera_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AGameManager_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003F94_003Fdd33b16b_003FGameManager_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AGameObject_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fc39a522eee05469b8171a6cfeb646c591543b0_003F52_003F998640fe_003FGameObject_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AGameplayDataSettings_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F492b6cef9eac4cd497c1ffcbfcb9161f197200_003Fa4_003Ffea6779d_003FGameplayDataSettings_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AGameplayDataSettings_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003F1f_003F8b814bde_003FGameplayDataSettings_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AGameplayUIManager_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003Fcc_003Fe767eb5a_003FGameplayUIManager_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
@@ -38,6 +44,7 @@
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMainCharacterStatValueDisplay_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003F08_003Fd04928fd_003FMainCharacterStatValueDisplay_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMainMenu_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003F21_003F0ec534a6_003FMainMenu_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AModBehaviour_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F15eaac0daac842bca117926c0c9be2781a00_003F37_003Fa09d99b2_003FModBehaviour_002Ecs_002Fz_003A4_002D3/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AModBehaviour_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4784c8b601ed4e3c93b990a18b8bd7a4a800_003F3e_003Fb80788cb_003FModBehaviour_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AModBehaviour_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003Ff3_003Ff5f2b19a_003FModBehaviour_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AModBehaviour_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Faf3c3aa7ce14487c914dade28d96504e70a00_003F26_003Fe998e749_003FModBehaviour_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AModBehaviour_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fe495fb8cdd21493497febf8ce397a8d71400_003F4a_003F0c719bc6_003FModBehaviour_002Ecs_002Fz_003A2_002D1/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
@@ -46,6 +53,7 @@
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMonoBehaviour_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fc39a522eee05469b8171a6cfeb646c591543b0_003F02_003F65608a5e_003FMonoBehaviour_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMultiInteractionMenu_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003F88_003F0d34c6e2_003FMultiInteractionMenu_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMultiInteraction_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003Ff8_003F995da332_003FMultiInteraction_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AObject_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fc39a522eee05469b8171a6cfeb646c591543b0_003F4b_003F927bbb51_003FObject_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AOcclusionFadeChecker_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F492b6cef9eac4cd497c1ffcbfcb9161f197200_003F05_003F7aa60d94_003FOcclusionFadeChecker_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AOcclusionFadeChecker_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003Fa8_003Fd12e1cf7_003FOcclusionFadeChecker_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AOcclusionFadeManager_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F492b6cef9eac4cd497c1ffcbfcb9161f197200_003F70_003F6aba3c97_003FOcclusionFadeManager_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
@@ -53,6 +61,7 @@
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APrefabPool_00601_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F2fb2e03687cc4f6182420d823a41eca07200_003F05_003F8982f5f5_003FPrefabPool_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ASceneLoadingContext_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003Fbf_003F2b3732af_003FSceneLoadingContext_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AScriptableObject_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fc39a522eee05469b8171a6cfeb646c591543b0_003F4d_003F1a33cb14_003FScriptableObject_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ASpriteRendererLocalizor_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F85f08cf721894642b6034bb4eee4d75b4000_003F8f_003F9f8025e8_003FSpriteRendererLocalizor_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATitle_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003Fe8_003F42124cdd_003FTitle_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AUIPrefabsReference_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fae7b55f2e79e4a30b19151f53aa9af29197600_003Fb5_003F49d2159e_003FUIPrefabsReference_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AVolumeComponent_002Ecs_002Fl_003AC_0021_003FUsers_003FLenovo_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb02e352b027d497b8571da05e536c2f682000_003F36_003F74cee2c4_003FVolumeComponent_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
|
||||
@@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("折纸的小箱子")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.1")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.1+0206a83f56b5a794fe2f173b4a047cc4f0d4cd90")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.1+786025f720c05ae486c8c66d3a6114633ccd0dbf")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("HideCharacter")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("HideCharacter")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.1")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
87960f6ca296aa48c51c30197c7d764ab1cc8c1b2d2ae919555af9f2602b2fa1
|
||||
5da31913e91a183301e6883819f7ba57fc0b3e4eba9910ae6ee0eafc05d2af54
|
||||
|
||||
Binary file not shown.
@@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("折纸的小箱子")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.1")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.1+5d69efbc3f80a5422cef0884e02fb27adf20b467")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.1+786025f720c05ae486c8c66d3a6114633ccd0dbf")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("HideCharacter")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("HideCharacter")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.1")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
769c2595fb11f290049896c9b627f3b39daef1dc9f833f4947c915142e78d8d2
|
||||
12b8810f5c5efba722348e9a42589fd931584289646df256a80c8a5aac0c67b6
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
17619928534493660
|
||||
17623343068138064
|
||||
@@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("HitFeedback")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+0206a83f56b5a794fe2f173b4a047cc4f0d4cd90")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+786025f720c05ae486c8c66d3a6114633ccd0dbf")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("HitFeedback")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("HitFeedback")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
0e8871f70d957c8690d2d7e899b7c26cc6fec6a1db85ba1988bdbe458697eb11
|
||||
011b05448cb33a5df382363baa29281f37b1217de1b772941e072e5e1e318697
|
||||
|
||||
Binary file not shown.
@@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("HitFeedback")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5d69efbc3f80a5422cef0884e02fb27adf20b467")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+786025f720c05ae486c8c66d3a6114633ccd0dbf")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("HitFeedback")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("HitFeedback")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
fa83406df4fd7108a6156ab0271b4cddce6abc73c66cbcefdb2f1419643481ef
|
||||
d5e421014b0d794da78442d8a65960e244ed2b8a5d6b7b2541d1354650cfeae5
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
17620100186005303
|
||||
17623343068138064
|
||||
66
MyMainMenu/GameMainTitle.cs
Normal file
66
MyMainMenu/GameMainTitle.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace MyMainMenu
|
||||
{
|
||||
public class GameMainTitle
|
||||
{
|
||||
public string mainTitleObjName = "MainTitle";
|
||||
private GameObject? titleObject;
|
||||
private Image? logoImage;
|
||||
private Sprite? logoSprite;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
Debug.Log("Initialize method started.");
|
||||
// 查找所有 GameObject,并筛选出名称匹配的对象
|
||||
GameObject[] allObjects = Object.FindObjectsOfType<GameObject>();
|
||||
titleObject = Array.Find(allObjects, obj => obj.name == mainTitleObjName);
|
||||
if (titleObject == null)
|
||||
{
|
||||
Debug.LogWarning("titleObject not found with name: " + mainTitleObjName);
|
||||
return;
|
||||
}
|
||||
logoImage = titleObject.GetComponentInChildren<Image>(true);
|
||||
if (logoImage != null)
|
||||
{
|
||||
Debug.Log("Image component found on titleObject.");
|
||||
var texture = ImageLoader.LoadImageFromFile(@"C:\Users\Lenovo\Pictures\异噬.png");
|
||||
if (texture != null)
|
||||
{
|
||||
Debug.Log("Texture loaded successfully.");
|
||||
logoSprite=Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero);
|
||||
logoImage.sprite = logoSprite;
|
||||
Debug.Log("Sprite created and assigned to image component.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("Failed to load texture from file: C:\\Users\\Lenovo\\Pictures\\异噬.png");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("Image component not found on titleObject.");
|
||||
}
|
||||
Debug.Log("Initialize method finished.");
|
||||
}
|
||||
|
||||
public void SetTitle()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (logoImage!=null&&logoImage.sprite!=logoSprite)
|
||||
{
|
||||
Debug.Log("logoImage is not null and its sprite is different from logoSprite. Updating logoImage.sprite."); // Add Log inside the if condition
|
||||
logoImage.sprite = logoSprite;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
67
MyMainMenu/ImageLoader.cs
Normal file
67
MyMainMenu/ImageLoader.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MyMainMenu
|
||||
{
|
||||
public class ImageLoader
|
||||
{
|
||||
/// <summary>
|
||||
/// 从指定文件路径加载图片并创建 Texture2D。
|
||||
/// 支持常用的图片格式 (如 .png, .jpg, .jpeg, .bmp, .tga)
|
||||
/// </summary>
|
||||
/// <param name="filePath">图片文件的绝对路径。</param>
|
||||
/// <param name="createNewTexture">如果为true,则创建一个新的Texture2D对象并加载图片数据。如果为false,它会尝试加载到默认的空白Texture2D对象上,但通常建议使用true。</param>
|
||||
/// <param name="linear">指定纹理是否加载为线性颜色空间 (true) 或 sRGB 颜色空间 (false)。</param>
|
||||
/// <returns>加载成功的 Texture2D 对象,如果失败则返回 null。</returns>
|
||||
public static Texture2D? LoadImageFromFile(string filePath, bool createNewTexture = true, bool linear = false)
|
||||
{
|
||||
if (string.IsNullOrEmpty(filePath))
|
||||
{
|
||||
Debug.LogError("ImageLoader: 图片文件路径为空或无效。");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!File.Exists(filePath))
|
||||
{
|
||||
Debug.LogError($"ImageLoader: 文件不存在于路径: {filePath}");
|
||||
return null;
|
||||
}
|
||||
|
||||
Texture2D? texture = null;
|
||||
try
|
||||
{
|
||||
var fileData = File.ReadAllBytes(filePath);
|
||||
if (createNewTexture)
|
||||
{
|
||||
texture = new Texture2D(2, 2, TextureFormat.RGBA32, false, linear);
|
||||
}
|
||||
else if (texture == null)
|
||||
{
|
||||
Debug.LogError("ImageLoader: 未能提供现有Texture2D用于加载,且createNewTexture为false。");
|
||||
return null;
|
||||
}
|
||||
|
||||
var success = texture.LoadImage(fileData, true);
|
||||
|
||||
if (!success)
|
||||
{
|
||||
Debug.LogError($"ImageLoader: 无法加载图片数据到Texture2D。请检查文件是否为有效的图片格式或是否损坏: {filePath}");
|
||||
UnityEngine.Object.Destroy(texture); // 销毁失败的纹理对象
|
||||
return null;
|
||||
}
|
||||
return texture;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"ImageLoader: 加载图片时发生错误: {filePath} - {ex.Message}");
|
||||
if (texture != null)
|
||||
{
|
||||
UnityEngine.Object.Destroy(texture); // 发生异常时销毁已创建的纹理
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
40
MyMainMenu/ModBehaviour.cs
Normal file
40
MyMainMenu/ModBehaviour.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace MyMainMenu
|
||||
{
|
||||
public class ModBehaviour:Duckov.Modding.ModBehaviour
|
||||
{
|
||||
public GameMainTitle gameMainTitle=new GameMainTitle();
|
||||
|
||||
void Awake()
|
||||
{
|
||||
SceneManager.sceneLoaded += OnSceneLoaded;
|
||||
}
|
||||
void OnDestroy()
|
||||
{
|
||||
SceneManager.sceneLoaded -= OnSceneLoaded;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
gameMainTitle.Update();
|
||||
}
|
||||
|
||||
protected override void OnAfterSetup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnBeforeDeactivate()
|
||||
{
|
||||
|
||||
}
|
||||
void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
||||
{
|
||||
gameMainTitle.Initialize();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
25
MyMainMenu/MyMainMenu.csproj
Normal file
25
MyMainMenu/MyMainMenu.csproj
Normal file
@@ -0,0 +1,25 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<DuckovPath>D:\steam\steamapps\common\Escape from Duckov</DuckovPath>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<OutputPath>D:\steam\steamapps\common\Escape from Duckov\Duckov_Data\Mods\MyMainMenu</OutputPath>
|
||||
<GenerateDependencyFile>false</GenerateDependencyFile>
|
||||
<DebugType>none</DebugType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="$(DuckovPath)\Duckov_Data\Managed\TeamSoda.*" Private="False" />
|
||||
<Reference Include="$(DuckovPath)\Duckov_Data\Managed\ItemStatsSystem.dll" Private="False" />
|
||||
<Reference Include="$(DuckovPath)\Duckov_Data\Managed\Unity*" Private="False" />
|
||||
<Reference Include="$(DuckovPath)\Duckov_Data\Managed\FMODUnity.dll" Private="False" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Lib.Harmony" Version="2.4.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
79
MyMainMenu/obj/MyMainMenu.csproj.nuget.dgspec.json
Normal file
79
MyMainMenu/obj/MyMainMenu.csproj.nuget.dgspec.json
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"D:\\vs_project\\DuckovMods\\MyMainMenu\\MyMainMenu.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"D:\\vs_project\\DuckovMods\\MyMainMenu\\MyMainMenu.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "D:\\vs_project\\DuckovMods\\MyMainMenu\\MyMainMenu.csproj",
|
||||
"projectName": "MyMainMenu",
|
||||
"projectPath": "D:\\vs_project\\DuckovMods\\MyMainMenu\\MyMainMenu.csproj",
|
||||
"packagesPath": "C:\\Users\\Lenovo\\.nuget\\packages\\",
|
||||
"outputPath": "D:\\vs_project\\DuckovMods\\MyMainMenu\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"fallbackFolders": [
|
||||
"D:\\vsShare\\NuGetPackages"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\Lenovo\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"netstandard2.1"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.1": {
|
||||
"targetAlias": "netstandard2.1",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
},
|
||||
"restoreAuditProperties": {
|
||||
"enableAudit": "true",
|
||||
"auditLevel": "low",
|
||||
"auditMode": "direct"
|
||||
},
|
||||
"SdkAnalysisLevel": "9.0.300"
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.1": {
|
||||
"targetAlias": "netstandard2.1",
|
||||
"dependencies": {
|
||||
"Lib.Harmony": {
|
||||
"target": "Package",
|
||||
"version": "[2.4.1, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"NETStandard.Library": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.306\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
16
MyMainMenu/obj/MyMainMenu.csproj.nuget.g.props
Normal file
16
MyMainMenu/obj/MyMainMenu.csproj.nuget.g.props
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Lenovo\.nuget\packages\;D:\vsShare\NuGetPackages</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.14.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="C:\Users\Lenovo\.nuget\packages\" />
|
||||
<SourceRoot Include="D:\vsShare\NuGetPackages\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
2
MyMainMenu/obj/MyMainMenu.csproj.nuget.g.targets
Normal file
2
MyMainMenu/obj/MyMainMenu.csproj.nuget.g.targets
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
|
||||
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
|
||||
22
MyMainMenu/obj/Release/MyMainMenu.AssemblyInfo.cs
Normal file
22
MyMainMenu/obj/Release/MyMainMenu.AssemblyInfo.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("MyMainMenu")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+786025f720c05ae486c8c66d3a6114633ccd0dbf")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("MyMainMenu")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("MyMainMenu")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// 由 MSBuild WriteCodeFragment 类生成。
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
b3ef56f4757a02383188b14d0c23f7bbd423d41a4f4cba0a12acb8688e7f7494
|
||||
@@ -0,0 +1,8 @@
|
||||
is_global = true
|
||||
build_property.RootNamespace = MyMainMenu
|
||||
build_property.ProjectDir = D:\vs_project\DuckovMods\MyMainMenu\
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||
build_property.CsWinRTUseWindowsUIXamlProjections = false
|
||||
build_property.EffectiveAnalysisLevelStyle =
|
||||
build_property.EnableCodeStyleSeverity =
|
||||
BIN
MyMainMenu/obj/Release/MyMainMenu.assets.cache
Normal file
BIN
MyMainMenu/obj/Release/MyMainMenu.assets.cache
Normal file
Binary file not shown.
BIN
MyMainMenu/obj/Release/MyMainMenu.csproj.AssemblyReference.cache
Normal file
BIN
MyMainMenu/obj/Release/MyMainMenu.csproj.AssemblyReference.cache
Normal file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
744bd96403f4872d2e8276a6d2820746941939c618dff3317b8abe5c93d2d407
|
||||
@@ -0,0 +1,7 @@
|
||||
D:\steam\steamapps\common\Escape from Duckov\Duckov_Data\Mods\MyMainMenu\MyMainMenu.dll
|
||||
D:\vs_project\DuckovMods\MyMainMenu\obj\Release\MyMainMenu.csproj.AssemblyReference.cache
|
||||
D:\vs_project\DuckovMods\MyMainMenu\obj\Release\MyMainMenu.GeneratedMSBuildEditorConfig.editorconfig
|
||||
D:\vs_project\DuckovMods\MyMainMenu\obj\Release\MyMainMenu.AssemblyInfoInputs.cache
|
||||
D:\vs_project\DuckovMods\MyMainMenu\obj\Release\MyMainMenu.AssemblyInfo.cs
|
||||
D:\vs_project\DuckovMods\MyMainMenu\obj\Release\MyMainMenu.csproj.CoreCompileInputs.cache
|
||||
D:\vs_project\DuckovMods\MyMainMenu\obj\Release\MyMainMenu.dll
|
||||
BIN
MyMainMenu/obj/Release/MyMainMenu.dll
Normal file
BIN
MyMainMenu/obj/Release/MyMainMenu.dll
Normal file
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
|
||||
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("MyMainMenu")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+786025f720c05ae486c8c66d3a6114633ccd0dbf")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("MyMainMenu")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("MyMainMenu")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// 由 MSBuild WriteCodeFragment 类生成。
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
b3ef56f4757a02383188b14d0c23f7bbd423d41a4f4cba0a12acb8688e7f7494
|
||||
@@ -0,0 +1,8 @@
|
||||
is_global = true
|
||||
build_property.RootNamespace = MyMainMenu
|
||||
build_property.ProjectDir = D:\vs_project\DuckovMods\MyMainMenu\
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||
build_property.CsWinRTUseWindowsUIXamlProjections = false
|
||||
build_property.EffectiveAnalysisLevelStyle =
|
||||
build_property.EnableCodeStyleSeverity =
|
||||
BIN
MyMainMenu/obj/Release/netstandard2.1/MyMainMenu.assets.cache
Normal file
BIN
MyMainMenu/obj/Release/netstandard2.1/MyMainMenu.assets.cache
Normal file
Binary file not shown.
239
MyMainMenu/obj/project.assets.json
Normal file
239
MyMainMenu/obj/project.assets.json
Normal file
@@ -0,0 +1,239 @@
|
||||
{
|
||||
"version": 3,
|
||||
"targets": {
|
||||
".NETStandard,Version=v2.1": {
|
||||
"Lib.Harmony/2.4.1": {
|
||||
"type": "package",
|
||||
"dependencies": {
|
||||
"Lib.Harmony.Ref": "2.4.1"
|
||||
},
|
||||
"compile": {
|
||||
"lib/netstandard2.0/_._": {}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/_._": {}
|
||||
}
|
||||
},
|
||||
"Lib.Harmony.Ref/2.4.1": {
|
||||
"type": "package",
|
||||
"dependencies": {
|
||||
"System.Reflection.Emit": "4.7.0"
|
||||
},
|
||||
"compile": {
|
||||
"ref/netstandard2.0/0Harmony.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Reflection.Emit/4.7.0": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
"ref/netstandard2.1/_._": {}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.1/_._": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Lib.Harmony/2.4.1": {
|
||||
"sha512": "iLTZi/kKKB18jYEIwReZSx2xXyVUh4J1swReMgvYBBBn4tzA1Nd0PJlVyntY5BDdSiXSxzmvjc/3OYfFs0YwFg==",
|
||||
"type": "package",
|
||||
"path": "lib.harmony/2.4.1",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"HarmonyLogo.png",
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"lib.harmony.2.4.1.nupkg.sha512",
|
||||
"lib.harmony.nuspec",
|
||||
"lib/net35/0Harmony.dll",
|
||||
"lib/net35/0Harmony.pdb",
|
||||
"lib/net35/0Harmony.xml",
|
||||
"lib/net452/0Harmony.dll",
|
||||
"lib/net452/0Harmony.pdb",
|
||||
"lib/net452/0Harmony.xml",
|
||||
"lib/net472/0Harmony.dll",
|
||||
"lib/net472/0Harmony.pdb",
|
||||
"lib/net472/0Harmony.xml",
|
||||
"lib/net48/0Harmony.dll",
|
||||
"lib/net48/0Harmony.pdb",
|
||||
"lib/net48/0Harmony.xml",
|
||||
"lib/net5.0/0Harmony.dll",
|
||||
"lib/net5.0/0Harmony.pdb",
|
||||
"lib/net5.0/0Harmony.xml",
|
||||
"lib/net6.0/0Harmony.dll",
|
||||
"lib/net6.0/0Harmony.pdb",
|
||||
"lib/net6.0/0Harmony.xml",
|
||||
"lib/net7.0/0Harmony.dll",
|
||||
"lib/net7.0/0Harmony.pdb",
|
||||
"lib/net7.0/0Harmony.xml",
|
||||
"lib/net8.0/0Harmony.dll",
|
||||
"lib/net8.0/0Harmony.pdb",
|
||||
"lib/net8.0/0Harmony.xml",
|
||||
"lib/net9.0/0Harmony.dll",
|
||||
"lib/net9.0/0Harmony.pdb",
|
||||
"lib/net9.0/0Harmony.xml",
|
||||
"lib/netcoreapp3.0/0Harmony.dll",
|
||||
"lib/netcoreapp3.0/0Harmony.pdb",
|
||||
"lib/netcoreapp3.0/0Harmony.xml",
|
||||
"lib/netcoreapp3.1/0Harmony.dll",
|
||||
"lib/netcoreapp3.1/0Harmony.pdb",
|
||||
"lib/netcoreapp3.1/0Harmony.xml",
|
||||
"lib/netstandard2.0/_._"
|
||||
]
|
||||
},
|
||||
"Lib.Harmony.Ref/2.4.1": {
|
||||
"sha512": "+u1y2Qd6OlSUQ8JtrsrSo3adnAsrXMJ2YPYtbW+FAmdPI5yw34M9VX4bKl8ZwRuUzaGzZIz+oGMbn/yS4fWtZw==",
|
||||
"type": "package",
|
||||
"path": "lib.harmony.ref/2.4.1",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"HarmonyLogo.png",
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"lib.harmony.ref.2.4.1.nupkg.sha512",
|
||||
"lib.harmony.ref.nuspec",
|
||||
"ref/netstandard2.0/0Harmony.dll",
|
||||
"ref/netstandard2.0/0Harmony.xml"
|
||||
]
|
||||
},
|
||||
"System.Reflection.Emit/4.7.0": {
|
||||
"sha512": "VR4kk8XLKebQ4MZuKuIni/7oh+QGFmZW3qORd1GvBq/8026OpW501SzT/oypwiQl4TvT8ErnReh/NzY9u+C6wQ==",
|
||||
"type": "package",
|
||||
"path": "system.reflection.emit/4.7.0",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"LICENSE.TXT",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"lib/MonoAndroid10/_._",
|
||||
"lib/MonoTouch10/_._",
|
||||
"lib/net45/_._",
|
||||
"lib/netcore50/System.Reflection.Emit.dll",
|
||||
"lib/netcoreapp2.0/_._",
|
||||
"lib/netstandard1.1/System.Reflection.Emit.dll",
|
||||
"lib/netstandard1.1/System.Reflection.Emit.xml",
|
||||
"lib/netstandard1.3/System.Reflection.Emit.dll",
|
||||
"lib/netstandard2.0/System.Reflection.Emit.dll",
|
||||
"lib/netstandard2.0/System.Reflection.Emit.xml",
|
||||
"lib/netstandard2.1/_._",
|
||||
"lib/xamarinios10/_._",
|
||||
"lib/xamarinmac20/_._",
|
||||
"lib/xamarintvos10/_._",
|
||||
"lib/xamarinwatchos10/_._",
|
||||
"ref/MonoAndroid10/_._",
|
||||
"ref/MonoTouch10/_._",
|
||||
"ref/net45/_._",
|
||||
"ref/netcoreapp2.0/_._",
|
||||
"ref/netstandard1.1/System.Reflection.Emit.dll",
|
||||
"ref/netstandard1.1/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/de/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/es/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/fr/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/it/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/ja/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/ko/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/ru/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/zh-hans/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/zh-hant/System.Reflection.Emit.xml",
|
||||
"ref/netstandard2.0/System.Reflection.Emit.dll",
|
||||
"ref/netstandard2.0/System.Reflection.Emit.xml",
|
||||
"ref/netstandard2.1/_._",
|
||||
"ref/xamarinios10/_._",
|
||||
"ref/xamarinmac20/_._",
|
||||
"ref/xamarintvos10/_._",
|
||||
"ref/xamarinwatchos10/_._",
|
||||
"runtimes/aot/lib/netcore50/System.Reflection.Emit.dll",
|
||||
"runtimes/aot/lib/netcore50/System.Reflection.Emit.xml",
|
||||
"system.reflection.emit.4.7.0.nupkg.sha512",
|
||||
"system.reflection.emit.nuspec",
|
||||
"useSharedDesignerContext.txt",
|
||||
"version.txt"
|
||||
]
|
||||
}
|
||||
},
|
||||
"projectFileDependencyGroups": {
|
||||
".NETStandard,Version=v2.1": [
|
||||
"Lib.Harmony >= 2.4.1"
|
||||
]
|
||||
},
|
||||
"packageFolders": {
|
||||
"C:\\Users\\Lenovo\\.nuget\\packages\\": {},
|
||||
"D:\\vsShare\\NuGetPackages": {}
|
||||
},
|
||||
"project": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "D:\\vs_project\\DuckovMods\\MyMainMenu\\MyMainMenu.csproj",
|
||||
"projectName": "MyMainMenu",
|
||||
"projectPath": "D:\\vs_project\\DuckovMods\\MyMainMenu\\MyMainMenu.csproj",
|
||||
"packagesPath": "C:\\Users\\Lenovo\\.nuget\\packages\\",
|
||||
"outputPath": "D:\\vs_project\\DuckovMods\\MyMainMenu\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"fallbackFolders": [
|
||||
"D:\\vsShare\\NuGetPackages"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\Lenovo\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"netstandard2.1"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.1": {
|
||||
"targetAlias": "netstandard2.1",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
},
|
||||
"restoreAuditProperties": {
|
||||
"enableAudit": "true",
|
||||
"auditLevel": "low",
|
||||
"auditMode": "direct"
|
||||
},
|
||||
"SdkAnalysisLevel": "9.0.300"
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.1": {
|
||||
"targetAlias": "netstandard2.1",
|
||||
"dependencies": {
|
||||
"Lib.Harmony": {
|
||||
"target": "Package",
|
||||
"version": "[2.4.1, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"NETStandard.Library": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.306\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
12
MyMainMenu/obj/project.nuget.cache
Normal file
12
MyMainMenu/obj/project.nuget.cache
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "/bMBU9IYEbw=",
|
||||
"success": true,
|
||||
"projectFilePath": "D:\\vs_project\\DuckovMods\\MyMainMenu\\MyMainMenu.csproj",
|
||||
"expectedPackageFiles": [
|
||||
"C:\\Users\\Lenovo\\.nuget\\packages\\lib.harmony\\2.4.1\\lib.harmony.2.4.1.nupkg.sha512",
|
||||
"C:\\Users\\Lenovo\\.nuget\\packages\\lib.harmony.ref\\2.4.1\\lib.harmony.ref.2.4.1.nupkg.sha512",
|
||||
"C:\\Users\\Lenovo\\.nuget\\packages\\system.reflection.emit\\4.7.0\\system.reflection.emit.4.7.0.nupkg.sha512"
|
||||
],
|
||||
"logs": []
|
||||
}
|
||||
1
MyMainMenu/obj/project.packagespec.json
Normal file
1
MyMainMenu/obj/project.packagespec.json
Normal file
@@ -0,0 +1 @@
|
||||
"restore":{"projectUniqueName":"D:\\vs_project\\DuckovMods\\MyMainMenu\\MyMainMenu.csproj","projectName":"MyMainMenu","projectPath":"D:\\vs_project\\DuckovMods\\MyMainMenu\\MyMainMenu.csproj","outputPath":"D:\\vs_project\\DuckovMods\\MyMainMenu\\obj\\","projectStyle":"PackageReference","fallbackFolders":["D:\\vsShare\\NuGetPackages"],"originalTargetFrameworks":["netstandard2.1"],"sources":{"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\":{},"https://api.nuget.org/v3/index.json":{}},"frameworks":{"netstandard2.1":{"targetAlias":"netstandard2.1","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"},"SdkAnalysisLevel":"9.0.300"}"frameworks":{"netstandard2.1":{"targetAlias":"netstandard2.1","dependencies":{"Lib.Harmony":{"target":"Package","version":"[2.4.1, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"NETStandard.Library":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\9.0.306\\RuntimeIdentifierGraph.json"}}
|
||||
1
MyMainMenu/obj/rider.project.model.nuget.info
Normal file
1
MyMainMenu/obj/rider.project.model.nuget.info
Normal file
@@ -0,0 +1 @@
|
||||
17623501729185691
|
||||
1
MyMainMenu/obj/rider.project.restore.info
Normal file
1
MyMainMenu/obj/rider.project.restore.info
Normal file
@@ -0,0 +1 @@
|
||||
17623501729185691
|
||||
@@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("折纸的小箱子")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+0206a83f56b5a794fe2f173b4a047cc4f0d4cd90")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+786025f720c05ae486c8c66d3a6114633ccd0dbf")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("SceneSnapshot")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("SceneSnapshot")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
76527c0524d74c181c8c103eb804bb9ea72920abff0b6da2de1250e7811cd906
|
||||
d0b14bb5a2fe44e4165960f86b2001d300338f5655dddb8b391c1544fb8fcca4
|
||||
|
||||
Binary file not shown.
@@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("折纸的小箱子")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5d69efbc3f80a5422cef0884e02fb27adf20b467")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+786025f720c05ae486c8c66d3a6114633ccd0dbf")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("SceneSnapshot")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("SceneSnapshot")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
4cb78221af3251625ca99f740da024b47f366123d3acdfd330074e35f359044e
|
||||
0377007546f92d23941a0c0e6a0cef8c6022db4ce07a6a7b98556714f9c594f1
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
17619862901687226
|
||||
17623343068138064
|
||||
60
SceneView/CanvasControl.cs
Normal file
60
SceneView/CanvasControl.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SceneView
|
||||
{
|
||||
public class CanvasControl : MonoBehaviour
|
||||
{
|
||||
public SceneViewPanel? sceneViewPanel;
|
||||
|
||||
public static Vector2 panelSize = new Vector2(500, 800);
|
||||
|
||||
public const string ViewCanvasName = "_SceneViewCanvas";
|
||||
public const string ShowAim = "LOGO";
|
||||
|
||||
private void Start()
|
||||
{
|
||||
InitCanvas();
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.F2))
|
||||
{
|
||||
Debug.Log("切换");
|
||||
sceneViewPanel.gameObject.SetActive(!sceneViewPanel.gameObject.activeSelf);
|
||||
if (sceneViewPanel.gameObject.activeSelf)
|
||||
{
|
||||
sceneViewPanel.Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void InitCanvas()
|
||||
{
|
||||
var canvasObj = new GameObject(ViewCanvasName);
|
||||
var canvas = canvasObj.AddComponent<Canvas>();
|
||||
canvas.renderMode = RenderMode.ScreenSpaceOverlay;
|
||||
canvas.sortingOrder = 1000;
|
||||
canvasObj.AddComponent<CanvasScaler>();
|
||||
canvasObj.AddComponent<GraphicRaycaster>();
|
||||
DontDestroyOnLoad(canvasObj);
|
||||
|
||||
sceneViewPanel=CreateSceneViewPanel(canvasObj.transform);
|
||||
}
|
||||
public static SceneViewPanel CreateSceneViewPanel(Transform parent)
|
||||
{
|
||||
var panelObj = new GameObject("SceneViewPanel");
|
||||
panelObj.transform.SetParent(parent, false);
|
||||
var sceneViewPanel = panelObj.AddComponent<SceneViewPanel>();
|
||||
var panelImage = panelObj.AddComponent<Image>();
|
||||
panelImage.color = new Color(0.5f, 0.5f, 0.5f, 0.3f);
|
||||
|
||||
var rectTransform = panelObj.GetComponent<RectTransform>();
|
||||
rectTransform.sizeDelta = panelSize;
|
||||
|
||||
return sceneViewPanel;
|
||||
}
|
||||
}
|
||||
}
|
||||
432
SceneView/ControlUtilities.cs
Normal file
432
SceneView/ControlUtilities.cs
Normal file
@@ -0,0 +1,432 @@
|
||||
using System;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SceneView
|
||||
{
|
||||
[Serializable]
|
||||
public struct RectTransformConfig
|
||||
{
|
||||
public Vector2 AnchorMin;
|
||||
public Vector2 AnchorMax;
|
||||
public Vector2 AnchoredPosition;
|
||||
public Vector2 SizeDelta;
|
||||
public Vector2 OffsetMin;
|
||||
public Vector2 OffsetMax;
|
||||
public Vector2 Pivot;
|
||||
|
||||
// 默认配置
|
||||
public static readonly RectTransformConfig Default = new RectTransformConfig(
|
||||
anchorMin: new Vector2(0, 1),
|
||||
anchorMax: new Vector2(0, 1),
|
||||
anchoredPosition: Vector2.zero,
|
||||
sizeDelta: Vector2.zero,
|
||||
offsetMin: Vector2.zero,
|
||||
offsetMax: Vector2.zero,
|
||||
pivot: new Vector2(0.5f, 0.5f) // 默认居中轴心点
|
||||
);
|
||||
|
||||
public RectTransformConfig(
|
||||
Vector2 anchorMin,
|
||||
Vector2 anchorMax,
|
||||
Vector2 anchoredPosition,
|
||||
Vector2 sizeDelta,
|
||||
Vector2 offsetMin,
|
||||
Vector2 offsetMax,
|
||||
Vector2 pivot)
|
||||
{
|
||||
AnchorMin = anchorMin;
|
||||
AnchorMax = anchorMax;
|
||||
AnchoredPosition = anchoredPosition;
|
||||
SizeDelta = sizeDelta;
|
||||
OffsetMin = offsetMin;
|
||||
OffsetMax = offsetMax;
|
||||
Pivot = pivot;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public struct ButtonConfig
|
||||
{
|
||||
public RectTransformConfig RectConfig;
|
||||
public Color BackgroundColor;
|
||||
public string Text;
|
||||
public int FontSize;
|
||||
public Color TextColor;
|
||||
public bool RaycastTarget;
|
||||
|
||||
public static readonly ButtonConfig Default = new ButtonConfig(
|
||||
rectConfig: RectTransformConfig.Default,
|
||||
backgroundColor: new Color(0.2f, 0.2f, 0.2f, 1f),
|
||||
text: "Button",
|
||||
fontSize: 18,
|
||||
textColor: Color.white,
|
||||
raycastTarget: true
|
||||
);
|
||||
|
||||
public ButtonConfig(
|
||||
RectTransformConfig rectConfig,
|
||||
Color backgroundColor,
|
||||
string text,
|
||||
int fontSize,
|
||||
Color textColor,
|
||||
bool raycastTarget = true)
|
||||
{
|
||||
RectConfig = rectConfig;
|
||||
BackgroundColor = backgroundColor;
|
||||
Text = text;
|
||||
FontSize = fontSize;
|
||||
TextColor = textColor;
|
||||
RaycastTarget = raycastTarget;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public struct TextConfig
|
||||
{
|
||||
public RectTransformConfig RectConfig;
|
||||
public string Text;
|
||||
public int FontSize;
|
||||
public Color TextColor;
|
||||
public TextAlignmentOptions Alignment;
|
||||
public bool RaycastTarget;
|
||||
|
||||
public static readonly TextConfig Default = new TextConfig(
|
||||
rectConfig: RectTransformConfig.Default,
|
||||
text: "New Text",
|
||||
fontSize: 18,
|
||||
textColor: Color.white,
|
||||
alignment: TextAlignmentOptions.Center,
|
||||
raycastTarget: false
|
||||
);
|
||||
|
||||
public TextConfig(
|
||||
string text,
|
||||
int fontSize,
|
||||
Color textColor,
|
||||
TextAlignmentOptions alignment,
|
||||
bool raycastTarget,
|
||||
RectTransformConfig rectConfig)
|
||||
{
|
||||
RectConfig = rectConfig;
|
||||
Text = text;
|
||||
FontSize = fontSize;
|
||||
TextColor = textColor;
|
||||
Alignment = alignment;
|
||||
RaycastTarget = raycastTarget;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public struct ScrollViewConfig
|
||||
{
|
||||
public Vector2 SizeDelta; // ScrollView 的尺寸
|
||||
public bool Vertical;
|
||||
public bool Horizontal;
|
||||
public Color BackgroundColor;
|
||||
public Vector2 ContentPadding; // 内容区域的内边距(上下左右)
|
||||
|
||||
public static readonly ScrollViewConfig Default = new ScrollViewConfig
|
||||
{
|
||||
SizeDelta = new Vector2(400, 300),
|
||||
Vertical = true,
|
||||
Horizontal = false,
|
||||
BackgroundColor = new Color(0.1f, 0.1f, 0.1f, 0.8f),
|
||||
ContentPadding = new Vector2(10, 10) // (horizontal, vertical)
|
||||
};
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public struct InputFieldConfig
|
||||
{
|
||||
public RectTransformConfig RectConfig;
|
||||
public Color BackgroundColor;
|
||||
public string PlaceholderText;
|
||||
public int PlaceholderFontSize;
|
||||
public Color PlaceholderTextColor;
|
||||
public Color TextColor;
|
||||
public int FontSize;
|
||||
public TextAlignmentOptions TextAlignment;
|
||||
public TMP_InputField.CharacterValidation CharacterValidation;
|
||||
public int CharacterLimit;
|
||||
public static readonly InputFieldConfig Default = new InputFieldConfig(
|
||||
rectConfig: RectTransformConfig.Default,
|
||||
backgroundColor: new Color(0.2f, 0.2f, 0.2f, 1f),
|
||||
placeholderText: "Enter text here",
|
||||
placeholderFontSize: 14,
|
||||
placeholderTextColor: new Color(0.7f, 0.7f, 0.7f, 1f),
|
||||
textColor: Color.white,
|
||||
fontSize: 18,
|
||||
textAlignment: TextAlignmentOptions.Left,
|
||||
characterValidation: TMP_InputField.CharacterValidation.None,
|
||||
characterLimit: 0
|
||||
);
|
||||
public InputFieldConfig(
|
||||
RectTransformConfig rectConfig,
|
||||
Color backgroundColor,
|
||||
string placeholderText,
|
||||
int placeholderFontSize,
|
||||
Color placeholderTextColor,
|
||||
Color textColor,
|
||||
int fontSize,
|
||||
TextAlignmentOptions textAlignment,
|
||||
TMP_InputField.CharacterValidation characterValidation = TMP_InputField.CharacterValidation.None,
|
||||
int characterLimit = 0)
|
||||
{
|
||||
RectConfig = rectConfig;
|
||||
BackgroundColor = backgroundColor;
|
||||
PlaceholderText = placeholderText;
|
||||
PlaceholderFontSize = placeholderFontSize;
|
||||
PlaceholderTextColor = placeholderTextColor;
|
||||
TextColor = textColor;
|
||||
FontSize = fontSize;
|
||||
TextAlignment = textAlignment;
|
||||
CharacterValidation = characterValidation;
|
||||
CharacterLimit = characterLimit;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ControlUtilities
|
||||
{
|
||||
// 通用方法:将 RectTransformConfig 应用于 RectTransform
|
||||
private static void ApplyRectTransformConfig(RectTransform rectTransform, RectTransformConfig config)
|
||||
{
|
||||
rectTransform.anchorMin = config.AnchorMin;
|
||||
rectTransform.anchorMax = config.AnchorMax;
|
||||
rectTransform.pivot = config.Pivot;
|
||||
|
||||
var isStretched = config.SizeDelta == Vector2.zero;
|
||||
|
||||
if (isStretched)
|
||||
{
|
||||
rectTransform.offsetMin = config.OffsetMin;
|
||||
rectTransform.offsetMax = config.OffsetMax;
|
||||
}
|
||||
else
|
||||
{
|
||||
rectTransform.anchoredPosition = config.AnchoredPosition;
|
||||
rectTransform.sizeDelta = config.SizeDelta;
|
||||
}
|
||||
}
|
||||
|
||||
// ========================
|
||||
// 按钮创建
|
||||
// ========================
|
||||
public static (Button? button, TextMeshProUGUI? text) CreateButton(RectTransform? parent, ButtonConfig config,
|
||||
UnityAction? onClick)
|
||||
{
|
||||
var btnObj = new GameObject(config.Text + "Button");
|
||||
var btnRect = btnObj.AddComponent<RectTransform>();
|
||||
btnRect.SetParent(parent, false);
|
||||
|
||||
ApplyRectTransformConfig(btnRect, config.RectConfig);
|
||||
|
||||
var button = btnObj.AddComponent<Button>();
|
||||
var image = btnObj.AddComponent<Image>();
|
||||
image.color = config.BackgroundColor;
|
||||
button.image = image;
|
||||
|
||||
// 创建文本子对象
|
||||
var txtObj = new GameObject("Text (TMP)");
|
||||
var txtRect = txtObj.AddComponent<RectTransform>();
|
||||
txtRect.SetParent(btnRect, false);
|
||||
|
||||
// 文本始终填满按钮(常见做法)
|
||||
ApplyRectTransformConfig(txtRect, new RectTransformConfig(
|
||||
anchorMin: Vector2.zero,
|
||||
anchorMax: Vector2.one,
|
||||
anchoredPosition: Vector2.zero,
|
||||
sizeDelta: Vector2.zero,
|
||||
offsetMin: Vector2.zero,
|
||||
offsetMax: Vector2.zero,
|
||||
pivot: new Vector2(0.5f, 0.5f)
|
||||
));
|
||||
|
||||
var tmpText = txtObj.AddComponent<TextMeshProUGUI>();
|
||||
tmpText.text = config.Text;
|
||||
tmpText.color = config.TextColor;
|
||||
tmpText.alignment = TextAlignmentOptions.Center;
|
||||
tmpText.fontSize = config.FontSize;
|
||||
tmpText.raycastTarget = config.RaycastTarget;
|
||||
if (onClick != null)
|
||||
button.onClick.AddListener(onClick);
|
||||
return (button, tmpText);
|
||||
}
|
||||
|
||||
// ========================
|
||||
// 文本创建(重载)
|
||||
// ========================
|
||||
public static TextMeshProUGUI CreateText(Transform parent, string text)
|
||||
{
|
||||
var config = TextConfig.Default;
|
||||
config.Text = text;
|
||||
return CreateText(parent, config);
|
||||
}
|
||||
|
||||
public static TextMeshProUGUI CreateText(Transform parent, TextConfig config)
|
||||
{
|
||||
var textObj = new GameObject(config.Text + "Text");
|
||||
var textRect = textObj.AddComponent<RectTransform>();
|
||||
textRect.SetParent(parent, false);
|
||||
|
||||
ApplyRectTransformConfig(textRect, config.RectConfig);
|
||||
|
||||
var tmpText = textObj.AddComponent<TextMeshProUGUI>();
|
||||
tmpText.text = config.Text;
|
||||
tmpText.color = config.TextColor;
|
||||
tmpText.alignment = config.Alignment;
|
||||
tmpText.fontSize = config.FontSize;
|
||||
tmpText.raycastTarget = config.RaycastTarget;
|
||||
|
||||
return tmpText;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ========================
|
||||
// 滚动视图创建
|
||||
// ========================
|
||||
public static (ScrollRect scrollRect, RectTransform content) CreateScrollView(
|
||||
Transform parent,
|
||||
ScrollViewConfig config)
|
||||
{
|
||||
// 1. ScrollView 根对象
|
||||
var scrollViewObj = new GameObject("ScrollView");
|
||||
var scrollViewRect = scrollViewObj.AddComponent<RectTransform>();
|
||||
scrollViewRect.SetParent(parent, false);
|
||||
scrollViewRect.sizeDelta = config.SizeDelta;
|
||||
|
||||
var scrollView = scrollViewObj.AddComponent<ScrollRect>();
|
||||
var scrollViewImage = scrollViewObj.AddComponent<Image>();
|
||||
scrollViewImage.color = config.BackgroundColor;
|
||||
scrollViewImage.raycastTarget = true;
|
||||
|
||||
// 2. Viewport 子对象
|
||||
var viewportObj = new GameObject("Viewport");
|
||||
var viewportRect = viewportObj.AddComponent<RectTransform>();
|
||||
viewportRect.SetParent(scrollViewRect, false);
|
||||
viewportRect.anchorMin = Vector2.zero;
|
||||
viewportRect.anchorMax = Vector2.one;
|
||||
viewportRect.offsetMin = Vector2.zero;
|
||||
viewportRect.offsetMax = Vector2.zero;
|
||||
viewportRect.pivot = new Vector2(0.5f, 0.5f);
|
||||
|
||||
var viewportMask = viewportObj.AddComponent<RectMask2D>(); // 或 Mask,但 RectMask2D 性能更好
|
||||
var viewportImage = viewportObj.AddComponent<Image>();
|
||||
viewportImage.color = Color.clear; // 透明背景
|
||||
|
||||
// 3. Content 子对象
|
||||
var contentObj = new GameObject("Content");
|
||||
var contentRect = contentObj.AddComponent<RectTransform>();
|
||||
contentRect.SetParent(viewportRect, false);
|
||||
|
||||
// 设置 Content 的锚点:根据滚动方向决定
|
||||
if (config.Vertical && !config.Horizontal)
|
||||
{
|
||||
// 垂直滚动:宽度拉满,高度自适应
|
||||
contentRect.anchorMin = new Vector2(0, 1);
|
||||
contentRect.anchorMax = new Vector2(1, 1);
|
||||
contentRect.pivot = new Vector2(0.5f, 1);
|
||||
contentRect.anchoredPosition = new Vector2(0, -config.ContentPadding.y);
|
||||
contentRect.sizeDelta = new Vector2(-2 * config.ContentPadding.x, 0); // 左右留边距
|
||||
}
|
||||
else if (config.Horizontal && !config.Vertical)
|
||||
{
|
||||
// 水平滚动:高度拉满,宽度自适应
|
||||
contentRect.anchorMin = new Vector2(0, 0);
|
||||
contentRect.anchorMax = new Vector2(0, 1);
|
||||
contentRect.pivot = new Vector2(0, 0.5f);
|
||||
contentRect.anchoredPosition = new Vector2(config.ContentPadding.x, 0);
|
||||
contentRect.sizeDelta = new Vector2(0, -2 * config.ContentPadding.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 双向滚动:自由布局
|
||||
contentRect.anchorMin = Vector2.zero;
|
||||
contentRect.anchorMax = Vector2.zero;
|
||||
contentRect.pivot = new Vector2(0, 1);
|
||||
contentRect.anchoredPosition = Vector2.zero;
|
||||
contentRect.sizeDelta = Vector2.zero;
|
||||
}
|
||||
|
||||
// 4. 关联 ScrollRect
|
||||
scrollView.viewport = viewportRect;
|
||||
scrollView.content = contentRect;
|
||||
scrollView.vertical = config.Vertical;
|
||||
scrollView.horizontal = config.Horizontal;
|
||||
scrollView.movementType = ScrollRect.MovementType.Elastic;
|
||||
scrollView.inertia = true;
|
||||
scrollView.decelerationRate = 0.135f; // 默认值
|
||||
|
||||
return (scrollView, contentRect);
|
||||
}
|
||||
|
||||
// ========================
|
||||
// 文本编辑器创建
|
||||
// ========================
|
||||
public static (TMP_InputField inputField, TextMeshProUGUI text) CreateInputField(Transform parent,
|
||||
InputFieldConfig config)
|
||||
{
|
||||
var inputFieldObj = new GameObject("InputField");
|
||||
var inputFieldRect = inputFieldObj.AddComponent<RectTransform>();
|
||||
inputFieldRect.SetParent(parent, false);
|
||||
ApplyRectTransformConfig(inputFieldRect, config.RectConfig);
|
||||
var inputField = inputFieldObj.AddComponent<TMP_InputField>();
|
||||
// 背景图像
|
||||
var backgroundImage = inputFieldObj.AddComponent<Image>();
|
||||
backgroundImage.sprite = Resources.Load<Sprite>("UI/Skins/Background");
|
||||
backgroundImage.type = Image.Type.Sliced;
|
||||
backgroundImage.color = config.BackgroundColor;
|
||||
// 输入框文本组件
|
||||
var textObj = new GameObject("Text (TMP)");
|
||||
var textRect = textObj.AddComponent<RectTransform>();
|
||||
textRect.SetParent(inputFieldRect, false);
|
||||
// 文本始终填满输入框
|
||||
ApplyRectTransformConfig(textRect, new RectTransformConfig(
|
||||
anchorMin: Vector2.zero,
|
||||
anchorMax: Vector2.one,
|
||||
anchoredPosition: Vector2.zero,
|
||||
sizeDelta: Vector2.zero,
|
||||
offsetMin: Vector2.zero,
|
||||
offsetMax: Vector2.zero,
|
||||
pivot: new Vector2(0.5f, 0.5f)
|
||||
));
|
||||
var tmpText = textObj.AddComponent<TextMeshProUGUI>();
|
||||
tmpText.text = "";
|
||||
tmpText.color = config.TextColor;
|
||||
tmpText.alignment = config.TextAlignment;
|
||||
tmpText.fontSize = config.FontSize;
|
||||
tmpText.raycastTarget = false;
|
||||
inputField.textComponent = tmpText;
|
||||
// 占位符文本组件
|
||||
var placeholderObj = new GameObject("Placeholder");
|
||||
var placeholderRect = placeholderObj.AddComponent<RectTransform>();
|
||||
placeholderRect.SetParent(inputFieldRect, false);
|
||||
// 占位符文本始终填满输入框
|
||||
ApplyRectTransformConfig(placeholderRect, new RectTransformConfig(
|
||||
anchorMin: Vector2.zero,
|
||||
anchorMax: Vector2.one,
|
||||
anchoredPosition: Vector2.zero,
|
||||
sizeDelta: Vector2.zero,
|
||||
offsetMin: Vector2.zero,
|
||||
offsetMax: Vector2.zero,
|
||||
pivot: new Vector2(0.5f, 0.5f)
|
||||
));
|
||||
var placeholderText = placeholderObj.AddComponent<TextMeshProUGUI>();
|
||||
placeholderText.text = config.PlaceholderText;
|
||||
placeholderText.color = config.PlaceholderTextColor;
|
||||
placeholderText.alignment = config.TextAlignment;
|
||||
placeholderText.fontSize = config.PlaceholderFontSize;
|
||||
placeholderText.raycastTarget = false;
|
||||
inputField.placeholder = placeholderText;
|
||||
// 配置输入字段属性
|
||||
inputField.characterValidation = config.CharacterValidation;
|
||||
inputField.characterLimit = config.CharacterLimit;
|
||||
return (inputField, tmpText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
67
SceneView/FontUtilities.cs
Normal file
67
SceneView/FontUtilities.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TextCore.LowLevel;
|
||||
|
||||
namespace SceneView
|
||||
{
|
||||
public static class FontUtilities
|
||||
{
|
||||
private static readonly Dictionary<string, TMP_FontAsset> _fontCache = new Dictionary<string, TMP_FontAsset>();
|
||||
|
||||
/// <summary>
|
||||
/// 根据字体名称从操作系统加载字体,并创建 TMP_FontAsset(带缓存)
|
||||
/// 非常遗憾,用不了
|
||||
/// </summary>
|
||||
/// <param name="fontName">系统字体名称,如 "Arial", "Microsoft YaHei" 等</param>
|
||||
/// <returns>对应的 TMP_FontAsset,失败则返回 null</returns>
|
||||
public static TMP_FontAsset? GetOrCreateTMPFont(string fontName)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(fontName))
|
||||
return null;
|
||||
|
||||
if (_fontCache.TryGetValue(fontName, out var cached))
|
||||
return cached;
|
||||
|
||||
var baseFont = Font.CreateDynamicFontFromOSFont(fontName, 12); // 12 是临时大小,不影响 TMP 字体质量
|
||||
|
||||
if (baseFont == null || baseFont.dynamic == false)
|
||||
{
|
||||
Debug.LogWarning($"Font '{fontName}' not found in OS.");
|
||||
return null;
|
||||
}
|
||||
|
||||
// 创建 TMP 字体资源
|
||||
var tmpFont = TMP_FontAsset.CreateFontAsset(
|
||||
baseFont,
|
||||
samplingPointSize: 72,
|
||||
atlasPadding: 4,
|
||||
renderMode: GlyphRenderMode.SDFAA,
|
||||
atlasWidth: 1024,
|
||||
atlasHeight: 1024,
|
||||
atlasPopulationMode: AtlasPopulationMode.Dynamic,
|
||||
enableMultiAtlasSupport: true
|
||||
);
|
||||
|
||||
if (tmpFont != null)
|
||||
{
|
||||
_fontCache[fontName] = tmpFont;
|
||||
Debug.Log($"Loaded TMP font: {fontName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError($"Failed to create TMP_FontAsset from font: {fontName}");
|
||||
}
|
||||
|
||||
return tmpFont;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清空缓存(谨慎使用,通常不需要)
|
||||
/// </summary>
|
||||
public static void ClearCache()
|
||||
{
|
||||
_fontCache.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
56
SceneView/ModBehaviour.cs
Normal file
56
SceneView/ModBehaviour.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SceneView
|
||||
{
|
||||
public class ModBehaviour:Duckov.Modding.ModBehaviour
|
||||
{
|
||||
public const string MOD_ID="SceneView";
|
||||
private Harmony? harmony;
|
||||
|
||||
private GameObject? component;
|
||||
private CanvasControl myCanvas;
|
||||
|
||||
protected override void OnAfterSetup()
|
||||
{
|
||||
CreateComponents();
|
||||
if (harmony == null)
|
||||
{
|
||||
harmony=new Harmony(MOD_ID);
|
||||
}
|
||||
harmony.PatchAll();
|
||||
}
|
||||
|
||||
protected override void OnBeforeDeactivate()
|
||||
{
|
||||
RemoveComponents();
|
||||
if (harmony != null)
|
||||
{
|
||||
harmony.UnpatchAll(harmony.Id);
|
||||
}
|
||||
|
||||
harmony = null;
|
||||
}
|
||||
|
||||
private void CreateComponents()
|
||||
{
|
||||
if(component==null)
|
||||
{
|
||||
component = new GameObject("SceneViewControl");
|
||||
myCanvas= component.AddComponent<CanvasControl>();
|
||||
component.SetActive(true);
|
||||
DontDestroyOnLoad(component);
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveComponents()
|
||||
{
|
||||
if (component != null)
|
||||
{
|
||||
GameObject.Destroy(component);
|
||||
component = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
14
SceneView/PatchGameObjectStart.cs
Normal file
14
SceneView/PatchGameObjectStart.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SceneView
|
||||
{
|
||||
// [HarmonyPatch(typeof(GameObject), "Internal_CreateGameObject")]
|
||||
// public class PatchGameObjectStart
|
||||
// {
|
||||
// static void Postfix(GameObject __instance)
|
||||
// {
|
||||
// Debug.Log($"{__instance.name}初始化了");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
15
SceneView/PatchObjectDestroy.cs
Normal file
15
SceneView/PatchObjectDestroy.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using HarmonyLib;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace SceneView
|
||||
{
|
||||
[HarmonyPatch(typeof(Object), nameof(Object.Destroy), new Type[] { typeof(Object)})]
|
||||
public class PatchObjectDestroy
|
||||
{
|
||||
private static void Postfix(Object __instance)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
25
SceneView/SceneView.csproj
Normal file
25
SceneView/SceneView.csproj
Normal file
@@ -0,0 +1,25 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<DuckovPath>D:\steam\steamapps\common\Escape from Duckov</DuckovPath>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<OutputPath>D:\steam\steamapps\common\Escape from Duckov\Duckov_Data\Mods\SceneView</OutputPath>
|
||||
<GenerateDependencyFile>false</GenerateDependencyFile>
|
||||
<DebugType>none</DebugType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="$(DuckovPath)\Duckov_Data\Managed\TeamSoda.*" Private="False" />
|
||||
<Reference Include="$(DuckovPath)\Duckov_Data\Managed\ItemStatsSystem.dll" Private="False" />
|
||||
<Reference Include="$(DuckovPath)\Duckov_Data\Managed\Unity*" Private="False" />
|
||||
<Reference Include="$(DuckovPath)\Duckov_Data\Managed\FMODUnity.dll" Private="False" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Lib.Harmony" Version="2.4.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
220
SceneView/SceneViewPanel.cs
Normal file
220
SceneView/SceneViewPanel.cs
Normal file
@@ -0,0 +1,220 @@
|
||||
using System;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SceneView
|
||||
{
|
||||
public class SceneViewPanel : MonoBehaviour, IDragHandler, IBeginDragHandler
|
||||
{
|
||||
public const float titleHeight = 50;
|
||||
|
||||
private Vector2 shift;
|
||||
public ScrollRect? scrollRect;
|
||||
|
||||
private TreeViewNode? treeViewNode;
|
||||
|
||||
public string currentAimObj;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
currentAimObj = CanvasControl.ShowAim;
|
||||
CreateUI();
|
||||
}
|
||||
|
||||
private void CreateUI()
|
||||
{
|
||||
CreateTitleBar();
|
||||
var scrollConfig = ScrollViewConfig.Default;
|
||||
scrollConfig.Horizontal = true;
|
||||
scrollConfig.SizeDelta = CanvasControl.panelSize - new Vector2(0, titleHeight);
|
||||
var scrollRectArr = ControlUtilities.CreateScrollView(transform, scrollConfig);
|
||||
scrollRect = scrollRectArr.scrollRect;
|
||||
if (scrollRect == null)
|
||||
{
|
||||
Debug.LogError("Failed to create ScrollView.");
|
||||
return;
|
||||
}
|
||||
|
||||
var scrollRectRectTransform = scrollRect.GetComponent<RectTransform>();
|
||||
if (scrollRectRectTransform == null)
|
||||
{
|
||||
Debug.LogError("Failed to get RectTransform for ScrollView.");
|
||||
return;
|
||||
}
|
||||
|
||||
scrollRectRectTransform.anchorMin = new Vector2(0, 0);
|
||||
scrollRectRectTransform.anchorMax = new Vector2(1, 1);
|
||||
scrollRectRectTransform.offsetMin = Vector2.zero;
|
||||
scrollRectRectTransform.offsetMax = new Vector2(0, -titleHeight);
|
||||
|
||||
var content = scrollRect.content.gameObject;
|
||||
if (content == null)
|
||||
{
|
||||
Debug.LogError("Failed to get content for ScrollView.");
|
||||
return;
|
||||
}
|
||||
// var contentRectTransform = content.GetComponent<RectTransform>();
|
||||
// contentRectTransform.anchorMin = Vector2.up;
|
||||
// contentRectTransform.anchorMax = Vector2.one;
|
||||
// contentRectTransform.sizeDelta = Vector2.zero;
|
||||
// contentRectTransform.offsetMin = Vector2.zero;
|
||||
// contentRectTransform.offsetMax = new Vector2(0, 0);
|
||||
|
||||
// var root = new GameObject("root");
|
||||
// root.AddComponent<RectTransform>();
|
||||
// root.transform.SetParent(content.transform, false);
|
||||
|
||||
treeViewNode = content.AddComponent<TreeViewNode>();
|
||||
treeViewNode.UpdateHeight();
|
||||
|
||||
// var vLayout = content.AddComponent<VerticalLayoutGroup>();
|
||||
// vLayout.padding = new RectOffset(2, 2, 2, 2);
|
||||
// vLayout.spacing = 5;
|
||||
// vLayout.childControlWidth = true;
|
||||
// vLayout.childControlHeight = false;
|
||||
// var size= content.AddComponent<ContentSizeFitter>();
|
||||
// size.verticalFit = ContentSizeFitter.FitMode.PreferredSize;
|
||||
// size.horizontalFit = ContentSizeFitter.FitMode.Unconstrained;
|
||||
|
||||
var inputConfig = InputFieldConfig.Default;
|
||||
inputConfig.RectConfig.AnchorMin = Vector2.zero;
|
||||
inputConfig.RectConfig.AnchorMax = Vector2.right;
|
||||
inputConfig.RectConfig.Pivot = new Vector2(0.5f, 1);
|
||||
inputConfig.RectConfig.SizeDelta = new Vector2(0, titleHeight);
|
||||
inputConfig.PlaceholderText = "输入搜索对象";
|
||||
var inputObj = ControlUtilities.CreateInputField(transform, inputConfig);
|
||||
inputObj.inputField.onEndEdit.AddListener(s =>
|
||||
{
|
||||
currentAimObj = s;
|
||||
Refresh();
|
||||
});
|
||||
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
private void CreateTitleBar()
|
||||
{
|
||||
var titleBar = new GameObject("TitleBar").AddComponent<RectTransform>();
|
||||
titleBar.transform.SetParent(transform, false);
|
||||
if (titleBar == null)
|
||||
{
|
||||
Debug.LogError("Failed to create TitleBar RectTransform.");
|
||||
return;
|
||||
}
|
||||
|
||||
titleBar.anchorMin = new Vector2(0, 1);
|
||||
titleBar.anchorMax = new Vector2(1, 1);
|
||||
titleBar.pivot = new Vector2(0.5f, 1);
|
||||
titleBar.sizeDelta = new Vector2(0, titleHeight);
|
||||
titleBar.anchoredPosition = Vector2.zero;
|
||||
|
||||
var titleTextConfig = TextConfig.Default;
|
||||
titleTextConfig.Text = "场景视图";
|
||||
titleTextConfig.RectConfig.AnchorMin = Vector2.zero;
|
||||
titleTextConfig.RectConfig.AnchorMax = Vector2.one;
|
||||
|
||||
var titleText = ControlUtilities.CreateText(titleBar, titleTextConfig);
|
||||
if (titleText == null)
|
||||
{
|
||||
Debug.LogError("Failed to create TitleText.");
|
||||
}
|
||||
|
||||
var refreshButtonConfig = ButtonConfig.Default;
|
||||
refreshButtonConfig.Text = "刷新";
|
||||
refreshButtonConfig.BackgroundColor = Color.yellow;
|
||||
refreshButtonConfig.RectConfig.SizeDelta = new Vector2(60, 40);
|
||||
refreshButtonConfig.RectConfig.AnchoredPosition = new Vector2(35, -25);
|
||||
var refreshButton = ControlUtilities.CreateButton(titleBar, refreshButtonConfig, Refresh);
|
||||
|
||||
var closeButtonConfig = ButtonConfig.Default;
|
||||
closeButtonConfig.Text = "X";
|
||||
closeButtonConfig.BackgroundColor = Color.red;
|
||||
closeButtonConfig.RectConfig.AnchorMax = Vector2.one;
|
||||
closeButtonConfig.RectConfig.AnchorMin = Vector2.one;
|
||||
closeButtonConfig.RectConfig.SizeDelta = new Vector2(30, 30);
|
||||
closeButtonConfig.RectConfig.AnchoredPosition = new Vector2(-25, -25);
|
||||
ControlUtilities.CreateButton(titleBar, closeButtonConfig, () => gameObject.SetActive(false));
|
||||
}
|
||||
|
||||
public void Refresh()
|
||||
{
|
||||
if (treeViewNode)
|
||||
{
|
||||
var canvas = FindIncludingHidden(currentAimObj);
|
||||
if (!canvas)
|
||||
{
|
||||
Debug.LogError($"{currentAimObj} not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
StartCoroutine(treeViewNode.DisplayGameObjectStructureCoroutine(canvas));
|
||||
// treeViewNode.DisplayGameObjectStructure(canvas);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnDrag(PointerEventData eventData)
|
||||
{
|
||||
transform.position = eventData.position + shift;
|
||||
}
|
||||
|
||||
public void OnBeginDrag(PointerEventData eventData)
|
||||
{
|
||||
shift = transform.position - new Vector3(eventData.position.x, eventData.position.y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按名称查找场景中的GameObject,包括隐藏(非激活)对象和DontDestroyOnLoad对象。
|
||||
/// 此方法会遍历所有当前加载到内存中的GameObject实例。
|
||||
///
|
||||
/// **重要提示:**
|
||||
/// 1. **性能开销较大:** 该方法会遍历所有已加载的GameObject,性能开销相对较高。
|
||||
/// 因此,**不建议在Update、FixedUpdate等帧循环中频繁调用。**
|
||||
/// 2. **适用场景:** 更适合在初始化、加载场景、调试或不频繁的查找操作中使用。
|
||||
/// 3. **同名对象:** 如果场景中存在多个同名对象,此方法将返回它遇到的第一个匹配项。
|
||||
/// 4. **DontDestroyOnLoad:** 自动包含在DontDestroyOnLoad根下的对象。
|
||||
/// 5. **隐藏对象:** 自动包含Hierarchy中非激活(隐藏)的对象。
|
||||
/// </summary>
|
||||
/// <param name="name">要查找的GameObject的名称。</param>
|
||||
/// <returns>找到的第一个GameObject,如果未找到则返回null。</returns>
|
||||
public static GameObject FindIncludingHidden(string name)
|
||||
{
|
||||
// 1. 验证名称 - 处理null, empty, 或只包含空白字符的名称
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
{
|
||||
Debug.LogWarning("FindIncludingHidden: Provided name is null, empty, or whitespace. Returning null.");
|
||||
return null;
|
||||
}
|
||||
|
||||
// 2. 获取所有已加载的GameObject
|
||||
// Resources.FindObjectsOfTypeAll<GameObject>() 是实现需求的关键。
|
||||
// 它会找到所有当前加载到内存中的GameObject实例,不论它们是否激活,属于哪个场景(包括 DontDestroyOnLoad 场景),
|
||||
// 甚至可能包括一些编辑器内部使用的隐藏GameObject。
|
||||
GameObject[] allGameObjects = Resources.FindObjectsOfTypeAll<GameObject>();
|
||||
// 3. 遍历并比较名称
|
||||
foreach (GameObject obj in allGameObjects)
|
||||
{
|
||||
// Unity中存在许多内部GameObject(例如:场景视图的相机、光照探头组等),
|
||||
// 它们的hideFlags属性可能被设置为HideInHierarchy、HideAndDontSave等。
|
||||
// 题目要求“包括隐藏”,并未明确排除这些内部或编辑器对象。
|
||||
// 因此,这里我们采取最宽松的策略:只要GameObject的name属性与传入的name匹配,就返回。
|
||||
// 如果未来需要排除特定类型的隐藏对象(例如只查找用户创建的游戏对象),
|
||||
// 可以根据 obj.scene.name 来过滤 DontDestroyOnLoad 场景中的对象,
|
||||
// 或者根据 obj.hideFlags 来排除编辑器内部对象。
|
||||
if (obj.name == name)
|
||||
{
|
||||
return obj; // 4. 返回第一个匹配项
|
||||
}
|
||||
}
|
||||
|
||||
// 5. 未找到则返回 null
|
||||
// 通常,查找函数在未找到结果时静默返回null是更常见的API行为。
|
||||
// 调用方可以根据返回值自行决定是否输出日志。
|
||||
// Debug.LogWarning($"FindIncludingHidden: GameObject with name '{name}' not found. Returning null.");
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
450
SceneView/TreeViewNode.cs
Normal file
450
SceneView/TreeViewNode.cs
Normal file
@@ -0,0 +1,450 @@
|
||||
using System.Collections;
|
||||
using SceneView;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SceneView
|
||||
{
|
||||
public class TreeViewNode : MonoBehaviour
|
||||
{
|
||||
public TreeViewNode? parent = null;
|
||||
|
||||
public RectTransform? rectTransform;
|
||||
public TextMeshProUGUI? text;
|
||||
public Button? label;
|
||||
public GameObject? child;
|
||||
public RectTransform? childRectTransform;
|
||||
public VerticalLayoutGroup? verticalLayout;
|
||||
public Button? objectEnable;
|
||||
public TextMeshProUGUI? objectText;
|
||||
|
||||
public float buttonHeight = 50;
|
||||
|
||||
private string originalText = "";
|
||||
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
CreateUI();
|
||||
}
|
||||
|
||||
[ContextMenu("CreateUI")]
|
||||
public void CreateUI()
|
||||
{
|
||||
// 获取 RectTransform 组件,如果不存在则添加
|
||||
if (rectTransform == null)
|
||||
{
|
||||
rectTransform = GetComponent<RectTransform>();
|
||||
if (rectTransform == null)
|
||||
{
|
||||
rectTransform = gameObject.AddComponent<RectTransform>();
|
||||
}
|
||||
|
||||
if (rectTransform == null)
|
||||
{
|
||||
Debug.LogError("Failed to add RectTransform to the GameObject.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
rectTransform.sizeDelta = new Vector2(0, buttonHeight);
|
||||
rectTransform.anchorMin = Vector2.up;
|
||||
rectTransform.anchorMax = Vector2.one;
|
||||
|
||||
var buttonConfig = ButtonConfig.Default;
|
||||
buttonConfig.RectConfig.Pivot = new Vector2(0.5f, 1);
|
||||
buttonConfig.RectConfig.AnchorMin = new Vector2(0, 1);
|
||||
buttonConfig.RectConfig.AnchorMax = new Vector2(1, 1);
|
||||
buttonConfig.RectConfig.SizeDelta = new Vector2(0, buttonHeight);
|
||||
|
||||
// 创建按钮并检查是否已存在
|
||||
if (label == null)
|
||||
{
|
||||
var button = ControlUtilities.CreateButton(rectTransform, buttonConfig, Expand);
|
||||
label = button.button;
|
||||
text = button.text;
|
||||
if (text == null)
|
||||
{
|
||||
Debug.LogError("Failed to get button text.");
|
||||
return;
|
||||
}
|
||||
|
||||
text.alignment = TextAlignmentOptions.MidlineLeft;
|
||||
}
|
||||
|
||||
if (objectEnable == null)
|
||||
{
|
||||
var button = ControlUtilities.CreateButton(rectTransform, buttonConfig, null);
|
||||
objectEnable = button.button;
|
||||
objectText= button.text;
|
||||
button.text.text = "-";
|
||||
button.button.image.color = Color.yellow;
|
||||
var rect=objectEnable.GetComponent<RectTransform>();
|
||||
rect.anchorMin = Vector2.one;
|
||||
rect.anchorMax = Vector2.one;
|
||||
rect.pivot = Vector2.one / 2;
|
||||
rect.sizeDelta = new Vector2(30, 30);
|
||||
rect.anchoredPosition = new Vector2(-25, -25);
|
||||
}
|
||||
|
||||
// 检查子对象是否存在
|
||||
child = transform.Find("content")?.gameObject;
|
||||
if (child == null)
|
||||
{
|
||||
child = new GameObject("content");
|
||||
child.transform.SetParent(rectTransform, false);
|
||||
if (child == null)
|
||||
{
|
||||
Debug.LogError("Failed to create or set parent for child content.");
|
||||
return;
|
||||
}
|
||||
|
||||
childRectTransform = child.AddComponent<RectTransform>();
|
||||
if (childRectTransform == null)
|
||||
{
|
||||
Debug.LogError("Failed to add RectTransform to the child content.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
childRectTransform = child.GetComponent<RectTransform>();
|
||||
if (childRectTransform == null)
|
||||
{
|
||||
Debug.LogError("Failed to get RectTransform for the child content.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
childRectTransform.anchorMin = new Vector2(0, 1);
|
||||
childRectTransform.anchorMax = new Vector2(1, 1);
|
||||
childRectTransform.pivot = new Vector2(0.5f, 1);
|
||||
childRectTransform.offsetMax = new Vector2(0, -buttonHeight);
|
||||
childRectTransform.offsetMin = new Vector2(0, 0);
|
||||
|
||||
verticalLayout = child.GetComponent<VerticalLayoutGroup>();
|
||||
var sizeFitter = child.GetComponent<ContentSizeFitter>();
|
||||
|
||||
if (verticalLayout == null)
|
||||
{
|
||||
verticalLayout = child.AddComponent<VerticalLayoutGroup>();
|
||||
if (verticalLayout == null)
|
||||
{
|
||||
Debug.LogError("Failed to add VerticalLayoutGroup to the child content.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeFitter == null)
|
||||
{
|
||||
sizeFitter = child.AddComponent<ContentSizeFitter>();
|
||||
if (sizeFitter == null)
|
||||
{
|
||||
Debug.LogError("Failed to add ContentSizeFitter to the child content.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
verticalLayout.padding.top = 2;
|
||||
verticalLayout.padding.bottom = 4;
|
||||
verticalLayout.spacing = 2;
|
||||
verticalLayout.childControlHeight = false;
|
||||
verticalLayout.childControlWidth = true;
|
||||
|
||||
sizeFitter.verticalFit = ContentSizeFitter.FitMode.PreferredSize;
|
||||
|
||||
}
|
||||
|
||||
public void InsertChild(RectTransform childRectTransform)
|
||||
{
|
||||
if (child != null && childRectTransform != null)
|
||||
{
|
||||
// 将子节点添加到 content 容器中
|
||||
childRectTransform.SetParent(child.transform, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void Expand()
|
||||
{
|
||||
if (child == null)
|
||||
{
|
||||
Debug.LogError("Child content not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
child.SetActive(!child.activeSelf);
|
||||
|
||||
UpdateHeight();
|
||||
|
||||
// 更新名称以模拟动画效果
|
||||
if (child.activeSelf)
|
||||
{
|
||||
if (text != null) text.text = originalText + " ↓"; // 下三角符号
|
||||
}
|
||||
else
|
||||
{
|
||||
if (text != null) text.text = originalText + " →"; // 右三角符号
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateHeight()
|
||||
{
|
||||
if (child == null || childRectTransform == null || rectTransform == null)
|
||||
{
|
||||
Debug.LogError("Failed to update height. Child, ChildRectTransform, or RectTransform is null.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (child.activeSelf)
|
||||
{
|
||||
rectTransform.sizeDelta =
|
||||
new Vector2(rectTransform.sizeDelta.x, buttonHeight + childRectTransform.sizeDelta.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
rectTransform.sizeDelta = new Vector2(rectTransform.sizeDelta.x, buttonHeight);
|
||||
}
|
||||
|
||||
if (parent != null)
|
||||
{
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(parent.childRectTransform);
|
||||
parent.UpdateHeight();
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator DisplayGameObjectStructureCoroutine(GameObject targetObject, int depth = 0)
|
||||
{
|
||||
if (targetObject == null)
|
||||
{
|
||||
Debug.LogError("Target object is null.");
|
||||
yield break;
|
||||
}
|
||||
|
||||
if (targetObject.name == CanvasControl.ViewCanvasName)
|
||||
yield break;
|
||||
|
||||
|
||||
ClearChildNodes();
|
||||
originalText = GetIndentedName(targetObject.name, depth);
|
||||
if (text != null) text.text = originalText;
|
||||
objectEnable.onClick.AddListener(() => OnObjectEnable(targetObject, objectEnable, objectText));
|
||||
UpdateObjButton(targetObject,objectEnable,objectText);
|
||||
|
||||
|
||||
var components = targetObject.GetComponents<Behaviour>();
|
||||
foreach (var component in components)
|
||||
{
|
||||
if (childRectTransform == null)
|
||||
{
|
||||
Debug.LogError("childRectTransform is null");
|
||||
continue;
|
||||
}
|
||||
|
||||
var config = ButtonConfig.Default;
|
||||
config.RectConfig.SizeDelta = new Vector2(0, 40);
|
||||
config.BackgroundColor = Color.green;
|
||||
config.Text = new string(' ', (depth + 1) * 2) + component.GetType().Name;
|
||||
var buttonBack = ControlUtilities.CreateButton(childRectTransform, config, null);
|
||||
if (buttonBack.button == null)
|
||||
{
|
||||
Debug.LogError("buttonBack.button is null");
|
||||
continue;
|
||||
}
|
||||
|
||||
var button = buttonBack.button;
|
||||
var comp = component;
|
||||
buttonBack.button.onClick.AddListener(() => OnButtonClick(button, comp));
|
||||
yield return null;
|
||||
}
|
||||
|
||||
// 计数器,用于跟踪子协程的数量
|
||||
var childCount = targetObject.transform.childCount;
|
||||
var completedChildren = 0;
|
||||
|
||||
var allChildrenExpanded = false;
|
||||
|
||||
// 遍历目标对象的所有子对象
|
||||
foreach (Transform childTransform in targetObject.transform)
|
||||
{
|
||||
if (childTransform == null)
|
||||
{
|
||||
Debug.LogError("Child transform is null.");
|
||||
continue;
|
||||
}
|
||||
|
||||
var childNode = new GameObject($"{childTransform.gameObject.name}").AddComponent<TreeViewNode>();
|
||||
childNode.transform.SetParent(childRectTransform, false);
|
||||
childNode.parent = this;
|
||||
childNode.CreateUI();
|
||||
|
||||
StartCoroutine(childNode.DisplayGameObjectStructureCoroutine(childTransform.gameObject, depth + 1, () =>
|
||||
{
|
||||
completedChildren++;
|
||||
if (completedChildren == childCount)
|
||||
{
|
||||
allChildrenExpanded = true;
|
||||
}
|
||||
}));
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
||||
// 等待所有子协程完成
|
||||
while (!allChildrenExpanded && childCount > 0)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
||||
// 在所有子节点初始化完毕后调用Expand
|
||||
Expand();
|
||||
}
|
||||
|
||||
public IEnumerator DisplayGameObjectStructureCoroutine(GameObject targetObject, int depth,
|
||||
System.Action onComplete)
|
||||
{
|
||||
if (targetObject == null)
|
||||
{
|
||||
Debug.LogError("Target object is null.");
|
||||
yield break;
|
||||
}
|
||||
|
||||
ClearChildNodes();
|
||||
originalText = GetIndentedName(targetObject.name, depth);
|
||||
if (text != null) text.text = originalText;
|
||||
objectEnable.onClick.AddListener(() => OnObjectEnable(targetObject, objectEnable, objectText));
|
||||
UpdateObjButton(targetObject,objectEnable,objectText);
|
||||
var components = targetObject.GetComponents<Behaviour>();
|
||||
foreach (var component in components)
|
||||
{
|
||||
if (childRectTransform == null)
|
||||
{
|
||||
Debug.LogError("childRectTransform is null");
|
||||
continue;
|
||||
}
|
||||
|
||||
var config = ButtonConfig.Default;
|
||||
config.RectConfig.SizeDelta = new Vector2(0, 40);
|
||||
config.BackgroundColor = Color.green;
|
||||
config.Text = new string(' ', (depth + 1) * 2) + component.GetType().Name;
|
||||
var buttonBack = ControlUtilities.CreateButton(childRectTransform, config, null);
|
||||
if (buttonBack.button == null)
|
||||
{
|
||||
Debug.LogError("buttonBack.button is null");
|
||||
continue;
|
||||
}
|
||||
|
||||
var button = buttonBack.button;
|
||||
var comp = component;
|
||||
buttonBack.button.onClick.AddListener(() => OnButtonClick(button, comp));
|
||||
yield return null;
|
||||
}
|
||||
|
||||
// 计数器,用于跟踪子协程的数量
|
||||
var childCount = targetObject.transform.childCount;
|
||||
var completedChildren = 0;
|
||||
|
||||
var allChildrenExpanded = false;
|
||||
|
||||
// 遍历目标对象的所有子对象
|
||||
foreach (Transform childTransform in targetObject.transform)
|
||||
{
|
||||
if (childTransform == null)
|
||||
{
|
||||
Debug.LogError("Child transform is null.");
|
||||
continue;
|
||||
}
|
||||
|
||||
var childNode = new GameObject($"{childTransform.gameObject.name}").AddComponent<TreeViewNode>();
|
||||
childNode.transform.SetParent(childRectTransform, false);
|
||||
childNode.parent = this;
|
||||
childNode.CreateUI();
|
||||
|
||||
StartCoroutine(childNode.DisplayGameObjectStructureCoroutine(childTransform.gameObject, depth + 1, () =>
|
||||
{
|
||||
completedChildren++;
|
||||
if (completedChildren == childCount)
|
||||
{
|
||||
allChildrenExpanded = true;
|
||||
}
|
||||
}));
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
||||
// 等待所有子协程完成
|
||||
while (!allChildrenExpanded && childCount > 0)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
||||
// 在所有子节点初始化完毕后调用Expand
|
||||
Expand();
|
||||
|
||||
// 调用完成回调
|
||||
onComplete?.Invoke();
|
||||
}
|
||||
|
||||
private string GetIndentedName(string name, int depth)
|
||||
{
|
||||
var indent = "";
|
||||
for (int i = 0; i < depth; i++)
|
||||
{
|
||||
indent += $"{i}_";
|
||||
}
|
||||
return $"{indent}_{name}";
|
||||
}
|
||||
|
||||
public void ClearChildNodes()
|
||||
{
|
||||
if (childRectTransform != null)
|
||||
foreach (Transform childRectTransform in this.childRectTransform)
|
||||
{
|
||||
Destroy(childRectTransform.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnButtonClick(Button button, Behaviour component)
|
||||
{
|
||||
if (button == null)
|
||||
{
|
||||
Debug.LogError("button is null");
|
||||
return;
|
||||
}
|
||||
|
||||
if (component == null)
|
||||
{
|
||||
Debug.LogError("component is null");
|
||||
return;
|
||||
}
|
||||
|
||||
// 切换组件的启用状态
|
||||
var isEnabled = !component.enabled;
|
||||
component.enabled = isEnabled;
|
||||
// 根据组件的启用状态修改按钮背景颜色
|
||||
button.image.color = isEnabled ? Color.green : Color.red;
|
||||
}
|
||||
|
||||
private void OnObjectEnable(GameObject gameObject, Button button, TMP_Text text)
|
||||
{
|
||||
Debug.Log($"设置{gameObject.name}={!gameObject.activeSelf}");
|
||||
gameObject.SetActive(!gameObject.activeSelf);
|
||||
UpdateObjButton(gameObject, button, text);
|
||||
}
|
||||
|
||||
private void UpdateObjButton(GameObject gameObject, Button button, TMP_Text text)
|
||||
{
|
||||
if (gameObject.activeSelf)
|
||||
{
|
||||
button.image.color = Color.green;
|
||||
text.text = "√";
|
||||
}
|
||||
else
|
||||
{
|
||||
button.image.color = Color.red;
|
||||
text.text = "×";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
|
||||
22
SceneView/obj/Debug/SceneView.AssemblyInfo.cs
Normal file
22
SceneView/obj/Debug/SceneView.AssemblyInfo.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("SceneView")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+786025f720c05ae486c8c66d3a6114633ccd0dbf")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("SceneView")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("SceneView")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// 由 MSBuild WriteCodeFragment 类生成。
|
||||
|
||||
1
SceneView/obj/Debug/SceneView.AssemblyInfoInputs.cache
Normal file
1
SceneView/obj/Debug/SceneView.AssemblyInfoInputs.cache
Normal file
@@ -0,0 +1 @@
|
||||
aa136efc39beffbdc5220893902c448939a7627fda773846b8971cca38a3094b
|
||||
@@ -0,0 +1,8 @@
|
||||
is_global = true
|
||||
build_property.RootNamespace = SceneView
|
||||
build_property.ProjectDir = D:\vs_project\DuckovMods\SceneView\
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||
build_property.CsWinRTUseWindowsUIXamlProjections = false
|
||||
build_property.EffectiveAnalysisLevelStyle =
|
||||
build_property.EnableCodeStyleSeverity =
|
||||
BIN
SceneView/obj/Debug/SceneView.assets.cache
Normal file
BIN
SceneView/obj/Debug/SceneView.assets.cache
Normal file
Binary file not shown.
BIN
SceneView/obj/Debug/SceneView.csproj.AssemblyReference.cache
Normal file
BIN
SceneView/obj/Debug/SceneView.csproj.AssemblyReference.cache
Normal file
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
|
||||
22
SceneView/obj/Release/SceneView.AssemblyInfo.cs
Normal file
22
SceneView/obj/Release/SceneView.AssemblyInfo.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("SceneView")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+786025f720c05ae486c8c66d3a6114633ccd0dbf")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("SceneView")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("SceneView")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// 由 MSBuild WriteCodeFragment 类生成。
|
||||
|
||||
1
SceneView/obj/Release/SceneView.AssemblyInfoInputs.cache
Normal file
1
SceneView/obj/Release/SceneView.AssemblyInfoInputs.cache
Normal file
@@ -0,0 +1 @@
|
||||
e56036f0838e710ef74c4ebdd97d630a82ce4f293e0f56fdc74ce4c87f1ae5a4
|
||||
@@ -0,0 +1,8 @@
|
||||
is_global = true
|
||||
build_property.RootNamespace = SceneView
|
||||
build_property.ProjectDir = D:\vs_project\DuckovMods\SceneView\
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||
build_property.CsWinRTUseWindowsUIXamlProjections = false
|
||||
build_property.EffectiveAnalysisLevelStyle =
|
||||
build_property.EnableCodeStyleSeverity =
|
||||
BIN
SceneView/obj/Release/SceneView.assets.cache
Normal file
BIN
SceneView/obj/Release/SceneView.assets.cache
Normal file
Binary file not shown.
BIN
SceneView/obj/Release/SceneView.csproj.AssemblyReference.cache
Normal file
BIN
SceneView/obj/Release/SceneView.csproj.AssemblyReference.cache
Normal file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
2db483d989a5a869a86b32f19fd026cf473776d04114d97e11aed9c79ee12fd1
|
||||
@@ -0,0 +1,7 @@
|
||||
D:\steam\steamapps\common\Escape from Duckov\Duckov_Data\Mods\SceneView\SceneView.dll
|
||||
D:\vs_project\DuckovMods\SceneView\obj\Release\SceneView.csproj.AssemblyReference.cache
|
||||
D:\vs_project\DuckovMods\SceneView\obj\Release\SceneView.GeneratedMSBuildEditorConfig.editorconfig
|
||||
D:\vs_project\DuckovMods\SceneView\obj\Release\SceneView.AssemblyInfoInputs.cache
|
||||
D:\vs_project\DuckovMods\SceneView\obj\Release\SceneView.AssemblyInfo.cs
|
||||
D:\vs_project\DuckovMods\SceneView\obj\Release\SceneView.csproj.CoreCompileInputs.cache
|
||||
D:\vs_project\DuckovMods\SceneView\obj\Release\SceneView.dll
|
||||
BIN
SceneView/obj/Release/SceneView.dll
Normal file
BIN
SceneView/obj/Release/SceneView.dll
Normal file
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
|
||||
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("SceneView")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+786025f720c05ae486c8c66d3a6114633ccd0dbf")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("SceneView")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("SceneView")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// 由 MSBuild WriteCodeFragment 类生成。
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
e56036f0838e710ef74c4ebdd97d630a82ce4f293e0f56fdc74ce4c87f1ae5a4
|
||||
@@ -0,0 +1,8 @@
|
||||
is_global = true
|
||||
build_property.RootNamespace = SceneView
|
||||
build_property.ProjectDir = D:\vs_project\DuckovMods\SceneView\
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||
build_property.CsWinRTUseWindowsUIXamlProjections = false
|
||||
build_property.EffectiveAnalysisLevelStyle =
|
||||
build_property.EnableCodeStyleSeverity =
|
||||
BIN
SceneView/obj/Release/netstandard2.1/SceneView.assets.cache
Normal file
BIN
SceneView/obj/Release/netstandard2.1/SceneView.assets.cache
Normal file
Binary file not shown.
79
SceneView/obj/SceneView.csproj.nuget.dgspec.json
Normal file
79
SceneView/obj/SceneView.csproj.nuget.dgspec.json
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"D:\\vs_project\\DuckovMods\\SceneView\\SceneView.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"D:\\vs_project\\DuckovMods\\SceneView\\SceneView.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "D:\\vs_project\\DuckovMods\\SceneView\\SceneView.csproj",
|
||||
"projectName": "SceneView",
|
||||
"projectPath": "D:\\vs_project\\DuckovMods\\SceneView\\SceneView.csproj",
|
||||
"packagesPath": "C:\\Users\\Lenovo\\.nuget\\packages\\",
|
||||
"outputPath": "D:\\vs_project\\DuckovMods\\SceneView\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"fallbackFolders": [
|
||||
"D:\\vsShare\\NuGetPackages"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\Lenovo\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"netstandard2.1"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.1": {
|
||||
"targetAlias": "netstandard2.1",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
},
|
||||
"restoreAuditProperties": {
|
||||
"enableAudit": "true",
|
||||
"auditLevel": "low",
|
||||
"auditMode": "direct"
|
||||
},
|
||||
"SdkAnalysisLevel": "9.0.300"
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.1": {
|
||||
"targetAlias": "netstandard2.1",
|
||||
"dependencies": {
|
||||
"Lib.Harmony": {
|
||||
"target": "Package",
|
||||
"version": "[2.4.1, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"NETStandard.Library": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.306\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
16
SceneView/obj/SceneView.csproj.nuget.g.props
Normal file
16
SceneView/obj/SceneView.csproj.nuget.g.props
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Lenovo\.nuget\packages\;D:\vsShare\NuGetPackages</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.14.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="C:\Users\Lenovo\.nuget\packages\" />
|
||||
<SourceRoot Include="D:\vsShare\NuGetPackages\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
2
SceneView/obj/SceneView.csproj.nuget.g.targets
Normal file
2
SceneView/obj/SceneView.csproj.nuget.g.targets
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
|
||||
239
SceneView/obj/project.assets.json
Normal file
239
SceneView/obj/project.assets.json
Normal file
@@ -0,0 +1,239 @@
|
||||
{
|
||||
"version": 3,
|
||||
"targets": {
|
||||
".NETStandard,Version=v2.1": {
|
||||
"Lib.Harmony/2.4.1": {
|
||||
"type": "package",
|
||||
"dependencies": {
|
||||
"Lib.Harmony.Ref": "2.4.1"
|
||||
},
|
||||
"compile": {
|
||||
"lib/netstandard2.0/_._": {}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/_._": {}
|
||||
}
|
||||
},
|
||||
"Lib.Harmony.Ref/2.4.1": {
|
||||
"type": "package",
|
||||
"dependencies": {
|
||||
"System.Reflection.Emit": "4.7.0"
|
||||
},
|
||||
"compile": {
|
||||
"ref/netstandard2.0/0Harmony.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Reflection.Emit/4.7.0": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
"ref/netstandard2.1/_._": {}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.1/_._": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Lib.Harmony/2.4.1": {
|
||||
"sha512": "iLTZi/kKKB18jYEIwReZSx2xXyVUh4J1swReMgvYBBBn4tzA1Nd0PJlVyntY5BDdSiXSxzmvjc/3OYfFs0YwFg==",
|
||||
"type": "package",
|
||||
"path": "lib.harmony/2.4.1",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"HarmonyLogo.png",
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"lib.harmony.2.4.1.nupkg.sha512",
|
||||
"lib.harmony.nuspec",
|
||||
"lib/net35/0Harmony.dll",
|
||||
"lib/net35/0Harmony.pdb",
|
||||
"lib/net35/0Harmony.xml",
|
||||
"lib/net452/0Harmony.dll",
|
||||
"lib/net452/0Harmony.pdb",
|
||||
"lib/net452/0Harmony.xml",
|
||||
"lib/net472/0Harmony.dll",
|
||||
"lib/net472/0Harmony.pdb",
|
||||
"lib/net472/0Harmony.xml",
|
||||
"lib/net48/0Harmony.dll",
|
||||
"lib/net48/0Harmony.pdb",
|
||||
"lib/net48/0Harmony.xml",
|
||||
"lib/net5.0/0Harmony.dll",
|
||||
"lib/net5.0/0Harmony.pdb",
|
||||
"lib/net5.0/0Harmony.xml",
|
||||
"lib/net6.0/0Harmony.dll",
|
||||
"lib/net6.0/0Harmony.pdb",
|
||||
"lib/net6.0/0Harmony.xml",
|
||||
"lib/net7.0/0Harmony.dll",
|
||||
"lib/net7.0/0Harmony.pdb",
|
||||
"lib/net7.0/0Harmony.xml",
|
||||
"lib/net8.0/0Harmony.dll",
|
||||
"lib/net8.0/0Harmony.pdb",
|
||||
"lib/net8.0/0Harmony.xml",
|
||||
"lib/net9.0/0Harmony.dll",
|
||||
"lib/net9.0/0Harmony.pdb",
|
||||
"lib/net9.0/0Harmony.xml",
|
||||
"lib/netcoreapp3.0/0Harmony.dll",
|
||||
"lib/netcoreapp3.0/0Harmony.pdb",
|
||||
"lib/netcoreapp3.0/0Harmony.xml",
|
||||
"lib/netcoreapp3.1/0Harmony.dll",
|
||||
"lib/netcoreapp3.1/0Harmony.pdb",
|
||||
"lib/netcoreapp3.1/0Harmony.xml",
|
||||
"lib/netstandard2.0/_._"
|
||||
]
|
||||
},
|
||||
"Lib.Harmony.Ref/2.4.1": {
|
||||
"sha512": "+u1y2Qd6OlSUQ8JtrsrSo3adnAsrXMJ2YPYtbW+FAmdPI5yw34M9VX4bKl8ZwRuUzaGzZIz+oGMbn/yS4fWtZw==",
|
||||
"type": "package",
|
||||
"path": "lib.harmony.ref/2.4.1",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"HarmonyLogo.png",
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"lib.harmony.ref.2.4.1.nupkg.sha512",
|
||||
"lib.harmony.ref.nuspec",
|
||||
"ref/netstandard2.0/0Harmony.dll",
|
||||
"ref/netstandard2.0/0Harmony.xml"
|
||||
]
|
||||
},
|
||||
"System.Reflection.Emit/4.7.0": {
|
||||
"sha512": "VR4kk8XLKebQ4MZuKuIni/7oh+QGFmZW3qORd1GvBq/8026OpW501SzT/oypwiQl4TvT8ErnReh/NzY9u+C6wQ==",
|
||||
"type": "package",
|
||||
"path": "system.reflection.emit/4.7.0",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"LICENSE.TXT",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"lib/MonoAndroid10/_._",
|
||||
"lib/MonoTouch10/_._",
|
||||
"lib/net45/_._",
|
||||
"lib/netcore50/System.Reflection.Emit.dll",
|
||||
"lib/netcoreapp2.0/_._",
|
||||
"lib/netstandard1.1/System.Reflection.Emit.dll",
|
||||
"lib/netstandard1.1/System.Reflection.Emit.xml",
|
||||
"lib/netstandard1.3/System.Reflection.Emit.dll",
|
||||
"lib/netstandard2.0/System.Reflection.Emit.dll",
|
||||
"lib/netstandard2.0/System.Reflection.Emit.xml",
|
||||
"lib/netstandard2.1/_._",
|
||||
"lib/xamarinios10/_._",
|
||||
"lib/xamarinmac20/_._",
|
||||
"lib/xamarintvos10/_._",
|
||||
"lib/xamarinwatchos10/_._",
|
||||
"ref/MonoAndroid10/_._",
|
||||
"ref/MonoTouch10/_._",
|
||||
"ref/net45/_._",
|
||||
"ref/netcoreapp2.0/_._",
|
||||
"ref/netstandard1.1/System.Reflection.Emit.dll",
|
||||
"ref/netstandard1.1/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/de/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/es/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/fr/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/it/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/ja/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/ko/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/ru/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/zh-hans/System.Reflection.Emit.xml",
|
||||
"ref/netstandard1.1/zh-hant/System.Reflection.Emit.xml",
|
||||
"ref/netstandard2.0/System.Reflection.Emit.dll",
|
||||
"ref/netstandard2.0/System.Reflection.Emit.xml",
|
||||
"ref/netstandard2.1/_._",
|
||||
"ref/xamarinios10/_._",
|
||||
"ref/xamarinmac20/_._",
|
||||
"ref/xamarintvos10/_._",
|
||||
"ref/xamarinwatchos10/_._",
|
||||
"runtimes/aot/lib/netcore50/System.Reflection.Emit.dll",
|
||||
"runtimes/aot/lib/netcore50/System.Reflection.Emit.xml",
|
||||
"system.reflection.emit.4.7.0.nupkg.sha512",
|
||||
"system.reflection.emit.nuspec",
|
||||
"useSharedDesignerContext.txt",
|
||||
"version.txt"
|
||||
]
|
||||
}
|
||||
},
|
||||
"projectFileDependencyGroups": {
|
||||
".NETStandard,Version=v2.1": [
|
||||
"Lib.Harmony >= 2.4.1"
|
||||
]
|
||||
},
|
||||
"packageFolders": {
|
||||
"C:\\Users\\Lenovo\\.nuget\\packages\\": {},
|
||||
"D:\\vsShare\\NuGetPackages": {}
|
||||
},
|
||||
"project": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "D:\\vs_project\\DuckovMods\\SceneView\\SceneView.csproj",
|
||||
"projectName": "SceneView",
|
||||
"projectPath": "D:\\vs_project\\DuckovMods\\SceneView\\SceneView.csproj",
|
||||
"packagesPath": "C:\\Users\\Lenovo\\.nuget\\packages\\",
|
||||
"outputPath": "D:\\vs_project\\DuckovMods\\SceneView\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"fallbackFolders": [
|
||||
"D:\\vsShare\\NuGetPackages"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\Lenovo\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"netstandard2.1"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.1": {
|
||||
"targetAlias": "netstandard2.1",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
},
|
||||
"restoreAuditProperties": {
|
||||
"enableAudit": "true",
|
||||
"auditLevel": "low",
|
||||
"auditMode": "direct"
|
||||
},
|
||||
"SdkAnalysisLevel": "9.0.300"
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.1": {
|
||||
"targetAlias": "netstandard2.1",
|
||||
"dependencies": {
|
||||
"Lib.Harmony": {
|
||||
"target": "Package",
|
||||
"version": "[2.4.1, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"NETStandard.Library": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.306\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
12
SceneView/obj/project.nuget.cache
Normal file
12
SceneView/obj/project.nuget.cache
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "79Mvphj8pgU=",
|
||||
"success": true,
|
||||
"projectFilePath": "D:\\vs_project\\DuckovMods\\SceneView\\SceneView.csproj",
|
||||
"expectedPackageFiles": [
|
||||
"C:\\Users\\Lenovo\\.nuget\\packages\\lib.harmony\\2.4.1\\lib.harmony.2.4.1.nupkg.sha512",
|
||||
"C:\\Users\\Lenovo\\.nuget\\packages\\lib.harmony.ref\\2.4.1\\lib.harmony.ref.2.4.1.nupkg.sha512",
|
||||
"C:\\Users\\Lenovo\\.nuget\\packages\\system.reflection.emit\\4.7.0\\system.reflection.emit.4.7.0.nupkg.sha512"
|
||||
],
|
||||
"logs": []
|
||||
}
|
||||
1
SceneView/obj/project.packagespec.json
Normal file
1
SceneView/obj/project.packagespec.json
Normal file
@@ -0,0 +1 @@
|
||||
"restore":{"projectUniqueName":"D:\\vs_project\\DuckovMods\\SceneView\\SceneView.csproj","projectName":"SceneView","projectPath":"D:\\vs_project\\DuckovMods\\SceneView\\SceneView.csproj","outputPath":"D:\\vs_project\\DuckovMods\\SceneView\\obj\\","projectStyle":"PackageReference","fallbackFolders":["D:\\vsShare\\NuGetPackages"],"originalTargetFrameworks":["netstandard2.1"],"sources":{"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\":{},"https://api.nuget.org/v3/index.json":{}},"frameworks":{"netstandard2.1":{"targetAlias":"netstandard2.1","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"},"SdkAnalysisLevel":"9.0.300"}"frameworks":{"netstandard2.1":{"targetAlias":"netstandard2.1","dependencies":{"Lib.Harmony":{"target":"Package","version":"[2.4.1, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"NETStandard.Library":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\9.0.306\\RuntimeIdentifierGraph.json"}}
|
||||
1
SceneView/obj/rider.project.model.nuget.info
Normal file
1
SceneView/obj/rider.project.model.nuget.info
Normal file
@@ -0,0 +1 @@
|
||||
17623567760496572
|
||||
1
SceneView/obj/rider.project.restore.info
Normal file
1
SceneView/obj/rider.project.restore.info
Normal file
@@ -0,0 +1 @@
|
||||
17623567760496572
|
||||
@@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Theme")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+0206a83f56b5a794fe2f173b4a047cc4f0d4cd90")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+786025f720c05ae486c8c66d3a6114633ccd0dbf")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Theme")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Theme")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
4effd31a0421ad5d63bf5819743524c1e96899884e3dc10e49ff75f0c7981933
|
||||
68f3d72038da889633db00efa4248f997c4c5eec6abc2a23beccb75352aa13bf
|
||||
|
||||
Binary file not shown.
@@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Theme")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5d69efbc3f80a5422cef0884e02fb27adf20b467")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+786025f720c05ae486c8c66d3a6114633ccd0dbf")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Theme")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Theme")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
c1519aee9b121f1df8699539b785671792d60ca0acb5c9d1d51d6039c2fa5de5
|
||||
d4aae129f1e6fc18b1d2a9efecf68c3e4c2b9a7190c20b36eb059e8eaa3c965b
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
17622424783469959
|
||||
17623343068138064
|
||||
@@ -10,63 +10,60 @@ namespace UIFrame
|
||||
{
|
||||
public class GameOriginMainMenuUI
|
||||
{
|
||||
public GameObject mainMenuContainer;
|
||||
public Image? title;
|
||||
public TMP_Text[]? allTexts;
|
||||
|
||||
public Sprite titleSprite;
|
||||
|
||||
public bool linkMainMenu=false;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
SceneLoader.onAfterSceneInitialize += OnAfterSceneInitialize;
|
||||
}
|
||||
|
||||
public void Cleanup()
|
||||
{
|
||||
SceneLoader.onAfterSceneInitialize -= OnAfterSceneInitialize;
|
||||
}
|
||||
|
||||
private void OnAfterSceneInitialize(SceneLoadingContext sceneLoadingContext)
|
||||
{
|
||||
linkMainMenu = false;
|
||||
LinkMainMenuObj();
|
||||
}
|
||||
|
||||
public void LinkMainMenuObj()
|
||||
{
|
||||
mainMenuContainer = GameObject.Find("MainMenuContainer");
|
||||
if(!mainMenuContainer)
|
||||
{
|
||||
Debug.LogWarning("Could not find Main Menu Container");
|
||||
return;
|
||||
}
|
||||
Debug.Log("Main Menu Container initialized");
|
||||
allTexts = mainMenuContainer.GetComponentsInChildren<TMP_Text>();
|
||||
title = GameObjectTool.FindChildByName(mainMenuContainer.transform, "MainTitle")?.GetComponent<Image>();
|
||||
linkMainMenu = true;
|
||||
// public SpriteRenderer? title;
|
||||
// public TMP_Text[]? allTexts;
|
||||
public static Sprite? titleSprite=null;
|
||||
|
||||
|
||||
}
|
||||
// public void Initialize()
|
||||
// {
|
||||
// SceneManager.sceneLoaded += OnSceneLoaded;
|
||||
// // SceneLoader.onAfterSceneInitialize += OnAfterSceneInitialize;
|
||||
// LinkMainMenuObj();
|
||||
// }
|
||||
//
|
||||
// public void Cleanup()
|
||||
// {
|
||||
// SceneManager.sceneLoaded -= OnSceneLoaded;
|
||||
// // SceneLoader.onAfterSceneInitialize -= OnAfterSceneInitialize;
|
||||
// }
|
||||
//
|
||||
// private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
||||
// {
|
||||
// Debug.Log("Loading game origin main menu...");
|
||||
// LinkMainMenuObj();
|
||||
// }
|
||||
// // private void OnAfterSceneInitialize(SceneLoadingContext sceneLoadingContext)
|
||||
// // {
|
||||
// //
|
||||
// // }
|
||||
//
|
||||
// public void LinkMainMenuObj()
|
||||
// {
|
||||
// var logoObj=GameObjectTool.FindObjectByPath("TimelineContent/LOGO/Logo");
|
||||
// title = logoObj?.GetComponent<SpriteRenderer>();
|
||||
// }
|
||||
|
||||
public bool SetFont(TMP_FontAsset font)
|
||||
{
|
||||
if(allTexts == null || allTexts.Length == 0)
|
||||
return false;
|
||||
foreach (var text in allTexts)
|
||||
{
|
||||
text.font = font;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// public bool SetFont(TMP_FontAsset font)
|
||||
// {
|
||||
// if(allTexts == null || allTexts.Length == 0)
|
||||
// return false;
|
||||
// foreach (var text in allTexts)
|
||||
// {
|
||||
// text.font = font;
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
public bool SetTitle(Sprite texture)
|
||||
{
|
||||
titleSprite=texture;
|
||||
if(title==null)
|
||||
return false;
|
||||
title.sprite = texture;
|
||||
// Debug.Log("Setting title...");
|
||||
titleSprite = texture;
|
||||
// if(title==null)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// title.sprite = texture;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using Duckov.UI;
|
||||
using Duckov.UI.Animations;
|
||||
using Duckov.Utilities;
|
||||
using HarmonyLib;
|
||||
using SodaCraft.Localizations;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UIFrame
|
||||
@@ -17,6 +18,10 @@ namespace UIFrame
|
||||
|
||||
private Harmony? harmony;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnAfterSetup()
|
||||
{
|
||||
CreateAPIObject();
|
||||
@@ -31,6 +36,7 @@ namespace UIFrame
|
||||
|
||||
protected override void OnBeforeDeactivate()
|
||||
{
|
||||
|
||||
ClearAPIObject();
|
||||
harmony?.UnpatchAll(MOD_ID);
|
||||
harmony = null;
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
namespace UIFrame.Patch
|
||||
{
|
||||
[HarmonyLib.HarmonyPatch(typeof(SceneLoader), "LoadMainMenu")]
|
||||
public class PatchSceneLoaderLoadMainMenu
|
||||
{
|
||||
public static void Postfix()
|
||||
{
|
||||
Debug.Log("LoadMainMenu called");
|
||||
}
|
||||
}
|
||||
}
|
||||
34
UIFrame/Patch/PatchSpriteRendererLocalizorRefresh.cs
Normal file
34
UIFrame/Patch/PatchSpriteRendererLocalizorRefresh.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using HarmonyLib;
|
||||
using SodaCraft.Localizations;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UIFrame.Patch
|
||||
{
|
||||
[HarmonyPatch(typeof(SpriteRendererLocalizor), "Refresh")]
|
||||
public class PatchSpriteRendererLocalizorRefresh
|
||||
{
|
||||
private static FieldInfo spriteRendererField = AccessTools.Field(typeof(SpriteRendererLocalizor), "spriteRenderer");
|
||||
|
||||
public static void Postfix(SpriteRendererLocalizor __instance)
|
||||
{
|
||||
if (GameOriginMainMenuUI.titleSprite != null && spriteRendererField != null)
|
||||
{
|
||||
SpriteRenderer targetSpriteRenderer = spriteRendererField.GetValue(__instance) as SpriteRenderer;
|
||||
|
||||
if (targetSpriteRenderer != null)
|
||||
{
|
||||
targetSpriteRenderer.sprite = GameOriginMainMenuUI.titleSprite;
|
||||
}
|
||||
else
|
||||
{
|
||||
UnityEngine.Debug.LogWarning($"Harmony Patch: Failed to get SpriteRenderer from {__instance.gameObject.name} (SpriteRendererLocalizor component)'s spriteRenderer field. Value was null or not a SpriteRenderer.");
|
||||
}
|
||||
} else if (GameOriginMainMenuUI.titleSprite == null) {
|
||||
UnityEngine.Debug.LogWarning("Harmony Patch: GameOriginMainMenuUI.titleSprite is null, skipping sprite assignment.");
|
||||
} else if (spriteRendererField == null){
|
||||
UnityEngine.Debug.LogError("Harmony Patch: Failed to find 'spriteRenderer' field in SpriteRendererLocalizor. Is the field name correct or has it changed?");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,9 @@
|
||||
<Reference Include="$(DuckovPath)\Duckov_Data\Managed\ItemStatsSystem.dll" Private="False" />
|
||||
<Reference Include="$(DuckovPath)\Duckov_Data\Managed\Unity*" Private="False" />
|
||||
<Reference Include="$(DuckovPath)\Duckov_Data\Managed\FMODUnity.dll" Private="False" />
|
||||
<Reference Include="SodaLocalization">
|
||||
<HintPath>..\..\..\steam\steamapps\common\Escape from Duckov\Duckov_Data\Managed\SodaLocalization.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Lib.Harmony" Version="2.4.1" />
|
||||
|
||||
@@ -38,13 +38,14 @@ namespace UIFrame
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return _apiComponent&&_apiComponent.SetTitleImage(texture);
|
||||
}
|
||||
/// <summary>
|
||||
/// 设置标题图片(游戏中的标题是图片)
|
||||
/// 设置标题图片(游戏中的启动界面Logo)
|
||||
/// </summary>
|
||||
/// <param name="sprite">贴图</param>
|
||||
/// <returns></returns>
|
||||
/// <returns>返回false表示函数调用时设置失败,之后会自动再次尝试设置</returns>
|
||||
public static bool SetGameTitle(Sprite sprite)
|
||||
{
|
||||
return _apiComponent&&_apiComponent.SetTitleImage(sprite);
|
||||
|
||||
@@ -5,16 +5,16 @@ namespace UIFrameAPI
|
||||
{
|
||||
public abstract class UIFrameAPIComponent:MonoBehaviour
|
||||
{
|
||||
public abstract bool CreateCanvas(string name);
|
||||
// public abstract bool CreateCanvas(string name);
|
||||
|
||||
//设置游戏主菜单的原版标题
|
||||
public abstract bool SetTitleImage(Sprite sprite);
|
||||
|
||||
//创建一个TMP字体
|
||||
public abstract TMP_FontAsset CreateFontAsset(string fontFilePath);
|
||||
|
||||
//设置游戏字体
|
||||
public abstract bool SetFont(TMP_FontAsset font);
|
||||
// //创建一个TMP字体
|
||||
// public abstract TMP_FontAsset CreateFontAsset(string fontFilePath);
|
||||
//
|
||||
// //设置游戏字体
|
||||
// public abstract bool SetFont(TMP_FontAsset font);
|
||||
|
||||
public abstract Texture2D? LoadTexture(string imageFilePath);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user