コード例 #1
0
    private void InitializationAllObjects()
    {
        profileDataScript = GameObject.Find("GameManager").GetComponent <ProfileDataScript>();
        loadScript        = GameObject.Find("GameManager").GetComponent <LoadScript>();
        mobileNotificationAndroidScript = GameObject.Find("GameManager").GetComponent <MobileNotificationAndroidScript>();
        loadPersonInfoFromFilesScript   = GameObject.Find("GameManager").GetComponent <LoadPersonInfoFromFilesScript>();

        lowerPanel = GameObject.Find("LowerPanelWithButton");
        topPanel   = GameObject.Find("TopPanelWithShopName");

        searchPanel = topPanel.transform.GetChild(1).gameObject.GetComponent <InputField>();

        helpMessageText = GameObject.Find("HelpMessageText").GetComponent <Text>();
        helpMessageText.gameObject.SetActive(false);

        loadingWindow = GameObject.Find("LoadingWindow");
        loadingWindow.gameObject.SetActive(false);
    }
コード例 #2
0
    public void BuyItemFunc()
    {
        if (newWindow == "busketsItems")
        {
            GameObject content            = GameObject.Find("Content");
            int        countSelectedItems = 0;
            for (int i = 0; i < content.transform.childCount; i++)
            {
                if (content.transform.GetChild(i).GetChild(8).GetComponent <Toggle>().isOn)
                {
                    countSelectedItems++;
                }
            }

            if (countSelectedItems != 0)
            {
                DestroyAllItemsToBuy();
                for (int i = 0; i < content.transform.childCount; i++)
                {
                    if (content.transform.GetChild(i).GetChild(8).GetComponent <Toggle>().isOn)
                    {
                        GameObject newItemToBuy = Instantiate(objectForItemsToBuy, buyItemWindow.transform.GetChild(1).GetChild(0).GetChild(0));
                        newItemToBuy.GetComponent <InfoAboutItemToBuyScript>().item = content.transform.GetChild(i).GetComponent <InfoAboutItem>().item;
                    }
                }

                Instantiate(objectForProfileInfo, buyItemWindow.transform.GetChild(1).GetChild(0).GetChild(0));

                ChouseBuyItemWindow("buyWindow");
            }
            else
            {
                SendHelpMessage("Select any items from list");
            }
        }

        if (newWindow == "buyWindow")
        {
            if (ReturnCountItemWithChouseSize() == buyItemWindow.transform.GetChild(1).GetChild(0).GetChild(0).childCount - 1)
            {
                ProfileDataScript profileDataScript = buyItemWindow.transform.GetChild(1).GetChild(0).GetChild(0).GetChild(buyItemWindow.transform.GetChild(1).GetChild(0).GetChild(0).childCount - 1).GetComponent <ProfileDataScript>();

                if (profileDataScript.isProfileMailConfirmed == true)
                {
                    if (profileDataScript.cashlessPaymentToggle.isOn == true || profileDataScript.cashPaymentToggle.isOn == true)
                    {
                        CreatePackageOfItems(itemsToMail);
                        profileDataScript.SendMessageToCreatorMail(profileDataScript.CreateCheckMessage());
                        SendHelpMessage("Your order is accepted. You will be contacted soon");

                        ChouseMainWindow("mainWindow");

                        loadPersonInfoFromFilesScript.personBusket.Clear(); // Сменить на удаление только купленных товаров

                        loadPersonInfoFromFilesScript.SaveAllDataToFile();
                    }
                    else
                    {
                        SendHelpMessage("Chouse payment method");
                    }
                }
                else
                {
                    SendHelpMessage("Your mail is not confirmed");
                    ChouseLoginWindow();
                }
            }
            else
            {
                SendHelpMessage("Chouse size to all items");
            }
        }
    }
コード例 #3
0
 void InitializationAllObjects()
 {
     gameManager       = GameObject.Find("GameManager").GetComponent <GameManager>();
     profileDataScript = GameObject.Find("GameManager").GetComponent <ProfileDataScript>();
 }