public override void Enter(NewObjectThief objectThief) { UnrestManager.GetInstance().UpdateUnrest(+1); objectThief.DropItem(); objectThief.ToggleMarionetteStrings(false); despawnTime = objectThief.GetDespawnAfterDeathTime(); }
//Made by Petter private IEnumerator UnrestChange() { while (placedObject != null) { yield return(new WaitForSecondsRealtime(timeOnGroundBeforeUnrestIncrease)); UnrestManager.GetInstance().UpdateUnrest(value); } }
private IEnumerator UnrestChange() { onGround = true; while (onGround) { yield return(new WaitForSecondsRealtime(timeOnGroundBeforeUnrestIncrease)); UnrestManager.GetInstance().UpdateUnrest(value); } }
private IEnumerator Spawn(int nrOfEnemies) { EnemySpawnLocation enemySpawnLocation = enemySpawnLocations[RandomManager.GetRandomNumber(0, enemySpawnLocations.Length)]; for (int i = 0; i < nrOfSpawnsPerWave; i++) { enemySpawnLocation.objectPool.Get(enemySpawnLocation.objectPool.transform.position, enemySpawnLocation.objectPool.transform.rotation); } yield return(new WaitForSecondsRealtime(timeBetweenSpawn + (UnrestManager.GetInstance().CurrentUnrest *unrestModifier))); StartCoroutine(Spawn(nrOfEnemies)); }
private void Update() { if (fireHolder.isLit) { secondsThatTheLanternHasBeenLit += Time.deltaTime; if (secondsThatTheLanternHasBeenLit >= secondsLitForUnrestDecrease) { secondsThatTheLanternHasBeenLit = 0f; UnrestManager.GetInstance().UpdateUnrest(-1); } } else { secondsThatTheLanternHasBeenLit = 0f; } }