예제 #1
0
    private void Update()
    {
        if (paused || gameID.IsNullOrEmpty())
        {
            return;
        }
        AddCollectables();
        UpdateGameEquipment();
        UpdateMovingGameEquipment();
        if (Time.time - lastObjectUpdateTime > App.config.locationRefreshRate)
        {
            lastObjectUpdateTime = Time.time;
            UpdateObjects();
#pragma warning disable 4014
            ServerAPI.GetItems(gameID);
            // -> OnGetItemsResponse
#pragma warning restore 4014
        }
    }
예제 #2
0
    /**<summary> Input handler for the dropdown in main view of the app </summary>*/
    public async void MainViewDropdown(int itemID)
    {
        switch (itemID)
        {
        case 0:     // Restart
            SceneManager.LoadScene(SceneManager.GetActiveScene().name);
            break;

        case 1:     // Select Building
            locationController.SelectLocationDialog();
            break;

        case 2:     // Dummy Location
            await ServerAPI.LocationFineDummy(locationController.buildingID, new byte[0]);

            break;

        case 3:     // Test Image
            FindObjectOfType <ARControllerTest>().RandomImage();
            break;

        case 4:     // Get Items
            await ServerAPI.GetItems(worldController.gameID);

            // -> WorldController.OnGetItemsResponse
            break;

        case 5:     // Save Items
            worldController.SaveItems();
            // -> WorldController.OnSaveItemsResponse
            break;

        case 6:     // Delete Items
            await ServerAPI.DeleteItemsDummy(locationController.buildingID, locationController.areaID);

            // -> WorldController.OnDeleteItemsResponse
            break;

        default:
            break;
        }
    }
예제 #3
0
    /**<summary> Setup world, instantiate items, enemies etc. </summary>*/
    public async void SetupWorld(string gameID)
    {
        await ServerAPI.GetItems(gameID);

        this.gameID = gameID;
    }