コード例 #1
0
ファイル: puzzle.cs プロジェクト: Juul1501/Miner
    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);
        }
    }
コード例 #2
0
ファイル: ShopManager.cs プロジェクト: Juul1501/Miner
    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);
    }
コード例 #3
0
 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");
 }
コード例 #4
0
    //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);
    }
コード例 #5
0
        //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>());
        }
コード例 #6
0
        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);
                }
            }
        }
コード例 #7
0
    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;
    }
コード例 #8
0
 public static void ClassInitialize(TestContext context)
 {
     AuthorizationResponse = JsonLoader.LoadJson <Authorization>(@"Authorizations/Data/oauth_access.json");
 }
コード例 #9
0
 public static void ClassInitialize(TestContext context)
 {
     OkRealTimeMessagingStartResponse = JsonLoader.LoadJson <RealTimeMessagingStartResponse>(@"RealTime/Data/rtm_start.json");
 }
コード例 #10
0
 public static void ClassInitialize(TestContext context)
 {
     OkDirectMessageChannelListResponse = JsonLoader.LoadJson <DirectMessageChannelListResponse>(@"IMs/Data/im_list.json");
 }
コード例 #11
0
 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");
 }
コード例 #12
0
 public static void ClassInitialize(TestContext context)
 {
     OkEmojiListResponse = JsonLoader.LoadJson <EmojiListResponse>(@"Emoji/Data/emoji_list.json");
 }
コード例 #13
0
 public static void ClassInitialize(TestContext context)
 {
     OkUserListResponse = JsonLoader.LoadJson <UserListResponse>(@"IMs/Data/im_list.json");
 }
コード例 #14
0
    private void LoadJson()
    {
        IJsonLoader jsonLoader = new JsonLoader();

        jsonLoader.LoadJson(path, OnJsonLoaded);
    }
コード例 #15
0
 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");
 }
コード例 #16
0
 public NameGeneratorSystem()
 {
     WordStorage = JsonLoader.LoadJson <RandomWordStorage>(WordsConfigPath);
 }
コード例 #17
0
 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");
 }