protected override ConfigFileContent LoadJsonConfig(string json) { ConfigFileContentList gameList = JsonUtility.FromJson <ConfigFileContentList>(json); if (gameList.Entries == null || gameList.Entries.Length == 0 || transform.GetSiblingIndex() > gameList.Entries.Length - 1) { return(null); } return(gameList.Entries[transform.GetSiblingIndex()]); }
protected override string GetJsonConfig() { GameModelSetup[] gameModelSetups = transform.parent.GetComponentsInChildren <GameModelSetup>(); if (gameModelSetups.Length == 0) { return(null); } ConfigFileContentList gameList = new ConfigFileContentList(gameModelSetups.Length); for (int i = 0; i < gameModelSetups.Length; ++i) { gameList.Entries[i] = new ConfigFileContent(gameModelSetups[i]); } return(JsonUtility.ToJson(gameList, true)); }