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