public IJsonObject GetJsonObject() { JsonPlayer player = new JsonPlayer(); player.Lifes = lifes; player.Score = Score; player.Avatar = (JsonPawn)avatar.GetJsonObject(); return player; }
public void Initialize(JsonPlayer json) { GameManager.I.OnObjectForSaveInstantiated(this); GameMap.I.SubscribeOnContentIsOver(() => { GameManager_FinishGame(false); }); this.Score = json.Score; this.lifes = json.Lifes; avatar = ((GameObject)Instantiate(MapBuilder.I.pacmanPrototype, GameMap.I.SinglePlayerRespawn, new Quaternion())).GetComponent<Pawn>(); avatar.Initialize(this, json.Avatar); }
private void BuildPlayerAvatar(Player player, JsonPlayer? jsonPlayer) { singlePlayer = player; if (jsonPlayer == null) singlePlayer.Initialize(); else singlePlayer.Initialize(jsonPlayer.Value); }