Esempio n. 1
0
 private void Start()
 {
     CloseWindow();
     SaveWindow.SetActive(false);
     LoadWindow.SetActive(false);
     LoadButton.gameObject.SetActive(false);
 }
Esempio n. 2
0
    public void SetStatus(CurrentStatus newStatus)
    {
        switch (newStatus)
        {
        case CurrentStatus.NO_ITEM_SELECTED:
            //CancelInvoke("CheckOrderStatus");
            LoadWindow.SetActive(false);
            break;

        case CurrentStatus.STARTING_ORDER:
            LoadWindow.SetActive(true);
            break;

        case CurrentStatus.READY:
            LoadWindow.SetActive(false);
            CancelInvoke("CheckOrderStatus");
            break;

        case CurrentStatus.WAITING:
            InfoWindow.inst.info.SetActive(true);
            LoadWindow.SetActive(true);
            break;

        case CurrentStatus.COMPLETE:
            LoadWindow.SetActive(false);
            CancelInvoke("CheckOrderStatus");
            InfoWindow.inst.OrderSuccess();
            InfoWindow.inst.ShowWindow();
            break;
        }
        currentStatus = newStatus;
    }
Esempio n. 3
0
        public void OpenLoadWindow()
        {
            WindowsBackground.SetActive(true);
            SaveWindow.SetActive(false);
            LoadWindow.SetActive(true);

            MakeLoadButtons();
        }
Esempio n. 4
0
 public void OnOrderCancel()
 {
     if (currentStatus == CurrentStatus.WAITING)
     {
         LoadWindow.SetActive(false);
         InfoWindow.inst.CancelOrder();
         Comanda.C5.PaypalCancel();
     }
 }
Esempio n. 5
0
    public void StartOrder()
    {
        //this.itemName = itemName;
        ShopWindow.SetActive(false);
        LoadWindow.SetActive(true);
        SetStatus(CurrentStatus.STARTING_ORDER);
        PreparePayment existingCreatePaymentAPIcall = ShopSettings.inst.gameObject.GetComponent <PreparePayment>();

        if (existingCreatePaymentAPIcall != null)
        {
            Destroy(existingCreatePaymentAPIcall);
        }

        /*
         *      PreparePayment createPaymentAPICall = ShopSettings.inst.gameObject.AddComponent<PreparePayment>();
         *      createPaymentAPICall.accessToken = ShopSettings.inst.GetComponent<GetAuthorization>().API_Success.access_token;
         *      createPaymentAPICall.transactionDescription = "Food Purchase";
         *      createPaymentAPICall.itemCurrency = ShopSettings.inst.currencyCode;
         *      createPaymentAPICall.itemDescription = itemToPurchase.itemDesc;
         *      createPaymentAPICall.itemName = itemToPurchase.itemName;
         *      createPaymentAPICall.itemPrice = itemToPurchase.itemPrice.ToString();
         *      createPaymentAPICall.JSONrequest = Resources.Load("JSON/PaymentRequest") as TextAsset;
         */
        PreparePayment createPaymentAPICall = ShopSettings.inst.gameObject.AddComponent <PreparePayment>();

        createPaymentAPICall.accessToken = ShopSettings.inst.GetComponent <GetAuthorization>().API_Success.access_token;

        /*createPaymentAPICall.transactionDescription = "Consegna a Domicilio";
        *  createPaymentAPICall.itemCurrency = ShopSettings.inst.currencyCode;
        *  createPaymentAPICall.itemDescription = "orecchiette alla capuana";
        *  createPaymentAPICall.itemName = "pasta";
        *  createPaymentAPICall.itemPrice = itemToPurchase.itemPrice.ToString();*/
        createPaymentAPICall.JSONrequest = Orderstring;
        //createPaymentAPICall.JSONrequest = Application.persistentDataPath("PaymentRequest") as TextAsset;

        //var sr = new StreamReader(Application.dataPath + "/" + "PaymentRequest") as TextAsset;
        InvokeRepeating("CheckOrderStatus", 1f, 1f);
    }
Esempio n. 6
0
 public void OpenSaveWindow()
 {
     WindowsBackground.SetActive(true);
     SaveWindow.SetActive(true);
     LoadWindow.SetActive(false);
 }