Esempio n. 1
0
    public static void SetMoney(EventInfo info)
    {
        float floatChange = 0;

        FloatChangeInfo floatChangeInfo = (FloatChangeInfo)info;

        floatChange = floatChangeInfo.changeofFloat;
        OnChangeFetch?.Invoke(floatChangeInfo.changeofFloat);
        PlayerDataHolder.Current.PlayerMoney.MoneyChange(floatChange);
    }
Esempio n. 2
0
    public static void changePlayerMoney(float amount)
    {
        FloatChangeInfo valueChangeAction = new FloatChangeInfo();

        valueChangeAction.changeofFloat = amount;

        Debug.Log("Pelaajalle tapahtui rahamuutos: määrä on " + valueChangeAction.changeofFloat);
        GameEventSystem.DoEvent(
            Event_Type.FLOAT_CHANGE,
            valueChangeAction
            );
    }
    public override void PerformAction()
    {
        FloatChangeInfo valueChangeAction = new FloatChangeInfo();

        valueChangeAction.changeofFloat = amount;
        thisEvent_Type = Event_Type.FLOAT_CHANGE;

        GameEventSystem.DoEvent(
            thisEvent_Type,
            valueChangeAction
            );
    }
    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;
        }
    }