void Awake()
    {
        DontDestroyOnLoad(gameObject);
        SA_EditorTesting.CheckForEventSystem();

        Canvas can = GetComponent <Canvas>();

        can.sortingOrder = SA_EditorTesting.DEFAULT_SORT_ORDER + 1;
    }
예제 #2
0
    private void GenerateConnectionResult()
    {
        bool IsSucceeded = SA_EditorTesting.HasFill(_RequestsSuccessRate);

        BillingResult result;

        if (IsSucceeded)
        {
            _IsConnected = true;
            result       = new BillingResult(BillingResponseCodes.BILLING_RESPONSE_RESULT_OK, "Connection Successful");
            SA_EditorNotifications.ShowNotification("Billing Connected", "Connection successful", SA_EditorNotificationType.Message);
        }
        else
        {
            result = new BillingResult(BillingResponseCodes.BILLINGHELPER_UNKNOWN_ERROR, "Connection Failed");
            SA_EditorNotifications.ShowNotification("Billing Connection Failed", "Connection Failed", SA_EditorNotificationType.Error);
        }

        _IsConnectingToServiceInProcess = false;
        ActionBillingSetupFinished(result);
    }
    public void Connect()
    {
        SA.Common.Util.General.Invoke(UnityEngine.Random.Range(0.5f, 3f), () => {
            bool IsSucceeded             = SA_EditorTesting.HasFill(_RequestsSuccessRate);
            UM_BillingConnectionResult r = new UM_BillingConnectionResult();


            if (IsSucceeded)
            {
                _IsConnected = true;
                r.isSuccess  = true;
                r.message    = "Editor Testing Service Connected";
                SA_EditorNotifications.ShowNotification("Billing Connected", "Connection successful", SA_EditorNotificationType.Message);
            }
            else
            {
                r.isSuccess = false;
                r.message   = "Connection failed";
                SA_EditorNotifications.ShowNotification("Billing Connection Failed", "Connection Failed", SA_EditorNotificationType.Error);
            }
            SendServiceConnectedEvent(r);
        });
    }