Ejemplo n.º 1
0
        // Use this for initialization
        IEnumerator Start()
        {
            // By default, set the label to indicate this isn't a web build.
            infoLabel.text = ForWebGlMessage;

            // Check if this is a web build
            if ((domainVerifier != null) && (Application.platform == RuntimePlatform.WebGLPlayer))
            {
                // Print that we're loading
                infoLabel.text = LoadingMessage;

                // Start the verification process
                yield return(StartCoroutine(domainVerifier.VerifyWebDomain()));

                // Update the reason for this dialog to appear
                infoLabel.text = DebugWebDomainInfo.GetDebugMessage(domainVerifier, new StringBuilder());
            }
        }
        public void UpdateReason(Reason reason)
        {
            // Update the reason for this dialog to appear
            switch (reason)
            {
            case Reason.CannotConfirmDomain:
                // Update translation key
                reasonMessage.TranslationKey = cannotConfirmDomainMessageTranslationKey;
                break;

            case Reason.IsIncorrectDomain:
                if (domainVerifier != null)
                {
                    // Setup translation key, with proper population of fields
                    reasonMessage.SetTranslationKey(domainDoesNotMatchMessageTranslationKey, domainVerifier.RetrievedHostName);
                }
                else
                {
                    // Update translation key
                    reasonMessage.TranslationKey = gameIsNotGenuineMessageTranslationKey;
                }
                break;

            case Reason.JustTesting:
                // Overwrite the text: it's a test
                StringBuilder builder = new StringBuilder();
                builder.Append("This menu is just a test. ");
                DebugWebDomainInfo.GetDebugMessage(domainVerifier, builder);
                reasonMessage.CurrentText = builder.ToString();
                break;

            default:
                // Update translation key
                reasonMessage.TranslationKey = gameIsNotGenuineMessageTranslationKey;
                break;
            }
        }