public void onsnap() { if (System.IO.File.Exists(Application.persistentDataPath + "/money.cash")) { Data m = jsonLoader.LoadJson(MoneyManager.Instance.money, "/money.cash"); if (m is Money) { MoneyManager.Instance.money = (Money)m; } } else { MoneyManager.Instance.money = new Money(0); jsonLoader.SaveJson(MoneyManager.Instance.money, "/money.cash"); Debug.Log("created new json"); } snappedPieces++; if (pieces <= snappedPieces) { jsonLoader = new JsonLoader(); Data m = jsonLoader.LoadJson(MoneyManager.Instance.money, "/money.cash"); if (m is Money) { MoneyManager.Instance.money = (Money)m; } //MoneyManager.Instance.money.Amount = Debug.Log("jeeejj je hebt de puzzle af"); MoneyManager.Instance.money.Amount += 100; jsonLoader.SaveJson(MoneyManager.Instance.money, "/money.cash"); Debug.Log(MoneyManager.Instance.money.Amount); } }
void Awake() { CheckPanels(); //Instantiate or load Json File jsonLoader = new JsonLoader(); if (System.IO.File.Exists(Application.persistentDataPath + upgradeSavepath)) { Data d = jsonLoader.LoadJson(upgrades, upgradeSavepath); if (d is Upgrades) { upgrades = (Upgrades)d; } } else { upgrades = new Upgrades(); jsonLoader.SaveJson(upgrades, upgradeSavepath); Debug.Log("created new json"); } if (System.IO.File.Exists(Application.persistentDataPath + "/money.cash")) { Data m = jsonLoader.LoadJson(MoneyManager.Instance.money, "/money.cash"); if (m is Money) { MoneyManager.Instance.money = (Money)m; } } else { MoneyManager.Instance.money = new Money(0); jsonLoader.SaveJson(MoneyManager.Instance.money, "/money.cash"); Debug.Log("created new json"); } upgrades.MaxFuelUpgrade.Price = 150; upgrades.MoveSpeedUpgrade.Price = 200; upgrades.SlideLengthUpgrade.Price = 100; upgradePriceText.text = "$ " + upgrades.MoveSpeedUpgrade.Price; InitiateIndicators(); Debug.Log(MoneyManager.Instance.money.Amount); }
public static void ClassInitialize(TestContext context) { OkChannelResponse = JsonLoader.LoadJson <ChannelResponse>(@"Channels/Data/channel_info.json"); OkBaseResponse = JsonLoader.LoadJson <BaseResponse>(@"Data/base.json"); OkMessagesResponse = JsonLoader.LoadJson <MessagesResponse>(@"Data/messages.json"); OkChannelLeaveResponse = JsonLoader.LoadJson <ChannelLeaveResponse>(@"Channels/Data/channel_leave.json"); OkChannelListResponse = JsonLoader.LoadJson <ChannelListResponse>(@"Channels/Data/channel_list.json"); OkChannelSetPurposeResponse = JsonLoader.LoadJson <ChannelSetPurposeResponse>(@"Channels/Data/channel_setPurpose.json"); OkChannelSetTopicResponse = JsonLoader.LoadJson <ChannelSetTopicResponse>(@"Channels/Data/channel_setTopic.json"); }
//FirebaseData.instance.AddJsonToFirebase("Game System/Preset","Preset"); //FirebaseData.instance.AddJsonToFirebase("Game System/Share Data/Company-UID", "Share Data Company-UID"); public void AddJsonToFirebase(string key, string filePath) { JsonLoader jsonLoader = new JsonLoader(); string json = jsonLoader.LoadJson(filePath); print(json); FirebaseDatabase.DefaultInstance.RootReference.Child(key).SetRawJsonValueAsync(json); }
//loading data from json file public ObservableCollection <ServerInfo> LoadMyServersFromJson() { var collection = JsonLoader.LoadJson <MyServersJSON>("MySerwers.txt"); if (collection != null) { return(collection.MyServers); } return(new ObservableCollection <ServerInfo>()); }
private void DataGridView1_DragDrop(object sender, DragEventArgs e) { // still check if the associated data from the file(s) can be used for this purpose if (e.Data.GetDataPresent(DataFormats.FileDrop)) { // Fetch the file(s) names with full path here to be processed var files = (string[])e.Data.GetData(DataFormats.FileDrop); // Your desired code goes here to process the file(s) being dropped var r = JsonLoader.LoadJson(files); if (r.Items.Any()) { this.Bind(r); } } }
public void initializeUpgrades() { Data d = jsonLoader.LoadJson(playerUpgrades, upgradeSavepath); if (d is Upgrades) { playerUpgrades = (Upgrades)d; } maxFuel += playerUpgrades.MaxFuelUpgrade.Value; currentFuel = maxFuel; fuelBar.maxValue = maxFuel; highlightAmount += Mathf.RoundToInt(playerUpgrades.SlideLengthUpgrade.Value); moveSpeed += playerUpgrades.MoveSpeedUpgrade.Value; }
public static void ClassInitialize(TestContext context) { AuthorizationResponse = JsonLoader.LoadJson <Authorization>(@"Authorizations/Data/oauth_access.json"); }
public static void ClassInitialize(TestContext context) { OkRealTimeMessagingStartResponse = JsonLoader.LoadJson <RealTimeMessagingStartResponse>(@"RealTime/Data/rtm_start.json"); }
public static void ClassInitialize(TestContext context) { OkDirectMessageChannelListResponse = JsonLoader.LoadJson <DirectMessageChannelListResponse>(@"IMs/Data/im_list.json"); }
public static void ClassInitialize(TestContext context) { OkBaseResponse = JsonLoader.LoadJson <BaseResponse>(@"Data/base.json"); OkGroupResponse = JsonLoader.LoadJson <GroupResponse>(@"Groups/Data/group_create.json"); OkMessagesResponse = JsonLoader.LoadJson <MessagesResponse>(@"Data/messages.json"); }
public static void ClassInitialize(TestContext context) { OkEmojiListResponse = JsonLoader.LoadJson <EmojiListResponse>(@"Emoji/Data/emoji_list.json"); }
public static void ClassInitialize(TestContext context) { OkUserListResponse = JsonLoader.LoadJson <UserListResponse>(@"IMs/Data/im_list.json"); }
private void LoadJson() { IJsonLoader jsonLoader = new JsonLoader(); jsonLoader.LoadJson(path, OnJsonLoaded); }
public static void ClassInitialize(TestContext context) { OkBaseResponse = JsonLoader.LoadJson <BaseResponse>(@"Data/base.json"); OkFileInfoResponse = JsonLoader.LoadJson <FileInfoResponse>(@"Files/Data/file_info.json"); OkFileListResponse = JsonLoader.LoadJson <FileListResponse>(@"Files/Data/file_list.json"); }
public NameGeneratorSystem() { WordStorage = JsonLoader.LoadJson <RandomWordStorage>(WordsConfigPath); }
public static void ClassInitialize(TestContext context) { OkChatDeleteResponse = JsonLoader.LoadJson <ChatDeleteResponse>(@"Chat/Data/chat_delete.json"); OkChatPostMessageResponse = JsonLoader.LoadJson <ChatPostMessageResponse>(@"Chat/Data/chat_post_message.json"); OkChatUpdateResponse = JsonLoader.LoadJson <ChatUpdateResponse>(@"Chat/Data/chat_update.json"); }