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;
		}
Exemple #2
0
 public RoomTraverser(Room room, RoomNetwork roomnet)
 {
     this.room = room;
     nav       = new RoomNav(room);
     nav.BuildGraph();
     this.roomnet = roomnet;
 }
Exemple #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;
     }
 }
Exemple #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;
        }
Exemple #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;
        }
Exemple #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
        }
Exemple #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>();
        }
Exemple #8
0
 private void Awake()
 {
     roomnet     = GetComponent <RoomNetwork>();
     levelLoader = GetComponent <SteamVR_LoadLevel>();
 }
 public DefaultLinkTraverser(RoomLink link, RoomNetwork roomnet)
 {
     this.link    = link;
     this.roomnet = roomnet;
 }
Exemple #10
0
		public RoomNav(Room room) {
			this.room = room;
			roomnet = room.GetComponentInParent<RoomNetwork>();
			navRoot = room.transform.Find("Nav");
		}
Exemple #11
0
 public DoorTraverser(RoomLink link, RoomNetwork roomnet, SnapPoint parentPoint) : base(link, roomnet)
 {
     this.parentPoint = parentPoint;
 }
Exemple #12
0
 private void Start()
 {
     roomnet = FindObjectOfType <RoomNetwork>();
 }