// Use this for initialization protected override void Start() { base.Start(); m_ConfirmSprite = ResourceManager.Instance.Load("confirm_button"); m_DecideSprite = ResourceManager.Instance.Load("s_button"); m_IsProductID = false; ServerDataUtilSend.SendPacketAPI_GetPointShopProduct() .setSuccessAction(_data => { var shop_product = _data.GetResult <ServerDataDefine.RecvGetPointShopProduct>().result.shop_product.ToList(); for (int id = 0; id < shop_product.Count; id++) { if (shop_product[id].fix_id == 0) { continue; } if (shop_product[id].product_type == MasterDataDefineLabel.PointShopType.EVOL) { MainMenuParam.m_PointShopEvolProductID = shop_product[id].fix_id; break; } } m_IsProductID = true; }) // SendStartの失敗時の振る舞い .setErrorAction(_date => { }) .SendStart(); }
// SceneStart後に実行 public void SceneStart() { m_bReady = false; MainImage = ResourceManager.Instance.Load("point_shop_top"); Title0 = GameTextUtil.GetText("pointshop_display3"); Title1 = GameTextUtil.GetText("pointshop_display7"); Title2 = GameTextUtil.GetText("pointshop_display4"); Title3 = GameTextUtil.GetText("pointshop_display5"); UnitPoint = UserDataAdmin.Instance.m_StructPlayer.have_unit_point; // レコード var serverApi = ServerDataUtilSend.SendPacketAPI_GetPointShopProduct(); var products = new List <MasterDataPointShopProduct>(); #if BUILD_TYPE_DEBUG //Debug.Log("products"); #endif // SendStartの成功時の振る舞い serverApi.setSuccessAction(_data => { var shop_product = _data.GetResult <ServerDataDefine.RecvGetPointShopProduct>().result.shop_product.ToList(); products.AddRange(shop_product); products.Sort((a, b) => a.priority - b.priority); #if BUILD_TYPE_DEBUG //Debug.Log("MASTER_HASH_GET:Success"); #endif ClearRecord(); for (int id = 0; id < products.Count; id++) { if (products[id].fix_id == 0) { continue; } AddRecord(id, products[id]); } // シーンの最後に呼び出す PostSceneStart(); }); // SendStartの失敗時の振る舞い serverApi.setErrorAction(_date => { // シーンの最後に呼び出す PostSceneStart(); #if BUILD_TYPE_DEBUG //Debug.Log("MASTER_HASH_GET:Error"); #endif }); serverApi.SendStart(); }