Ejemplo n.º 1
0
    /// <summary>
    /// Loads last saved player's data from local cache and server, sets up fruiton database.
    /// </summary>
    private void Initialize()
    {
        FruitonDatabase = new FruitonDatabase(KernelUtils.LoadTextResource(FRUITON_DB_FILE));
        AllFruitons     = ClientFruitonFactory.CreateAllKernelFruitons();

        if (IsInTrial)
        {
            AvailableFruitons = AllPlayableFruitons.Select(fruiton => fruiton.dbId).ToList();
            FruitonTeamList   = new FruitonTeamList();
            loggedPlayerInfo  = new LoggedPlayerInfo();
        }
        else
        {
            PlayerOptions = Serializer.LoadPlayerSettings();
            Serializer.DeserializeFruitonTeams();
            AvailableFruitons = Serializer.LoadAvailableFruitons();
        }

        if (IsOnline)
        {
            PlayerHelper.GetAllFruitonTeams(MergeTeamLists, Debug.Log);
            PlayerHelper.GetAvailableFruitons((list) => Debug.Log("Available fruitons loaded from server."), Debug.Log);
        }
    }