Beispiel #1
0
 protected override void ImmediateReaction()
 {
     if (toggle != null)
     {
         if (toggle.isOn)
         {
             if (index == -1)
             {
                 index = barsModifier.addToModifiers(new Modifier(modifierDescription, moneyModifierSlider.value, ecoModifierSlider.value, comfortModifierSlider.value));
             }
             else
             {
                 Debug.LogError("an object was already added");
             }
         }
         else
         {
             if (index == -1 || !barsModifier.removeFromModifiers(index))
             {
                 Debug.LogError("failed to remove");
             }
             index = -1;
         }
     }
 }
Beispiel #2
0
    protected override void ImmediateReaction()
    {
        if (toggle.isOn)
        {
            if (moneyController.buyShopObject(objectPrize))
            {
                shopConditionsManager.onPurchase(linkedCondition);
                lastObject.newObjectBought(toggle);
                if (index == -1)
                {
                    index = barsModifier.addToModifiers(new Modifier(modifierDescription, moneyModifierSlider.value, ecoModifierSlider.value, comfortModifierSlider.value));
                }
                else
                {
                    Debug.LogError("an object was already added");
                }
            }
            else
            {
                toggle.onValueChanged.SetPersistentListenerState(0, UnityEventCallState.Off);
                toggle.isOn = false;
                toggle.onValueChanged.SetPersistentListenerState(0, UnityEventCallState.RuntimeOnly);

                if (lastObject.getLastBoughtObject() != null)
                {
                    lastObject.getLastBoughtObject().onValueChanged.SetPersistentListenerState(0, UnityEventCallState.Off);
                    lastObject.getLastBoughtObject().isOn = true;
                    lastObject.getLastBoughtObject().onValueChanged.SetPersistentListenerState(0, UnityEventCallState.RuntimeOnly);
                }
            }
        }
        else
        {
            if (index == -1 || !barsModifier.removeFromModifiers(index))
            {
            }
            index = -1;
        }
    }
 public void bathroomUsageEnd()
 {
     activated = false;
     barModifier.removeFromModifiers(bathroomUsageModifierID);
     bathroomUsageModifierID = 0;
 }
Beispiel #4
0
 public void workEnd()
 {
     activated = false;
     barModifier.removeFromModifiers(workModifierID);
     workModifierID = 0;
 }
 public void kitchenUsageEnd()
 {
     activated = false;
     barModifier.removeFromModifiers(kitchenUsageModifierID);
     kitchenUsageModifierID = 0;
 }