public void LoadData(string key, Action <bool> callback = null) { Debug.Log(_currentMethod); _currentMethod.Load(key, (h, e) => { if (e == null && callback != null) { if (h == null) { callback(false); _saveKey = key; _saveData = new Dictionary <string, object>(); } else { _saveKey = key; _saveData = h; callback(true); } } else if (e != null) { Debug.LogError(e.Message); Debug.LogError(e.StackTrace); if (callback != null) { callback(false); } } }); }
// タップ時の処理 public void OnTapPopup(int channelnumber) { saveData = saveMethod.Load(); // チャンネルが存在すれば蓄積時間を計算 for (int i = 0; i < 6; i++) { // 自チャンネル以外 if (i != channelnumber) { if (saveData.Id[i] != 0) { saveData.Accumulation[i] += saveData.Frequency[channelnumber] - saveData.Accumulation[channelnumber]; // (配信頻度 - 蓄積時間) =他の蓄積時間 Debug.Log("TapPopUp/OntapuPopup" + saveData.Accumulation[i]); } } } saveData.Accumulation[channelnumber] = 0.0f; // 自チャンネルの蓄積時間をゼロに saveData.ActiveCounter[channelnumber] = 1; // アクティブカウンターをアクティブ(1)に saveMethod.Save(saveData); SceneManager.LoadScene("Broadcast"); }
void Start() { saveData = saveMethod.Load(); constData = constMethod.Load(); int element = 0; // 自ライバーの数 // Listに全て格納 AddList(ref subscriberList, ref element, constData, saveData); // if: readonly out: write ref: both // ソート subscriberList.Sort(); subscriberList.Reverse(); // ランキング表示 DisplayRanking(subscriberList, element); subscriberList.Clear(); // Listの消去 }
// 画面タップ時 public void OnTapScreen() { saveData = saveMethod.Load(); // 年度の更新 saveData.Week = 1; saveData.Month = 4; saveData.Year += 1; saveMethod.Save(saveData); Advertisement.Show(mySurfacingId); }
// 青スパ処理 public void BlueSuperchat(int element) { // 色変更 commentBox[element].color = Color.blue; // タップ時の処理をイベントトリガーに追加する処理 EventTrigger.Entry entry = new EventTrigger.Entry(); currentTrigger[element].triggers = new List<EventTrigger.Entry>(); entry.eventID = EventTriggerType.PointerDown; entry.callback.AddListener((data) => { // セーブ saveData = saveMethod.Load(); saveData.SuperChat[0] += 1; saveMethod.Save(saveData); // 色を戻す commentBox[element].color = Color.white; // イベントを消去 currentTrigger[element].triggers.Remove(entry); }); currentTrigger[element].triggers.Add(entry); }
void Start() { saveData = saveMethod.Load(); liver_one.SetActive(false); liver_two.SetActive(false); liver_three.SetActive(false); liver_four.SetActive(false); liver_five.SetActive(false); liver_six.SetActive(false); // アクティブカウンターが1である要素を取得 element = GetActiveLiverElement(saveData.ActiveCounter); // 要素に応じてライバーを表示 DisplayLiver(element); }
void Start() { saveData = saveMethod.Load(); // アクティブカウンターが1である要素を取得 element = GetActiveLiverElement(saveData.ActiveCounter); // 放送時間のテキスト表示 BroadcastTimeDisplay(); // 最多同時視聴者数のテキスト表示 ListnerDisplay(saveData.Subscriber[element]); // 登録者増加数のテキスト表示 SubscriberUpDisplay(saveData, element); // スーパーコメントのテキスト表示 SuperCommentDisplay(saveData); }
void Update() { saveData = saveMethod.Load(); // 年月週表示 yearText.text = saveData.Year.ToString(); monthText.text = saveData.Month.ToString(); weekText.text = saveData.Week.ToString(); timer += Time.deltaTime; // Debug.Log(timer); // ベースの時間と年月週を更新してセーブ if (timer >= border) { saveData.NowTime += border; saveData.Week += 1; // 一定の年月週で値を更新 if (saveData.Week == 5) // 5週目で月+1 週→1 { saveData.Month += 1; saveData.Week = 1; if (saveData.Month == 13) // 13月→1月 { saveData.Month = 1; } else if (saveData.Month == 4) // 4月1週→エンディングへ { // 年度末イベント発生 SceneManager.LoadScene("Ending"); } } saveMethod.Save(saveData); // タイマーの初期化 timer = 0.0f; } }
void Update() { saveData = saveMethod.Load(); timer += Time.deltaTime; // チャンネルが存在すれば判定 if (saveData.Id[0] != 0) { DisplayPopupOne(saveData); } if (saveData.Id[1] != 0) { DisplayPopupTwo(saveData); } if (saveData.Id[2] != 0) { DisplayPopupThree(saveData); } if (saveData.Id[3] != 0) { DisplayPopupFour(saveData); } if (saveData.Id[4] != 0) { DisplayPopupFive(saveData); } if (saveData.Id[5] != 0) { DisplayPopupSix(saveData); } }