Пример #1
0
 void UpdateStylePoints(EventCoinsToSpend eventCoinsToSpend)
 {
     costOfDonation               = eventCoinsToSpend.coins;
     upgradedStylePoints          = upgradedWearable.stylePoints;
     upgradedWearable.stylePoints = eventCoinsToSpend.stylePoints + upgradedOriginalStylePoints;
     upgradedWearable.GetComponent <IconUpdate>().UpdateInformation();
 }
Пример #2
0
        public void DoesItemQualifyForDonation(EventAddToUpgradeSlot eventAddToUpgradeSlot)
        {
            if (!ValidateItem(eventAddToUpgradeSlot.combinedWearable))
            {
                donationPopUpWarnings.ShowWarningPopUp(eventAddToUpgradeSlot.combinedWearable);
                return;
            }

            donationPopUpWarnings.DisableWarning();
            TryRemoveChildren();

            originalWearable             = Instantiate(eventAddToUpgradeSlot.combinedWearable, itemToDonateSlot.transform, true);
            originalWearable.Amount      = eventAddToUpgradeSlot.combinedWearable.Amount;
            originalWearable.stylePoints = eventAddToUpgradeSlot.combinedWearable.stylePoints;
            originalWearable.GetComponent <IconUpdate>().UpdateInformation();
            var scale = itemToDonateSlot.GetComponent <RectTransform>().localScale;

            originalWearable.transform.localPosition = Vector2.zero;
            originalWearable.GetComponent <RectTransform>().localScale = scale;
            Destroy(originalWearable.GetComponent <Button>());
            originalWearable.GetComponent <CanvasGroup>().blocksRaycasts = false;

            upgradedWearable             = Instantiate(eventAddToUpgradeSlot.combinedWearable, upgradedItemSlot.transform, true);
            upgradedWearable.Amount      = 1;
            upgradedWearable.stylePoints = eventAddToUpgradeSlot.combinedWearable.stylePoints;
            upgradedOriginalStylePoints  = upgradedWearable.stylePoints;
            upgradedWearable.GetComponent <IconUpdate>().UpdateInformation();
            var scale2 = itemToDonateSlot.GetComponent <RectTransform>().localScale;

            upgradedWearable.transform.localPosition = Vector2.zero;
            upgradedWearable.GetComponent <RectTransform>().localScale   = scale2;
            upgradedWearable.GetComponent <CanvasGroup>().blocksRaycasts = false;
            Destroy(upgradedItemSlot.GetComponent <Button>());

            EventBroker.Instance().SendMessage(new EventUpdateAlternativesButtons());
        }
Пример #3
0
        void AssignToSlot(CombinedWearables combinedWearables)
        {
            if (combinedWearables.Amount <= 0)
            {
                return;
            }

            for (var i = 0; i < slots.Length; i++)
            {
                if (slots[i].transform.childCount > 0)
                {
                    if (!combineWearablesDic.ContainsValue(combinedWearables.rarity) || combineWearablesDic.ContainsKey(PlayerInventory.GetName(combinedWearables)))
                    {
                        break;
                    }
                }

                if (slots[i].transform.childCount < 1)
                {
                    var instance = Instantiate(combinedWearables, slots[i].transform, true);
                    instance.Amount      = combinedWearables.Amount;
                    instance.stylePoints = combinedWearables.stylePoints;
                    var scale = combinedWearables.GetComponent <RectTransform>().localScale;
                    instance.transform.localPosition = Vector2.zero;
                    instance.GetComponent <RectTransform>().localScale = scale;

                    instance.GetComponent <IconUpdate>().UpdateInformation();
                    Destroy(instance.GetComponent <AssignCombinedWearableToUpCycle>());
                    Destroy(instance.GetComponent <Button>());
                    combineWearablesDic[PlayerInventory.GetName(combinedWearables)] = combinedWearables.rarity;
                    break;
                }
            }

            EventBroker.Instance().SendMessage(new EventValidateConfirmButton(slots[0].transform.childCount > 0 && slots[1].transform.childCount > 0));
        }
Пример #4
0
        void Resize(CombinedWearables go, float newScale)
        {
            var newSize = new Vector2(newScale, newScale);

            go.GetComponent <RectTransform>().localScale = newSize;
        }
Пример #5
0
 static void UpdateHud(CombinedWearables wearable)
 {
     wearable.GetComponent <IconUpdate>().UpdateImages();
 }