diff options
author | chai <215380520@qq.com> | 2023-10-27 11:05:14 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2023-10-27 11:05:14 +0800 |
commit | 766cdff5ffa72b65d7f106658d1603f47739b2ba (patch) | |
tree | 34d7799a94dfa9be182825577583c0fa6dc935f7 /GameCode/PlayerSkinBank.cs |
+ init
Diffstat (limited to 'GameCode/PlayerSkinBank.cs')
-rw-r--r-- | GameCode/PlayerSkinBank.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/GameCode/PlayerSkinBank.cs b/GameCode/PlayerSkinBank.cs new file mode 100644 index 0000000..0a5bcd5 --- /dev/null +++ b/GameCode/PlayerSkinBank.cs @@ -0,0 +1,38 @@ +using System; +using UnityEngine; + +[CreateAssetMenu(fileName = "Skin Bank", menuName = "Custom/Skin Bank", order = 99999)] +public class PlayerSkinBank : ScriptableObject +{ + [Serializable] + public struct PlayerSkinInstance + { + public PlayerSkin currentPlayerSkin; + } + + private static PlayerSkinBank instance; + + public PlayerSkinInstance[] skins = new PlayerSkinInstance[0]; + + private static PlayerSkinBank Instance + { + get + { + if (instance == null) + { + instance = Resources.Load("SkinBank") as PlayerSkinBank; + } + return instance; + } + } + + public static PlayerSkin GetPlayerSkinColors(int team) + { + return Instance.skins[team].currentPlayerSkin; + } + + public static PlayerSkinInstance GetPlayerSkin(int team) + { + return Instance.skins[team]; + } +} |