supervisor-simulator/scripts/Res.cs

632 lines
36 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using Godot;
/// <summary>
/// 资源管理类
/// </summary>
public partial class Res : Node {
/// <summary>
/// 资源类型枚举
/// </summary>
public enum Type {
/// <summary>
/// 饰品
/// </summary>
Accessory,
/// <summary>
/// 身体
/// </summary>
Body,
/// <summary>
/// 眼睛
/// </summary>
Eye,
/// <summary>
/// 发型
/// </summary>
Hair,
/// <summary>
/// 服装
/// </summary>
Outfit,
/// <summary>
/// 手机
/// </summary>
Phone,
ResTypeMax
}
/// <summary>
/// 身体资源列表
/// </summary>
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"
];
/// <summary>
/// 头像身体资源列表
/// </summary>
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"
];
/// <summary>
/// 饰品资源列表
/// </summary>
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"
];
/// <summary>
/// 眼睛资源列表
/// </summary>
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"
];
/// <summary>
/// 发型资源列表
/// </summary>
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"
];
/// <summary>
/// 服装资源列表
/// </summary>
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"
];
/// <summary>
/// 手机资源列表
/// </summary>
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"
];
/// <summary>
/// 所有资源聚合数组
/// </summary>
private static readonly string[][] allResources = [
Accessory,
Body,
Eye,
Hair,
Outfit,
Smartphone
];
// Called when the node enters the scene tree for the first time.
/// <summary>
/// 场景加载完成时调用
/// </summary>
public override void _Ready() { }
// Called every frame. 'delta' is the elapsed time since the previous frame.
/// <summary>
/// 每帧更新
/// </summary>
/// <param name="delta">帧间隔</param>
public override void _Process(double delta) { }
/// <summary>
/// 获取随机资源路径
/// </summary>
/// <param name="resType">资源类型</param>
/// <returns>资源路径</returns>
public static string GetRandom(Type resType) {
return GetRandom(resType, false);
}
/// <summary>
/// 转换为16x16精灵路径
/// </summary>
/// <param name="path">原路径</param>
/// <returns>16x16路径</returns>
private static string To16Path(string path) {
return path.Replace("_48x48_", "_");
}
/// <summary>
/// 标准化资源路径
/// </summary>
/// <param name="path">原始路径</param>
/// <param name="resType">资源类型</param>
/// <param name="use16">是否使用16x16像素版本</param>
/// <param name="isPortrait">是否为头像资源</param>
/// <returns>处理后的资源路径</returns>
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;
}
/// <summary>
/// 获取随机资源路径可选16x16
/// </summary>
/// <param name="resType">资源类型</param>
/// <param name="use16">是否使用16x16精灵</param>
/// <param name="isPortrait">是否为头像</param>
/// <returns>资源路径</returns>
public static string GetRandom(Type resType, bool use16, bool isPortrait = false) {
return GetResourcePathWithId(0, resType, use16, isPortrait, true).Path;
}
/// <summary>
/// 获取指定索引或随机的资源路径
/// </summary>
/// <param name="index">资源索引</param>
/// <param name="resType">资源类型</param>
/// <param name="use16">是否使用16x16像素版本</param>
/// <param name="isPortrait">是否为头像资源</param>
/// <param name="isRandom">是否忽略索引随机获取</param>
/// <returns>资源路径</returns>
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;
}
}