private void CreatePortalChains()
        {
            for (int i = 0; i < chainElements.Count; i++)
            {
                var element      = chainElements[i];
                var portalEntity = CreateAdditionalEntity(element.RoomAuthoring);

                RoomPortalAuthoringHelper.CreatePortal(portalEntity, element.RoomA, element.RoomB, DstEntityManager);

                DstEntityManager.AddComponentData(portalEntity, new RoomPortalChain
                {
                    PortalEntityA = element.PortalA,
                    PortalEntityB = element.PortalB,
                });
            }
        }
Esempio n. 2
0
        public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
        {
            if (!GetIsFullyAssigned())
            {
                Debug.LogError($"Rooms in portal {gameObject.name} are not correctly assigned", gameObject);
                return;
            }

            var roomEntityA = conversionSystem.GetPrimaryEntity(roomAuthoringA);
            var roomEntityB = conversionSystem.GetPrimaryEntity(roomAuthoringB);

            RoomPortalAuthoringHelper.CreatePortal(entity, roomEntityA, roomEntityB, dstManager, isLimited);

            dstManager.AddComponentData(entity, new RoomPortalId
            {
                Value = HashHelper.GetHash(GetPortalName()),
            });
        }