void Awake() { instance = this; if (spawnRate.Length != obstacles.Length) { MainDebug.WriteLine("SpawnManager warning - size of obstacles table differs with size of spawnRate table. Nulls will happen ;/ "); } }
// called every time Unity receives a message public void MessageHandler(OscMessage message) { string msgString = Osc.OscMessageToString(message); MainDebug.WriteLine(msgString); // writing out the message to see if everything works correctly for (int i = 0; i < OSCcount; i++) { OSCvalues[i] = float.Parse(message.Values[i].ToString()); } }
public void TakeDamage(float damage) { stress += damage; UIManager.Instance.SetStress(stress); // game over if (stress >= maxStress) { stress = 100; if (!isBabyDelivered) { ShootBaby(); isBabyDelivered = true; MainDebug.WriteLine("GAME OVER", 5f); } } // animation switch if (stress > maxStress / 2) { ladyAnimator.SetTrigger("HighStress"); } }