Пример #1
0
    // Use this for initialization
    void Start()
    {
        // Set Unity SDK logging level
        AmazonLogging.Level = AmazonLogging.LoggingLevel.DEBUG;

#if UNITY_EDITOR
        /// This is just to spoof the application to think that its running on iOS platform
        AmazonHookedPlatformInfo.Instance.Platform        = "iPhoneOS";
        AmazonHookedPlatformInfo.Instance.Model           = "iPhone";
        AmazonHookedPlatformInfo.Instance.Make            = "Apple";
        AmazonHookedPlatformInfo.Instance.Locale          = "en_US";
        AmazonHookedPlatformInfo.Instance.PlatformVersion = "8.1.2";

        AmazonHookedPlatformInfo.Instance.Title       = "YourApp";
        AmazonHookedPlatformInfo.Instance.VersionName = "v1.0";
        AmazonHookedPlatformInfo.Instance.VersionCode = "1.0";
        AmazonHookedPlatformInfo.Instance.PackageName = "com.yourcompany.yourapp";
#endif

        analyticsManager = AmazonMobileAnalyticsManager.GetOrCreateInstance(new CognitoAWSCredentials(cognitoIdentityPoolId, cognitoRegion.GetRegionEndpoint()),
                                                                            mobileAnalyticsRegion.GetRegionEndpoint(), appId);
        started = true;
    }
Пример #2
0
    void OnGUI()
    {
        GUILayout.BeginArea(new Rect(0, 0, Screen.width * 0.5f, Screen.height));
        GUILayout.Space(20f);
        GUILayout.Label("HighLevelMappingArbitraryData Operations");
        GUILayout.Label("Note: Use them in the same order");

        if (GUILayout.Button("Create DynamoDBContext", GUILayout.MinHeight(Screen.height * 0.15f), GUILayout.Width(Screen.width * 0.4f)))
        {
            client              = new AmazonDynamoDBClient(new CognitoAWSCredentials(cognitoIdentityPoolId, cognitoRegion.GetRegionEndpoint()), dynamoDBRegion.GetRegionEndpoint());
            context             = new DynamoDBContext(client);
            this.displayMessage = "DynamoDBContext created";
        }
        else if (GUILayout.Button("Create Book", GUILayout.MinHeight(Screen.height * 0.1f), GUILayout.Width(Screen.width * 0.4f)))
        {
            this.CreateBook();
        }
        else if (GUILayout.Button("Retrieve Book", GUILayout.MinHeight(Screen.height * 0.1f), GUILayout.Width(Screen.width * 0.4f)))
        {
            this.RetrieveBook();
        }
        else if (GUILayout.Button("Update Retrieved Book", GUILayout.MinHeight(Screen.height * 0.1f), GUILayout.Width(Screen.width * 0.4f)))
        {
            this.UpdateBook();
        }
        else if (GUILayout.Button("Delete Retrieved Book", GUILayout.MinHeight(Screen.height * 0.1f), GUILayout.Width(Screen.width * 0.4f)))
        {
            this.DeleteBook();
        }
        else if (GUILayout.Button("SingleTableBatchWrite", GUILayout.MinHeight(Screen.height * 0.1f), GUILayout.Width(Screen.width * 0.4f)))
        {
            this.SingleTableBatchWrite();
        }
        GUILayout.EndArea();


        GUILayout.BeginArea(new Rect(Screen.width * 0.55f, 0, Screen.width * 0.45f, Screen.height));
        GUILayout.Label("Response");

        // Display Running Result
        if (displayMessage != null)
        {
            GUILayout.TextField(displayMessage, GUILayout.MinHeight(Screen.height * 0.3f), GUILayout.Width(Screen.width * 0.4f));
        }
        GUILayout.EndArea();
    }
Пример #3
0
    void Start()
    {
        // Set Unity SDK logging level
        AmazonLogging.Level = AmazonLogging.LoggingLevel.DEBUG;

        client = new AmazonDynamoDBClient(new CognitoAWSCredentials(cognitoIdentityPoolId, cognitoRegion.GetRegionEndpoint()), dynamoDBRegion.GetRegionEndpoint());
    }
Пример #4
0
        void Start()
        {
            // Set Unity SDK logging level
            AmazonLogging.Level = AmazonLogging.LoggingLevel.DEBUG;

            try
            {
                client = new AmazonDynamoDBClient(new CognitoAWSCredentials(cognitoIdentityPoolId, cognitoRegion.GetRegionEndpoint()), dynamoDBRegion.GetRegionEndpoint());
            }
            catch (Exception e)
            {
                Debug.LogException(e);
            }
        }