protected override void OnDisable()
{
// Inform our spawn source that we died. TODO: This is a slow operation; we really should cache
// the list of spawn sources.
if (sourceEnemySpawnID.HasValue)
{
SpawnPoint[] spawns = (SpawnPoint[])Object.FindObjectsOfType(typeof(SpawnPoint));
foreach (SpawnPoint s in spawns)
{
if (s.SpawnID == sourceEnemySpawnID.Value)
{
// Inform ourselves that the spawned enemy has died.
s.RPCSpawnedEnemyDied(networkView);
}
}
}
base.OnDisable();
}