public void DespawnPedestrianApi(PedestrianController ped) { ped.StopPEDCoroutines(); if (SimulatorManager.Instance.Network.IsMaster) { var index = currentPedPool.FindIndex(pedestrian => pedestrian.gameObject == ped.gameObject); BroadcastMessage(new Message(Key, GetDespawnMessage(index), MessageType.ReliableUnordered)); } currentPedPool.Remove(ped); Destroy(ped.gameObject); }
public void DespawnPedestrianApi(PedestrianController ped) { ped.StopPEDCoroutines(); currentPedPool.Remove(ped); Destroy(ped.gameObject); }