Example #1
0
    public void Start()
    {
        Application.targetFrameRate = 60;

        Loader.LoadAll();
        Loader.LoadStoreInfo(PlayInv.StoreID);

        int FillItems = 0;

        foreach (GameObject Item in PlayInv.Items)
        {
            Item.transform.SetParent(ItemsInStore.transform);
            Item.transform.localPosition = ItemsInStore.transform.GetChild(FillItems).transform.localPosition + new Vector3(0, 0, -0.1f);
            FillItems += 1;
        }
        if (SLAVES != null)
        {
            SLAVES.GetComponent <SlaveEngine>().LengthOfSlaves = PlayInv.Items.Count;
            Greeting1();
        }

        if (ITEMS != null)
        {
            if (ITEMS.GetComponent <ItemEngine>() != null)
            {
                ITEMS.GetComponent <ItemEngine>().LenghtOfItems = PlayInv.Items.Count;
                ShowYourItems();
            }
            else if (ITEMS.GetComponent <BulletsEngine>() != null)
            {
                ITEMS.GetComponent <BulletsEngine>().LenghtOfItems = PlayInv.Items.Count;
                ShowYourItems();
            }
        }

        foreach (GameObject Slave in PlayInv.SlavePlace)
        {
            if (Slave != null)
            {
                if (SLAVES != null)
                {
                    Slave.transform.position = BoughtItems.transform.GetChild(Slave.transform.GetSiblingIndex()).transform.position;
                    BoughtItems.transform.GetChild(Slave.transform.GetSiblingIndex()).gameObject.active = false;
                    Slave.GetComponent <SlaveProperties>().Bought = true;
                }
                else
                {
                    Slave.transform.localPosition = new Vector3(0, 0, 0);
                }
            }
        }

        if (PlayInv.TypeOfStore == "Bullets")
        {
            Loader.FindWeapons(BulletsEngine);
            BulletsEngine.LoadWeapons();
            BulletsEngine.Deselect();
        }
        if (PlayInv.TypeOfStore == "Guns")
        {
            int Plc = 0;
            foreach (GameObject Item in PlayInv.Package)
            {
                if (Item == null)
                {
                    BoughtItems.transform.GetChild(Plc).gameObject.active = true;
                }
                else
                {
                    if (Item.GetComponent <WeaponProperties>() != null)
                    {
                        Item.GetComponent <WeaponProperties>().Bought = true;
                    }
                    if (Item.GetComponent <OtherStuff>() != null)
                    {
                        Item.GetComponent <OtherStuff>().Bought = true;
                    }
                    Item.transform.position = BoughtItems.transform.GetChild(Plc).gameObject.transform.position;
                    BoughtItems.transform.GetChild(Plc).gameObject.active = false;
                }
                Plc++;
            }
            ShowYourItems();
        }
        if (PlayInv.TypeOfStore == "Stuff")
        {
            int Plc = 0;
            foreach (GameObject Item in PlayInv.Package)
            {
                if (Item == null)
                {
                    BoughtItems.transform.GetChild(Plc).gameObject.active = true;
                }
                else
                {
                    if (Item.GetComponent <WeaponProperties>() != null)
                    {
                        Item.GetComponent <WeaponProperties>().Bought = true;
                    }
                    if (Item.GetComponent <OtherStuff>() != null)
                    {
                        Item.GetComponent <OtherStuff>().Bought = true;
                    }
                    Item.transform.position = BoughtItems.transform.GetChild(Plc).gameObject.transform.position;
                    BoughtItems.transform.GetChild(Plc).gameObject.active = false;
                }
                Plc++;
            }
            ShowYourItems();
        }

        if (GetTutor != null)
        {
            if (PlayInv.If_Tutorial == true)
            {
                GetTutor.Steps = PlayInv.Step_Of_Tutorial;
                if (GetTutor.Steps == 1)
                {
                    GetTutor.enabled      = true;
                    GetTutor.First_Launch = true;
                }
            }
        }
    }