示例#1
0
        public IJsonObject GetJsonObject()
        {
            JsonPlayer player = new JsonPlayer();
            player.Lifes = lifes;
            player.Score = Score;
            player.Avatar = (JsonPawn)avatar.GetJsonObject();

            return player;
        }
示例#2
0
        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);
        }
示例#3
0
 private void BuildPlayerAvatar(Player player, JsonPlayer? jsonPlayer)
 {
     singlePlayer = player;
     if (jsonPlayer == null)
         singlePlayer.Initialize();
     else
         singlePlayer.Initialize(jsonPlayer.Value);
 }