示例#1
0
    /// <summary>
    /// Start
    /// </summary>
    private void Start()
    {
        var atlas = GlobalSpriteAtlas.GetAtlas(GlobalSpriteAtlas.AtlasType.Localization);

#if UNITY_EDITOR
        if (atlas == null)
        {
            atlas = new AtlasSpriteCache(Resources.Load <SpriteAtlas>(GetLocalizationAtlasPath()));
            GlobalSpriteAtlas.SetAtlas(GlobalSpriteAtlas.AtlasType.Localization, atlas);
        }
#endif
        this.image.sprite = atlas.GetSprite(this.spriteName);
    }
示例#2
0
    /// <summary>
    /// ログイン処理
    /// </summary>
    private void Login()
    {
        var queue = new Queue <Action>();

        //ユーザーデータがある
        if (UserData.Get().userId > 0)
        {
            //ログイン
            queue.Enqueue(() => LoginApi.CallLoginApi(
                              UserData.Get(),
                              queue.Dequeue()
                              ));
        }
        //ユーザーデータがない
        else
        {
            //ユーザーデータ作成
            queue.Enqueue(() => UserApi.CallCreateApi(
                              "GuestUser",
                              queue.Dequeue()
                              ));
        }

        //ユーザー情報取得
        queue.Enqueue(() => FirstApi.CallFirstUserApi(
                          UserData.Get(),
                          queue.Dequeue()
                          ));

        //マスター分割取得その1
        queue.Enqueue(() => MasterApi.CallGetMasterApi(
                          queue.Dequeue(),
                          Masters.AccessoriesDB,
                          Masters.BarrelDB,
                          Masters.BatteryDB,
                          Masters.BulletDB,
                          Masters.FvAttackDB,
                          Masters.TurretSerieseDB,
                          Masters.CannonSetDB,
                          Masters.ConfigDB,
                          Masters.FishDB,
                          Masters.FishCaptureDB
                          ));

        //マスター分割取得その2
        queue.Enqueue(() => MasterApi.CallGetMasterApi(
                          queue.Dequeue(),
                          Masters.FishCategoryDB,
                          Masters.FishParticleDB,
                          Masters.GearDB,
                          Masters.BattleItemDB,
                          Masters.ItemSellDB,
                          Masters.LevelDB,
                          Masters.BetDB,
                          Masters.LocalizeTextDB,
                          Masters.LoginBonusDB,
                          Masters.LoginBonusSpecialDB
                          ));

        //マスター分割取得その3
        queue.Enqueue(() => MasterApi.CallGetMasterApi(
                          queue.Dequeue(),
                          Masters.PartsExpansionDB,
                          Masters.CannonExpansionDB,
                          Masters.GearExpansionDB,
                          Masters.MessageDB,
                          Masters.MissionTypeDB,
                          Masters.MissionRewardDB,
                          Masters.MultiWorldDB,
                          Masters.MultiBallDropRateDB,
                          Masters.MultiSoulDropRateDB,
                          Masters.MultiStageFishDB
                          ));

        //マスター分割取得その4
        queue.Enqueue(() => MasterApi.CallGetMasterApi(
                          queue.Dequeue(),
                          Masters.SerieseSkillDB,
                          Masters.SingleStageDB,
                          Masters.SingleStageFishDB,
                          Masters.SingleStageFirstRewardDB,
                          Masters.SingleStageRewardDB,
                          Masters.SingleStageRewardLotDB,
                          Masters.SingleWorldDB,
                          Masters.SkillDB,
                          Masters.SkillGroupDB,
                          Masters.VipBenefitDB
                          ));

        //マスター分割取得その5
        queue.Enqueue(() => MasterApi.CallGetMasterApi(
                          queue.Dequeue(),
                          Masters.VipBenefitTypeDB,
                          Masters.VipLevelDB,
                          Masters.VipRewardDB
                          ));

        //ローカライズアトラスセット
        queue.Enqueue(() =>
        {
            var handle = AssetManager.Load <SpriteAtlas>(LocalizeImage.GetLocalizationAtlasPath(), (asset) =>
            {
                var atlas = new AtlasSpriteCache(asset);
                GlobalSpriteAtlas.SetAtlas(GlobalSpriteAtlas.AtlasType.Localization, atlas);
                queue.Dequeue().Invoke();
            });

            handle.isDontDestroy = true;
        });

        //HOMEシーンへ
        queue.Enqueue(() =>
                      SceneChanger.ChangeSceneAsync("Home")
                      );

        //Queue実行
        queue.Dequeue().Invoke();
    }