summaryrefslogtreecommitdiff
path: root/GameCode/PlayerSkinBank.cs
blob: 0a5bcd566d40d7f29c095a3872afd662382ee1ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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];
	}
}