Пример #1
0
		public ElevatorTraverser(RoomLink link, Elevator elevator, LinearMapping mapping, RoomNetwork roomnet) {
			this.link = link;
			this.elevator = elevator;
			elevatorCenter = elevator.movingRoot.Find("Center");
			elevatorMapping = mapping;
			this.roomnet = roomnet;
		}
Пример #2
0
 public RoomTraverser(Room room, RoomNetwork roomnet)
 {
     this.room = room;
     nav       = new RoomNav(room);
     nav.BuildGraph();
     this.roomnet = roomnet;
 }
Пример #3
0
 private void Awake()
 {
     roomnet   = GetComponentInParent <RoomNetwork>();
     traverser = new RoomTraverser(this, roomnet);
     grid      = GetComponent <SnapGrid>();
     togglable = transform.Find("Togglable")?.gameObject;
     togglable?.SetActive(false);
     insideTransf    = transform.Find("Inside");
     insideColliders = insideTransf.GetComponentsInChildren <Collider>();
     foreach (Collider collider in insideColliders)               // Make sure every "inside collider" is trigger
     {
         collider.isTrigger = true;
     }
 }
Пример #4
0
        public void BuildLightNode()
        {
            RoomNetwork roomnet = SettingsManager.I.activeRoomnet;

            // Create Node
            if (isFallback)
            {
                lightNode = Instantiate(roomnet.fallbackNodePrefab, transform).GetComponent <LightNode>();
            }
            else
            {
                lightNode = Instantiate(roomnet.normalNodePrefab, transform).GetComponent <LightNode>();
            }
            lightNode.gameObject.name    = "Node-" + gameObject.name;
            lightNode.transform.position = center;
            lightNode.activated          = true;
        }
Пример #5
0
        private void Awake()
        {
            roomnet     = GetComponentInParent <RoomNetwork>();
            link        = GetComponent <RoomLink>();
            levelLoader = GetComponent <SteamVR_LoadLevel>();
            Vector3 entry1Pos = roomnet.WorldToRelativePos(transform.Find("Entry1").position);
            Vector3 entry2Pos = roomnet.WorldToRelativePos(transform.Find("Entry2").position);

            if (Vector3.Distance(entry1Pos, roomnet.WorldToRelativePos(link.room1.center)) < Vector3.Distance(entry2Pos, roomnet.WorldToRelativePos(link.room1.center)))
            {
                link.entry1 = entry1Pos;
                link.entry2 = entry2Pos;
            }
            else
            {
                link.entry1   = entry2Pos;
                link.entry2   = entry1Pos;
                link.reversed = true;
            }
            link.isOpen = true;
        }
Пример #6
0
        private void Awake()
        {
            roomnet       = GetComponentInParent <RoomNetwork>();
            link          = GetComponent <RoomLink>();
            linearMapping = GetComponent <LinearMapping>();
            entry1        = transform.Find("Entry1");
            entry2        = transform.Find("Entry2");
            Vector3 entry1Pos = roomnet.WorldToRelativePos(entry1.position);
            Vector3 entry2Pos = roomnet.WorldToRelativePos(entry2.position);

            if (Vector3.Distance(entry1Pos, roomnet.WorldToRelativePos(link.room1.center)) < Vector3.Distance(entry2Pos, roomnet.WorldToRelativePos(link.room1.center)))
            {
                link.entry1 = entry1Pos;
                link.entry2 = entry2Pos;
            }
            else
            {
                link.entry1   = entry2Pos;
                link.entry2   = entry1Pos;
                link.reversed = true;
            }
            link.isOpen = true;             // Elevator Link Always open
        }
Пример #7
0
        private void Awake()
        {
            roomnet      = GetComponentInParent <RoomNetwork>();
            link         = GetComponentInParent <RoomLink>();
            entry1       = transform.Find("Entry1");
            entry2       = transform.Find("Entry2");
            centerTransf = transform.Find("Center");
            Vector3 entry1Pos = roomnet.WorldToRelativePos(entry1.position);
            Vector3 entry2Pos = roomnet.WorldToRelativePos(entry2.position);

            if (Vector3.Distance(entry1Pos, roomnet.WorldToRelativePos(link.room1.center)) < Vector3.Distance(entry2Pos, roomnet.WorldToRelativePos(link.room1.center)))
            {
                link.entry1 = entry1Pos;
                link.entry2 = entry2Pos;
            }
            else
            {
                link.entry1   = entry2Pos;
                link.entry2   = entry1Pos;
                link.reversed = true;
            }

            outlined = GetComponent <Outlined>();
        }
Пример #8
0
 private void Awake()
 {
     roomnet     = GetComponent <RoomNetwork>();
     levelLoader = GetComponent <SteamVR_LoadLevel>();
 }
Пример #9
0
 public DefaultLinkTraverser(RoomLink link, RoomNetwork roomnet)
 {
     this.link    = link;
     this.roomnet = roomnet;
 }
Пример #10
0
		public RoomNav(Room room) {
			this.room = room;
			roomnet = room.GetComponentInParent<RoomNetwork>();
			navRoot = room.transform.Find("Nav");
		}
Пример #11
0
 public DoorTraverser(RoomLink link, RoomNetwork roomnet, SnapPoint parentPoint) : base(link, roomnet)
 {
     this.parentPoint = parentPoint;
 }
Пример #12
0
 private void Start()
 {
     roomnet = FindObjectOfType <RoomNetwork>();
 }