void incrementHunger(EventInfo info)
    {
        SimStatInfo simStatInfo = (SimStatInfo)info;

        if (simStatInfo.SimStatName == SimStatType.Hunger)
        {
            PlayerDataHolder.Current.Hunger.ChangeStat(simStatInfo.StatChange);
            checkStarving();
        }
    }
示例#2
0
    static void comfortChange(float change)
    {
        SimStatInfo SimChangeAction = new SimStatInfo();

        SimChangeAction.SimStatName = SimStatType.Comfortableness;
        SimChangeAction.StatChange  = change;


        GameEventSystem.DoEvent(
            Event_Type.SIMSTAT_CHANGE,
            SimChangeAction
            );
    }
    public override void PerformAction()
    {
        SimStatInfo SimChangeAction = new SimStatInfo();

        SimChangeAction.SimStatName = simStatType;
        SimChangeAction.StatChange  = StatChangeAmount;
        thisEvent_Type = Event_Type.SIMSTAT_CHANGE;

        GameEventSystem.DoEvent(
            thisEvent_Type,
            SimChangeAction
            );
    }
    public void PerformAction()  //Super ugly mutta en osaa unity editorscriptingiä enkä näin pienen asian vuoksi ala opettelemaan.
    {
        switch (eventClass)
        {
        case eventClassName.FloatChange:
            FloatChangeInfo floatChangeInfo = new FloatChangeInfo();
            floatChangeInfo.changeofFloat = actionFloat1;
            event_Type = Event_Type.FLOAT_CHANGE;
            PerformActionWithEventInfo(event_Type, floatChangeInfo);

            break;

        case eventClassName.SimStat:
            SimStatType type        = (SimStatType)System.Enum.Parse(typeof(SimStatType), actionString1, false);
            SimStatInfo simStatInfo = new SimStatInfo();
            simStatInfo.SimStatName = type;
            simStatInfo.StatChange  = actionFloat1;
            event_Type = Event_Type.SIMSTAT_CHANGE;
            PerformActionWithEventInfo(event_Type, simStatInfo);
            break;

        case eventClassName.FlagFire:
            Flag flag = new Flag(actionString1, (int)actionFloat1, actionBool1, (int)actionFloat2);
            flag.FireFlag();

            break;

        case eventClassName.Purchase:
            PurchaseInfo purchaseInfo = new PurchaseInfo();
            purchaseInfo.purchaseCost = actionFloat1;
            purchaseInfo.purchaseName = actionString1;
            //event_Type = Event_Type.
            PerformActionWithEventInfo(event_Type, purchaseInfo);
            break;

        case eventClassName.Billing:
            PurchaseInfo billingInfo = new PurchaseInfo();
            billingInfo.purchaseCost = actionFloat1;
            billingInfo.purchaseName = actionString1;
            if (actionBool1 == true)
            {
                billingInfo.singleuse = true;
            }
            PerformActionWithEventInfo(Event_Type.CREATE_BILLING, billingInfo);
            break;

        default:
            break;
        }
    }