private int numberBeerHand = 0; // max 6 void Start() { statBarManager = objectStatBarManager.GetComponent <StatBarManager>(); statBarManager.InitializeStatBar(statBarSafety, statSafety); statBarManager.InitializeStatBar(statBarBooze, statBooze); statBarManager.InitializeStatBar(statBarCleanness, statCleanness); statBarManager.InitializeStatBar(statBarDjFokus, statDjFokus); // Automatically starting to decrease statBarManager.PeriodicallyChangeStatBar(statBarDjFokus, 1f, -0.01f); }
void Start() { // Subscriptions interaction = player.GetComponent <Interaction>(); interaction.onVomit += triggeredVomit; interaction.onMop2Vomit += triggeredMop2Vomit; interaction.onCousin2Fight += triggeredCousin2Fight; interaction.onSixPack2Fridge += triggeredSixPack2Fridge; interaction.onBeer2Dj += triggeredBeer2Dj; /*public event Action onVomit; * public event Action onMop2Vomit; * public event Action onFight; * public event Action onCousin2Fight; * public event Action onSixPack2Fridge; * public event Action onBeer2Dj;*/ interaction.onGetMop += triggeredGetMop; interaction.onGetSixPack += triggeredGetSixPack; interaction.onGetDrink += triggeredGetDrink; interaction.onGetCousin += triggeredGetCousin; interaction.onDropMop += triggeredDropMop; interaction.onDropSixPack += triggeredDropSixPack; interaction.onDropDrink += triggeredDropDrink; interaction.onDropCousin += triggeredDropCousin; interaction.onFever += triggeredFever; fightHandler = handlerObject.GetComponent <FightHandler>(); fightHandler.onNewFight += triggeredFight; // handlePeople = handlerObject.GetComponent<HandlePeople>(); // Counters countersObject = transform.Find("Counters").gameObject; counter = countersObject.GetComponent <Counters>(); // Bar manager statBarManagerObject = transform.Find("StatBarManager").gameObject; statBarManager = statBarManagerObject.GetComponent <StatBarManager>(); // Bar objects and statbars safetyBarObject = transform.Find("StatBars/Safety").gameObject; statBarSafety = safetyBarObject.GetComponent <StatBar>(); boozeBarObject = transform.Find("StatBars/Booze").gameObject; statBarBooze = boozeBarObject.GetComponent <StatBar>(); cleannessBarObject = transform.Find("StatBars/Cleanness").gameObject; statBarCleanness = cleannessBarObject.GetComponent <StatBar>(); djFokusBarObject = transform.Find("StatBars/DJFokus").gameObject; statBarDjFokus = djFokusBarObject.GetComponent <StatBar>(); // Initializing bars statBarManager.InitializeStatBar(statBarSafety, statSafety); statBarManager.InitializeStatBar(statBarBooze, statBooze); statBarManager.InitializeStatBar(statBarCleanness, statCleanness); statBarManager.InitializeStatBar(statBarDjFokus, statDjFokus); // Automatically starting to decrease statBarManager.PeriodicallyChangeStatBar(statBarDjFokus, -0.02f); // Dynamic coroutine to reduce booze bar depending of the amount of npcs statBarManager.PeriodicallyChangeStatBarDependingOnPeople(statBarBooze, -0.003f); statBarManager.PeriodicallyChangeStatBarDependingOnFights(statBarSafety, -0.01f); }
// subscription to methods void triggeredVomit() { pukeNumber++; Debug.Log("ALGUIEN HA VOMITADO EN TU FIESTA"); statBarManager.PeriodicallyChangeStatBar(statBarCleanness, -0.01f * pukeNumber); }