Esempio n. 1
0
        private void ApplyModifier(WeaponDropTarget weapon, DragAndDropModifier droppedModifier)
        {
            weapon.AttachModifyer(droppedModifier);

            for (int i = 0; i < _weapons.Length; ++i)
            {
                if (_weapons[i].AttachedModifyer == null)
                {
                    return;
                }
            }

            for (int i = 0; i < _modifiers.Length; ++i)
            {
                bool modifierNotUsed = true;

                for (int j = 0; j < _weapons.Length; ++j)
                {
                    if (ReferenceEquals(_modifiers[i].RelatedUpgradePair, _weapons[j].AttachedModifyer.RelatedUpgradePair) == true)
                    {
                        modifierNotUsed = false;
                        break;
                    }
                }

                if (modifierNotUsed)
                {
                    WeaponModifierContainer.Instance.ReturnUnlockedMod(_modifiers[i].RelatedUpgradePair.ModifierID);
                }
            }

            for (int i = 0; i < _weapons.Length; ++i)
            {
                _weapons[i].ApplyModifier();
                _weapons[i].DetachModifier();
            }

            DragAndDropModifier.ResetSelection();
            ModifierApplyed.Invoke();
            TransitionScene.Instance.LoadUnloadScene((int)Scenes.INGAME);
        }
Esempio n. 2
0
 public void OnPointerDown(PointerEventData eventData)
 {
     DragAndDropModifier.ResetSelection();
 }