private void _SendOnSpawn(int localID, VRC.Player instigator) { ObjectInstantiator.ObjectInfo objectInfo = null; if (this.spawnedObjects.TryGetValue(localID, out objectInfo) && objectInfo.gameObject != null) { if (VRC.Network.GetOwner(objectInfo.gameObject) != instigator) { return; } VRC.Network.SendMessageToChildren(objectInfo.gameObject, "OnSpawn", SendMessageOptions.DontRequireReceiver, null); } }
private void _DestroyObject(int localID) { if (!this.spawnedObjects.ContainsKey(localID)) { return; } this.RemoveEvents(new int[] { localID }); ObjectInstantiator.ObjectInfo objectInfo = this.spawnedObjects[localID]; this.spawnedObjects.Remove(localID); if (objectInfo.gameObject != null) { UnityEngine.Object.Destroy(objectInfo.gameObject); } }