void OnEvent(GameEvent ev) { switch (ev.Type()) { case GameEventType.EVENT_PLAYER_SPAWNED: EventPlayerSpawned spawn = (EventPlayerSpawned)ev; target_group.AddTarget(spawn.player.transform, player_radius); break; case GameEventType.EVENT_PLAYER_DESPAWNED: EventPlayerDeSpawned despawn = (EventPlayerDeSpawned)ev; target_group.RemoveTarget(despawn.player.transform); break; default: Debug.LogError("CameraManager: Invalid call to OnEvent"); break; } }
// Start is called before the first frame update void Start() { group.AddTarget(this.transform, 1); }