private void ServerCleanInstantiateAndDestroy(int instantiateId, int creatorId, bool isRuntimeInstantiated)
{
Hashtable removeFilter = new Hashtable();
removeFilter[(byte)7] = instantiateId;
RaiseEventOptions options = new RaiseEventOptions() { CachingOption = EventCaching.RemoveFromRoomCache, TargetActors = new int[] { creatorId } };
this.OpRaiseEvent(PunEvent.Instantiation, removeFilter, true, options);
//this.OpRaiseEvent(PunEvent.Instantiation, removeFilter, true, 0, new int[] { actorNr }, EventCaching.RemoveFromRoomCache);
Hashtable evData = new Hashtable();
evData[(byte)0] = instantiateId;
options = null;
if (!isRuntimeInstantiated)
{
// if the view got loaded with the scene, the EvDestroy must be cached (there is no Instantiate-msg which we can remove)
// reason: joining players will load the obj and have to destroy it (too)
options = new RaiseEventOptions();
options.CachingOption = EventCaching.AddToRoomCacheGlobal;
Debug.Log("Destroying GO as global. ID: " + instantiateId);
}
this.OpRaiseEvent(PunEvent.Destroy, evData, true, options);
}