using System; using Godot; /// /// 资源管理类 /// public partial class Res : Node { /// /// 资源类型枚举 /// public enum Type { /// /// 饰品 /// Accessory, /// /// 身体 /// Body, /// /// 眼睛 /// Eye, /// /// 发型 /// Hair, /// /// 服装 /// Outfit, /// /// 手机 /// Phone, ResTypeMax } /// /// 身体资源列表 /// public static readonly string[] Body = [ "res://resources/characters/bodies/Body_48x48_01.png", "res://resources/characters/bodies/Body_48x48_02.png", "res://resources/characters/bodies/Body_48x48_03.png", "res://resources/characters/bodies/Body_48x48_04.png", "res://resources/characters/bodies/Body_48x48_05.png", "res://resources/characters/bodies/Body_48x48_06.png", "res://resources/characters/bodies/Body_48x48_07.png", "res://resources/characters/bodies/Body_48x48_08.png" ]; /// /// 头像身体资源列表 /// public static readonly string[] PortraitBody = [ "res://resources/Portrait/Skins/PG_Skin_1.png", "res://resources/Portrait/Skins/PG_Skin_2.png", "res://resources/Portrait/Skins/PG_Skin_3.png", "res://resources/Portrait/Skins/PG_Skin_4.png", "res://resources/Portrait/Skins/PG_Skin_5.png", "res://resources/Portrait/Skins/PG_Skin_6.png", "res://resources/Portrait/Skins/PG_Skin_7.png", "res://resources/Portrait/Skins/PG_Skin_8.png" ]; /// /// 饰品资源列表 /// public static readonly string[] Accessory = [ "res://resources/characters/accessories/Accessory_01_Ladybug_48x48_01.png", "res://resources/characters/accessories/Accessory_01_Ladybug_48x48_02.png", "res://resources/characters/accessories/Accessory_01_Ladybug_48x48_03.png", "res://resources/characters/accessories/Accessory_01_Ladybug_48x48_04.png", "res://resources/characters/accessories/Accessory_04_Snapback_48x48_01.png", "res://resources/characters/accessories/Accessory_04_Snapback_48x48_02.png", "res://resources/characters/accessories/Accessory_04_Snapback_48x48_03.png", "res://resources/characters/accessories/Accessory_04_Snapback_48x48_04.png", "res://resources/characters/accessories/Accessory_04_Snapback_48x48_05.png", "res://resources/characters/accessories/Accessory_04_Snapback_48x48_06.png", "res://resources/characters/accessories/Accessory_05_Dino_Snapback_48x48_01.png", "res://resources/characters/accessories/Accessory_05_Dino_Snapback_48x48_02.png", "res://resources/characters/accessories/Accessory_05_Dino_Snapback_48x48_03.png", "res://resources/characters/accessories/Accessory_06_Policeman_Hat_48x48_01.png", "res://resources/characters/accessories/Accessory_06_Policeman_Hat_48x48_02.png", "res://resources/characters/accessories/Accessory_06_Policeman_Hat_48x48_03.png", "res://resources/characters/accessories/Accessory_06_Policeman_Hat_48x48_04.png", "res://resources/characters/accessories/Accessory_06_Policeman_Hat_48x48_05.png", "res://resources/characters/accessories/Accessory_06_Policeman_Hat_48x48_06.png", "res://resources/characters/accessories/Accessory_07_Bataclava_48x48_01.png", "res://resources/characters/accessories/Accessory_07_Bataclava_48x48_02.png", "res://resources/characters/accessories/Accessory_07_Bataclava_48x48_03.png", "res://resources/characters/accessories/Accessory_08_Detective_Hat_48x48_01.png", "res://resources/characters/accessories/Accessory_08_Detective_Hat_48x48_02.png", "res://resources/characters/accessories/Accessory_08_Detective_Hat_48x48_03.png", "res://resources/characters/accessories/Accessory_10_Bolt_48x48_01.png", "res://resources/characters/accessories/Accessory_10_Bolt_48x48_02.png", "res://resources/characters/accessories/Accessory_10_Bolt_48x48_03.png", "res://resources/characters/accessories/Accessory_11_Beanie_48x48_01.png", "res://resources/characters/accessories/Accessory_11_Beanie_48x48_02.png", "res://resources/characters/accessories/Accessory_11_Beanie_48x48_03.png", "res://resources/characters/accessories/Accessory_11_Beanie_48x48_04.png", "res://resources/characters/accessories/Accessory_11_Beanie_48x48_05.png", "res://resources/characters/accessories/Accessory_12_Mustache_48x48_01.png", "res://resources/characters/accessories/Accessory_12_Mustache_48x48_02.png", "res://resources/characters/accessories/Accessory_12_Mustache_48x48_03.png", "res://resources/characters/accessories/Accessory_12_Mustache_48x48_04.png", "res://resources/characters/accessories/Accessory_12_Mustache_48x48_05.png", "res://resources/characters/accessories/Accessory_13_Beard_48x48_01.png", "res://resources/characters/accessories/Accessory_13_Beard_48x48_02.png", "res://resources/characters/accessories/Accessory_13_Beard_48x48_03.png", "res://resources/characters/accessories/Accessory_13_Beard_48x48_04.png", "res://resources/characters/accessories/Accessory_13_Beard_48x48_05.png", "res://resources/characters/accessories/Accessory_15_Glasses_48x48_01.png", "res://resources/characters/accessories/Accessory_15_Glasses_48x48_02.png", "res://resources/characters/accessories/Accessory_15_Glasses_48x48_03.png", "res://resources/characters/accessories/Accessory_15_Glasses_48x48_04.png", "res://resources/characters/accessories/Accessory_15_Glasses_48x48_05.png", "res://resources/characters/accessories/Accessory_15_Glasses_48x48_06.png", "res://resources/characters/accessories/Accessory_16_Monocle_48x48_01.png", "res://resources/characters/accessories/Accessory_16_Monocle_48x48_02.png", "res://resources/characters/accessories/Accessory_16_Monocle_48x48_03.png", "res://resources/characters/accessories/Accessory_17_Medical_Mask_48x48_01.png", "res://resources/characters/accessories/Accessory_17_Medical_Mask_48x48_02.png", "res://resources/characters/accessories/Accessory_17_Medical_Mask_48x48_03.png", "res://resources/characters/accessories/Accessory_17_Medical_Mask_48x48_04.png", "res://resources/characters/accessories/Accessory_17_Medical_Mask_48x48_05.png", "res://resources/characters/accessories/Accessory_19_Party_Cone_48x48_01.png", "res://resources/characters/accessories/Accessory_19_Party_Cone_48x48_02.png", "res://resources/characters/accessories/Accessory_19_Party_Cone_48x48_03.png", "res://resources/characters/accessories/Accessory_19_Party_Cone_48x48_04.png" ]; /// /// 眼睛资源列表 /// public static readonly string[] Eye = [ "res://resources/characters/eyes/Eyes_48x48_01.png", "res://resources/characters/eyes/Eyes_48x48_02.png", "res://resources/characters/eyes/Eyes_48x48_03.png", "res://resources/characters/eyes/Eyes_48x48_04.png", "res://resources/characters/eyes/Eyes_48x48_05.png", "res://resources/characters/eyes/Eyes_48x48_06.png", "res://resources/characters/eyes/Eyes_48x48_07.png" ]; /// /// 发型资源列表 /// public static readonly string[] Hair = [ "res://resources/characters/hairstyles/Hairstyle_01_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_01_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_01_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_01_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_01_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_01_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_01_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_02_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_02_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_02_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_02_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_02_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_02_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_02_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_03_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_03_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_03_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_03_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_03_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_03_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_03_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_04_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_04_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_04_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_04_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_04_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_04_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_04_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_05_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_05_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_05_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_05_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_05_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_05_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_05_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_06_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_06_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_06_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_06_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_06_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_06_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_06_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_07_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_07_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_07_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_07_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_07_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_07_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_07_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_08_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_08_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_08_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_08_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_08_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_08_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_08_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_09_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_09_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_09_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_09_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_09_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_09_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_09_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_10_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_10_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_10_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_10_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_10_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_10_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_10_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_11_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_11_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_11_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_11_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_11_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_11_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_11_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_12_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_12_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_12_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_12_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_12_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_12_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_12_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_13_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_13_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_13_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_13_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_13_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_13_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_13_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_14_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_14_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_14_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_14_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_14_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_14_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_14_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_15_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_15_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_15_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_15_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_15_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_15_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_15_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_16_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_16_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_16_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_16_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_16_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_16_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_16_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_17_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_17_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_17_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_17_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_17_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_17_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_17_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_18_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_18_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_18_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_18_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_18_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_18_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_18_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_19_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_19_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_19_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_19_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_19_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_19_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_19_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_20_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_20_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_20_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_20_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_20_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_20_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_20_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_21_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_21_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_21_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_21_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_21_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_21_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_21_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_22_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_22_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_22_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_22_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_22_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_22_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_22_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_23_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_23_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_23_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_23_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_23_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_23_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_23_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_24_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_24_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_24_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_24_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_24_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_24_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_24_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_25_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_25_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_25_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_25_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_25_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_25_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_25_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_26_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_26_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_26_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_26_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_26_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_26_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_26_48x48_07.png", "res://resources/characters/hairstyles/Hairstyle_27_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_27_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_27_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_27_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_27_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_27_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_28_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_28_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_28_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_28_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_28_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_28_48x48_06.png", "res://resources/characters/hairstyles/Hairstyle_29_48x48_01.png", "res://resources/characters/hairstyles/Hairstyle_29_48x48_02.png", "res://resources/characters/hairstyles/Hairstyle_29_48x48_03.png", "res://resources/characters/hairstyles/Hairstyle_29_48x48_04.png", "res://resources/characters/hairstyles/Hairstyle_29_48x48_05.png", "res://resources/characters/hairstyles/Hairstyle_29_48x48_06.png" ]; /// /// 服装资源列表 /// public static readonly string[] Outfit = [ "res://resources/characters/outfits/Outfit_01_48x48_01.png", "res://resources/characters/outfits/Outfit_01_48x48_02.png", "res://resources/characters/outfits/Outfit_01_48x48_03.png", "res://resources/characters/outfits/Outfit_01_48x48_04.png", "res://resources/characters/outfits/Outfit_01_48x48_05.png", "res://resources/characters/outfits/Outfit_01_48x48_06.png", "res://resources/characters/outfits/Outfit_01_48x48_07.png", "res://resources/characters/outfits/Outfit_01_48x48_08.png", "res://resources/characters/outfits/Outfit_01_48x48_09.png", "res://resources/characters/outfits/Outfit_01_48x48_10.png", "res://resources/characters/outfits/Outfit_02_48x48_01.png", "res://resources/characters/outfits/Outfit_02_48x48_02.png", "res://resources/characters/outfits/Outfit_02_48x48_03.png", "res://resources/characters/outfits/Outfit_02_48x48_04.png", "res://resources/characters/outfits/Outfit_03_48x48_01.png", "res://resources/characters/outfits/Outfit_03_48x48_02.png", "res://resources/characters/outfits/Outfit_03_48x48_03.png", "res://resources/characters/outfits/Outfit_03_48x48_04.png", "res://resources/characters/outfits/Outfit_04_48x48_01.png", "res://resources/characters/outfits/Outfit_04_48x48_02.png", "res://resources/characters/outfits/Outfit_04_48x48_03.png", "res://resources/characters/outfits/Outfit_05_48x48_01.png", "res://resources/characters/outfits/Outfit_05_48x48_02.png", "res://resources/characters/outfits/Outfit_05_48x48_03.png", "res://resources/characters/outfits/Outfit_05_48x48_04.png", "res://resources/characters/outfits/Outfit_05_48x48_05.png", "res://resources/characters/outfits/Outfit_06_48x48_01.png", "res://resources/characters/outfits/Outfit_06_48x48_02.png", "res://resources/characters/outfits/Outfit_06_48x48_03.png", "res://resources/characters/outfits/Outfit_06_48x48_04.png", "res://resources/characters/outfits/Outfit_07_48x48_01.png", "res://resources/characters/outfits/Outfit_07_48x48_02.png", "res://resources/characters/outfits/Outfit_07_48x48_03.png", "res://resources/characters/outfits/Outfit_07_48x48_04.png", "res://resources/characters/outfits/Outfit_08_48x48_01.png", "res://resources/characters/outfits/Outfit_08_48x48_02.png", "res://resources/characters/outfits/Outfit_08_48x48_03.png", "res://resources/characters/outfits/Outfit_09_48x48_01.png", "res://resources/characters/outfits/Outfit_09_48x48_02.png", "res://resources/characters/outfits/Outfit_09_48x48_03.png", "res://resources/characters/outfits/Outfit_10_48x48_01.png", "res://resources/characters/outfits/Outfit_10_48x48_02.png", "res://resources/characters/outfits/Outfit_10_48x48_03.png", "res://resources/characters/outfits/Outfit_10_48x48_04.png", "res://resources/characters/outfits/Outfit_10_48x48_05.png", "res://resources/characters/outfits/Outfit_11_48x48_01.png", "res://resources/characters/outfits/Outfit_11_48x48_02.png", "res://resources/characters/outfits/Outfit_11_48x48_03.png", "res://resources/characters/outfits/Outfit_11_48x48_04.png", "res://resources/characters/outfits/Outfit_12_48x48_01.png", "res://resources/characters/outfits/Outfit_12_48x48_02.png", "res://resources/characters/outfits/Outfit_12_48x48_03.png", "res://resources/characters/outfits/Outfit_13_48x48_01.png", "res://resources/characters/outfits/Outfit_13_48x48_02.png", "res://resources/characters/outfits/Outfit_13_48x48_03.png", "res://resources/characters/outfits/Outfit_13_48x48_04.png", "res://resources/characters/outfits/Outfit_14_48x48_01.png", "res://resources/characters/outfits/Outfit_14_48x48_02.png", "res://resources/characters/outfits/Outfit_14_48x48_03.png", "res://resources/characters/outfits/Outfit_14_48x48_04.png", "res://resources/characters/outfits/Outfit_14_48x48_05.png", "res://resources/characters/outfits/Outfit_15_48x48_01.png", "res://resources/characters/outfits/Outfit_15_48x48_02.png", "res://resources/characters/outfits/Outfit_15_48x48_03.png", "res://resources/characters/outfits/Outfit_16_48x48_01.png", "res://resources/characters/outfits/Outfit_16_48x48_02.png", "res://resources/characters/outfits/Outfit_16_48x48_03.png", "res://resources/characters/outfits/Outfit_17_48x48_01.png", "res://resources/characters/outfits/Outfit_17_48x48_02.png", "res://resources/characters/outfits/Outfit_17_48x48_03.png", "res://resources/characters/outfits/Outfit_18_48x48_01.png", "res://resources/characters/outfits/Outfit_18_48x48_02.png", "res://resources/characters/outfits/Outfit_18_48x48_03.png", "res://resources/characters/outfits/Outfit_18_48x48_04.png", "res://resources/characters/outfits/Outfit_19_48x48_01.png", "res://resources/characters/outfits/Outfit_19_48x48_02.png", "res://resources/characters/outfits/Outfit_19_48x48_03.png", "res://resources/characters/outfits/Outfit_19_48x48_04.png", "res://resources/characters/outfits/Outfit_20_48x48_01.png", "res://resources/characters/outfits/Outfit_20_48x48_02.png", "res://resources/characters/outfits/Outfit_20_48x48_03.png", "res://resources/characters/outfits/Outfit_21_48x48_01.png", "res://resources/characters/outfits/Outfit_21_48x48_02.png", "res://resources/characters/outfits/Outfit_21_48x48_03.png", "res://resources/characters/outfits/Outfit_21_48x48_04.png", "res://resources/characters/outfits/Outfit_22_48x48_01.png", "res://resources/characters/outfits/Outfit_22_48x48_02.png", "res://resources/characters/outfits/Outfit_22_48x48_03.png", "res://resources/characters/outfits/Outfit_22_48x48_04.png", "res://resources/characters/outfits/Outfit_23_48x48_01.png", "res://resources/characters/outfits/Outfit_23_48x48_02.png", "res://resources/characters/outfits/Outfit_23_48x48_03.png", "res://resources/characters/outfits/Outfit_23_48x48_04.png", "res://resources/characters/outfits/Outfit_24_48x48_01.png", "res://resources/characters/outfits/Outfit_24_48x48_02.png", "res://resources/characters/outfits/Outfit_24_48x48_03.png", "res://resources/characters/outfits/Outfit_24_48x48_04.png", "res://resources/characters/outfits/Outfit_25_48x48_01.png", "res://resources/characters/outfits/Outfit_25_48x48_02.png", "res://resources/characters/outfits/Outfit_25_48x48_03.png", "res://resources/characters/outfits/Outfit_25_48x48_04.png", "res://resources/characters/outfits/Outfit_25_48x48_05.png", "res://resources/characters/outfits/Outfit_26_48x48_01.png", "res://resources/characters/outfits/Outfit_26_48x48_02.png", "res://resources/characters/outfits/Outfit_26_48x48_03.png", "res://resources/characters/outfits/Outfit_27_48x48_01.png", "res://resources/characters/outfits/Outfit_27_48x48_02.png", "res://resources/characters/outfits/Outfit_27_48x48_03.png", "res://resources/characters/outfits/Outfit_28_48x48_01.png", "res://resources/characters/outfits/Outfit_28_48x48_02.png", "res://resources/characters/outfits/Outfit_28_48x48_03.png", "res://resources/characters/outfits/Outfit_28_48x48_04.png", "res://resources/characters/outfits/Outfit_29_48x48_01.png", "res://resources/characters/outfits/Outfit_29_48x48_02.png", "res://resources/characters/outfits/Outfit_29_48x48_03.png", "res://resources/characters/outfits/Outfit_29_48x48_04.png", "res://resources/characters/outfits/Outfit_30_48x48_01.png", "res://resources/characters/outfits/Outfit_30_48x48_02.png", "res://resources/characters/outfits/Outfit_30_48x48_03.png", "res://resources/characters/outfits/Outfit_31_48x48_01.png", "res://resources/characters/outfits/Outfit_31_48x48_02.png", "res://resources/characters/outfits/Outfit_31_48x48_03.png", "res://resources/characters/outfits/Outfit_31_48x48_04.png", "res://resources/characters/outfits/Outfit_31_48x48_05.png", "res://resources/characters/outfits/Outfit_32_48x48_01.png", "res://resources/characters/outfits/Outfit_32_48x48_02.png", "res://resources/characters/outfits/Outfit_32_48x48_03.png", "res://resources/characters/outfits/Outfit_32_48x48_04.png", "res://resources/characters/outfits/Outfit_32_48x48_05.png", "res://resources/characters/outfits/Outfit_33_48x48_01.png", "res://resources/characters/outfits/Outfit_33_48x48_02.png", "res://resources/characters/outfits/Outfit_33_48x48_03.png" ]; /// /// 手机资源列表 /// public static readonly string[] Smartphone = [ "res://resources/characters/smartphones/Smartphone_48x48_1.png", "res://resources/characters/smartphones/Smartphone_48x48_2.png", "res://resources/characters/smartphones/Smartphone_48x48_3.png", "res://resources/characters/smartphones/Smartphone_48x48_4.png", "res://resources/characters/smartphones/Smartphone_48x48_5.png" ]; /// /// 所有资源聚合数组 /// private static readonly string[][] allResources = [ Accessory, Body, Eye, Hair, Outfit, Smartphone ]; // Called when the node enters the scene tree for the first time. /// /// 场景加载完成时调用 /// public override void _Ready() { } // Called every frame. 'delta' is the elapsed time since the previous frame. /// /// 每帧更新 /// /// 帧间隔 public override void _Process(double delta) { } /// /// 获取随机资源路径 /// /// 资源类型 /// 资源路径 public static string GetRandom(Type resType) { return GetRandom(resType, false); } /// /// 转换为16x16精灵路径 /// /// 原路径 /// 16x16路径 private static string To16Path(string path) { return path.Replace("_48x48_", "_"); } /// /// 标准化资源路径 /// /// 原始路径 /// 资源类型 /// 是否使用16x16像素版本 /// 是否为头像资源 /// 处理后的资源路径 private static string NormalizeResPath(string path, Type resType, bool use16, bool isPortrait) { if (isPortrait) { if (resType is Type.Phone or Type.Outfit) { GD.PrintErr("Phone or Outfit is not supported for portrait"); return ""; } var portraitPath = To16Path(path); switch (resType) { case Type.Accessory: portraitPath = portraitPath.Replace("characters/accessories/", "Portrait/Accessories/PG_"); break; case Type.Body: portraitPath = portraitPath.Replace("characters/bodies/Body", "Portrait/Skins/PG_Skin"); break; case Type.Eye: portraitPath = portraitPath.Replace("characters/eyes/", "Portrait/Eyes/PG_"); break; case Type.Hair: portraitPath = portraitPath.Replace("characters/hairstyles/", "Portrait/Hairstyles/PG_"); break; default: throw new ArgumentOutOfRangeException(nameof(resType), resType, null); } if (ResourceLoader.Exists(portraitPath)) return portraitPath; GD.PrintErr(portraitPath + " is not found"); return ""; } if (!use16) return path; var path16 = To16Path(path); return ResourceLoader.Exists(path16) ? path16 : path; } /// /// 获取随机资源路径(可选16x16) /// /// 资源类型 /// 是否使用16x16精灵 /// 是否为头像 /// 资源路径 public static string GetRandom(Type resType, bool use16, bool isPortrait = false) { return GetResourcePathWithId(0, resType, use16, isPortrait, true).Path; } /// /// 获取指定索引或随机的资源路径 /// /// 资源索引 /// 资源类型 /// 是否使用16x16像素版本 /// 是否为头像资源 /// 是否忽略索引随机获取 /// 资源路径 public static ResPathWithId GetResourcePathWithId(int index, Type resType, bool use16 = false, bool isPortrait = false, bool isRandom = false) { var resources = allResources[(int)resType]; if (resources == null) { GD.PrintErr("resources is null"); foreach (var res in allResources) GD.Print(res.Join(",")); return new ResPathWithId("", 0xFF); } var idx = isRandom ? GD.RandRange(0, resources.Length - 1) : index; return new ResPathWithId(NormalizeResPath(resources[idx], resType, use16, isPortrait), (uint)idx); } public class ResPathWithId(string path, uint id) { public string Path { get; } = path; public uint Id { get; } = id; } }