void OnEnable() { if (null == WULogin.AvailableGames) { WULogin.LoadAvailableGames(); } s = (WPServer)target; serializedGameID = serializedObject.FindProperty("game_id"); overrideGameID = serializedObject.FindProperty("manual_select_game_id"); manualValue = serializedObject.FindProperty("manually_specified_id"); int i = index = last_index = 0; if (WULogin.AvailableGames.Count > 1) { for (i = 0; i < WULogin.AvailableGames.Count - 1; i++) { if (WULogin.AvailableGames [i + 1].Int("gid") == WPServer.GameID) { index = i; } } SetNewGameID(WULogin.AvailableGames [index + 1].Int("gid")); } else { SetNewGameID(1); } }
public void UnlockWeapon() { if (WULogin.Cash(1) < weapon.Weapon.UnlockCost || Data.Unlocked.Bool(weapon.Weapon.WeaponName)) { return; } WUMoney.SpendCurrency(weapon.Weapon.UnlockCost, "dust", $"unlock,{(int)weapon_type}"); }
void OnEnable() { if (null == Data.Stock) { return; } //don't allow it to be unlocked twice blocker.SetActive(!Data.Unlocked.Bool(weapon.Weapon.WeaponName) && (WULogin.Cash(1) < weapon.Weapon.UnlockCost) || Data.Unlocked.Bool(weapon.Weapon.WeaponName)); cost_obj.SetActive(!Data.Stock.defined.ContainsKey(weapon.Weapon.WeaponName)); cost_text.text = $"Unlock\n{weapon.Weapon.UnlockCost}"; }
public override void OnInspectorGUI() { if (!Application.isPlaying) { PopulateGameList(); if (null == s) { return; } overrideGameID.boolValue = EditorGUILayout.Toggle("Override Game ID", overrideGameID.boolValue); if (overrideGameID.boolValue) { manualValue.intValue = EditorGUILayout.IntField("Game ID", manualValue.intValue); } else { if (gamesList != null && !Application.isPlaying) { index = EditorGUILayout.Popup("Select Game", index, gamesList); } if (last_index != index) { last_index = index; SetNewGameID(WULogin.AvailableGames [index + 1].Int("gid")); } if (GUILayout.Button("Refresh Games List") && !Application.isPlaying) { WULogin.FetchAvailableGameInfo(); } EditorGUILayout.LabelField("Game ID", $"{serializedGameID.intValue}"); } serializedObject.ApplyModifiedProperties(); EditorGUILayout.Space(); } DrawDefaultInspector(); }
void ShowCoins() => coins_text.text = $"{ WULogin.Cash( "dust" ) } Gold";
void UpdateGUI(MBSEvent response) { WULogin.fetched_info.Set(WULogin.CurrencyString("dust"), response.details [0].String()); ShowCoins(); }
void UpdateCurrency(MBSEvent response) { string currency_name = response.details [0].String("currency"); WULogin.fetched_info?.Seti(WULogin.CurrencyString(currency_name), response.details [0].Int()); }
void OnPointsEarned(MBSEvent response) => WULogin.fetched_info?.Seti(WULogin.CurrencyString("dust"), response.details [0].Int("total"));