Пример #1
0
 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 ;/ ");
     }
 }
Пример #2
0
    // 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());
        }
    }
Пример #3
0
    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");
        }
    }