示例#1
0
    private void Awake()
    {
        // Allows this class instance to behave like a singleton
        instance = this;

        GameObject dt = GameObject.Find("DebugText");

        if (dt != null)
        {
            _myText            = dt.GetComponent <Text>();
            IsDebugTextEnabled = (_myText != null);
        }
        else
        {
            IsDebugTextEnabled = false;
        }

        // Attempt to load secrets
        SecretHelper.LoadSecrets(this);

        string connString;

        // Check to see if this is necessary for standalone desktop builds
#if !WINDOWS_UWP
        connString = ConnectionString.Replace("https", "http").Replace("HTTPS", "http").Replace("Https", "http");
#else
        connString = ConnectionString;
#endif
        // Initialize the Cloud Storage Account based on the connection string
        // TO DO: Switch to SAS tokens to eliminate the need to embed connection strings in the app
        StorageAccount = CloudStorageAccount.Parse(connString);
    }
示例#2
0
        protected virtual void Awake()
        {
                        #if !UNITY_WSA || UNITY_EDITOR
            //This works, and one of these two options are required as Unity's TLS (SSL) support doesn't currently work like .NET
            //ServicePointManager.CertificatePolicy = new CustomCertificatePolicy();

            //This 'workaround' seems to work for the .NET Storage SDK, but not event hubs.
            //If you need all of it (ex Storage, event hubs,and app insights) then consider using the above.
            //If you don't want to check an SSL certificate coming back, simply use the return true delegate below.
            //Also it may help to use non-ssl URIs if you have the ability to, until Unity fixes the issue (which may be fixed by the time you read this)
            ServicePointManager.ServerCertificateValidationCallback = CheckValidCertificateCallback;             //delegate { return true; };
                        #endif

            // Attempt to load secrets
            SecretHelper.LoadSecrets(this);

            // Make sure we have enough to continue
            if (string.IsNullOrEmpty(AppId))
            {
                Debug.LogErrorFormat("'{0}' is required but is not set. {1} has been disabled.", "AppId", this.GetType().Name);
                this.enabled = false;
            }

            if (string.IsNullOrEmpty(AppKey))
            {
                Debug.LogErrorFormat("'{0}' is required but is not set. {1} has been disabled.", "AppKey", this.GetType().Name);
                this.enabled = false;
            }

            // Add default strategies (can be overridden)
            AddDefaultStrategies();
        }
示例#3
0
    private void Awake()
    {
        // Attempt to load API secrets
        SecretHelper.LoadSecrets(this);

        if (audioSource == null)
        {
            audioSource = GetComponent <AudioSource>();
        }
    }
 private void Awake()
 {
     // Attempt to load API secrets
     SecretHelper.LoadSecrets(this);
 }