Example #1
0
 void ChangeText(float value, float valueChange, SimStatType type)
 {
     if (type == SimStatType.Ranking)
     {
         GetComponent<TextMeshProUGUI>().text = "Piilotetut rankingpisteet: " + value.ToString();
     }
 }
 public void BarStatChange(float value, float valueChange, SimStatType type)
 {
     if (type == simStatType)
     {
         FloatNumberHelper.createFloatingNumbers(incText, valueChange, transform, randomizedOffSetEffect, incTextOffset);
         startIncrementing(value);
     }
 }
    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;
        }
    }
Example #4
0
 public void SetStat(SimStatType type, float value)
 {
     m_stats.Stat[(int)type].StatValue = value;
 }
Example #5
0
    public Stat getStatByEnum(SimStatType simStatType)
    {
        var stat = allStats.SingleOrDefault(givenStat => givenStat.SimStatType == simStatType);

        return(stat);
    }