Skip to content

Commit

Permalink
Merge pull request #6411 from hrithikwins/taco-tuesday/changing-rooms…
Browse files Browse the repository at this point in the history
…-portal

Changing Rooms Feature - Behavior Graph
  • Loading branch information
keianhzo authored Jan 9, 2024
2 parents d01d15c + d7b3989 commit 1c8ea08
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,4 @@ Mozilla and Hubs believe that privacy is fundamental to a healthy internet. Read

## License

Hubs is licensed with the [Mozilla Public License 2.0](./LICENSE)

Hubs is licensed with the [Mozilla Public License 2.0](./LICENSE)
22 changes: 22 additions & 0 deletions src/bit-systems/behavior-graph/entity-nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import { definitionListToMap } from "./utils";
import { getComponentBindings } from "./bindings/bindings";
import { camelCase } from "../../inflators/model";
import { takeOwnership } from "../../utils/take-ownership";
import { hubIdFromUrl } from "../../utils/media-url-utils";
import { changeHub } from "../../change-hub";

type SocketTypeName =
| "string"
Expand Down Expand Up @@ -318,6 +320,26 @@ export const EntityNodes = definitionListToMap([
commit("flow");
}
}),
makeFlowNodeDefinition({
typeName: "hubs/misc/changehub",
category: "Components" as any,
label: "Change Hub",
in: {
flow: "flow",
url: "string"
},
out: { flow: "flow" },
initialState: undefined,
triggered: ({ read, commit, graph }) => {
const src: string = read("url");
const url = new URL(src);

const waypoint = url.hash && url.hash.substring(1);
const hubId = hubIdFromUrl(src);
changeHub(hubId, true, waypoint);
commit("flow");
}
}),
makeInNOutFunctionDesc({
name: "hubs/entity/localToWorld/vec3",
label: "Local to World",
Expand Down

0 comments on commit 1c8ea08

Please sign in to comment.