private void SavePlayerCustomisation(int index, PlayerCustomisationData data) { string key = GetPrefsKeyForPlayer(index); string value = JsonUtility.ToJson(data); PlayerPrefs.SetString(key, value); }
private void ChangePlayerCustomisationContext(int playerID) { this.playerID = playerID; customisationData = CManager.GetPlayerCustomisation(playerID); OnPlayerChange.Invoke(customisationData); DragonHelper.SetDragonAsPlayer(customisationData, DemoDragon); UpdateUI(playerID); }
private PlayerCustomisationData LoadPlayerCustomisation(int index) { string key = GetPrefsKeyForPlayer(index); string value = PlayerPrefs.GetString(key); var data = PlayerCustomisationData.CreateDefault(index); JsonUtility.FromJsonOverwrite(value, data); return(data); }
public static void SetDragonAsPlayer( PlayerCustomisationData cData, GameObject dragon, bool changeColour = true) { PlayerInput pl = dragon.AddComponent <PlayerInput>(); pl.leftKey = cData.LeftButton; pl.rightKey = cData.RightButton; if (changeColour) { Palette pal = dragon.GetComponent <Palette>(); pal.ColourSet = ColourCatalogue.GetColourSet(cData.ColourSetIndex); } }
public void SetPlayerCustomisation(int i, PlayerCustomisationData data) { PlayerCustomisations[i] = data; }
public void SetContext(PlayerCustomisationData customisationData) { this.customisationData = customisationData; UpdateUIColours(customisationData.ColourSetIndex); }
public void SetContext(PlayerCustomisationData customisationData) { this.customisationData = customisationData; leftText.text = customisationData.LeftButton; rightText.text = customisationData.RightButton; }