private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { DontDestroyOnLoad(this); _instance = this; m_Selection = new int[4]; for (int i = 0; i < m_Selection.Length; i++) { m_Selection[i] = Random.Range(0, m_Skins.Length - 1); } m_Colors = new Color[5]; m_Colors[0] = new Color(100 / 255f, 143 / 255f, 255 / 255f); m_Colors[1] = new Color(120 / 255f, 94 / 255f, 240 / 255f); m_Colors[2] = new Color(220 / 255f, 38 / 255f, 127 / 255f); m_Colors[3] = new Color(254 / 255f, 97 / 255f, 0 / 255f); m_Colors[4] = new Color(255 / 255f, 176 / 255f, 0 / 255f); } }
void Start() { dataManager = GameManager.instance.GetUserDataManager(); skinManager = GameManager.instance.GetSkinManager(); curInd = dataManager.GetCurUser().playerSkinInd; SwitchCharacter(); }
protected override void GetComponents() { base.GetComponents(); //get components var gm = GameManager.instance; if (gm) { dataManager = gm.GetUserDataManager(); spawnManager = gm.GetSpawnManager(); skinManager = gm.GetSkinManager(); gm.SpawnedPlayer = this; } }
private void Awake() { instance = this; }
public PlayerSkinData GetSkinData() { PlayerSkinManager sm = GameManager.instance.GetSkinManager(); return(sm.playerSkins[userContainer.users[userContainer.curUserId].playerSkinInd]); }