Exemplo n.º 1
0
        public static HoloNetObjectIdMessage <T, TO> Create(HoloNetObjectId objectId)
        {
            var obj = HoloNet.GetObjectPool().Pop <T>();

            obj.id = objectId;
            return(obj);
        }
Exemplo n.º 2
0
        public static NetObjectDestroyMessage Create(HoloNetObjectId oid)
        {
            var obj = HoloNetAppModule.instance.objectPool.Pop <NetObjectDestroyMessage>();

            obj.oid = oid;
            return(obj);
        }
Exemplo n.º 3
0
        public static NetObjectSpawnMessage Create(HoloNetObjectId oid, int prefabId)
        {
            var obj = HoloNetAppModule.instance.objectPool.Pop <NetObjectSpawnMessage>();

            obj.prefabId  = prefabId;
            obj.creatorId = HoloNetAppModule.instance.players.Local.actorId;
            obj.oid       = oid;
            return(obj);
        }
        public static NetObjectSpawnAtPositionMessage Create(HoloNetObjectId oid, int prefabId, Vector3 position,
                                                             Quaternion rotation)
        {
            var obj = HoloNetAppModule.instance.objectPool.Pop <NetObjectSpawnAtPositionMessage>();

            obj.prefabId  = prefabId;
            obj.oid       = oid;
            obj.position  = position;
            obj.rotation  = rotation;
            obj.creatorId = HoloNetAppModule.instance.players.Local.actorId;
            return(obj);
        }
Exemplo n.º 5
0
        public static T GetObject <T>(HoloNetObjectId id) where T : MonoBehaviour
        {
            var hno = GetObject(id);

            return(hno == null ? null : hno.GetComponentInChildren <T>());
        }
Exemplo n.º 6
0
 public static HoloNetObject GetObject(HoloNetObjectId id)
 {
     return(HoloNetAppModule.instance.objectsManager.GetObject(id));
 }