Beispiel #1
0
    public void OnTakeDamage(AIController enemy, int id)
    {
        Net_EnemyDamage enemyDamage = new Net_EnemyDamage()
        {
            enemyID   = enemy.myId,
            newHealth = enemy.GetHealth(),
            bulletID  = id
        };

        RemoveBulletFromList(id);
        Send(enemyDamage, clients);
    }
Beispiel #2
0
 private void OnEnemyDamage(Net_EnemyDamage msg)
 {
     enemies[msg.enemyID].enemy.gameObject.GetComponentInChildren <Slider>().value = msg.newHealth;
     RemoveBullet(msg.bulletID);
 }