Пример #1
0
        public HoloNetObject Spawn(GameObject go, Vector3 position, Quaternion rotation)
        {
            if (go == null)
            {
                throw new HoloNetObjectSpawnException("[HOLONET] - Prefab to spawn is null");
            }
            var prefabIndex = GetPrefabIndex(go);
            var oid         = AllocateObjectId();

            HoloNetAppModule.instance.messenger.SendMessage(
                NetObjectSpawnAtPositionMessage.Create(oid, prefabIndex, position, rotation), DestinationGroup.Others,
                true);
            return(SpawnObjectLocal(oid, prefabIndex, HoloNetAppModule.instance.players.Local.actorId, position,
                                    rotation));
        }
Пример #2
0
 private void OnSpawnNetObjectAtPosition(NetObjectSpawnAtPositionMessage msg)
 {
     SpawnObjectLocal(msg.oid, msg.prefabId, msg.creatorId, msg.position, msg.rotation);
 }