-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More sounds, more seamless hand popup when mouse hovers
- Loading branch information
Showing
15 changed files
with
361 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
@tool | ||
extends EditorNode3DGizmoPlugin | ||
|
||
var node_references = {} | ||
|
||
func get_name(): | ||
return "ColliderGizmos" | ||
|
||
# Create the gizmo visuals | ||
func _create_gizmo(node): | ||
print_debug("gizmo created!") | ||
var gizmo = EditorNode3DGizmo.new() | ||
node_references[gizmo] = node as CollisionShape3D | ||
return gizmo | ||
|
||
# Define when to apply the gizmo | ||
func _has_gizmo(spatial): | ||
var yup = spatial is CollisionShape3D | ||
if yup: | ||
print_debug("yes has gizmo") | ||
return yup | ||
|
||
func _free_gizmo(spatial): | ||
if spatial in node_references: | ||
node_references.erase(spatial) | ||
|
||
func _redraw(gizmo): | ||
if gizmo not in node_references: | ||
return | ||
print_debug("redraw") | ||
var node = node_references.get(gizmo) | ||
if not node or node.shape is not BoxShape3D: | ||
return | ||
|
||
print_debug("got here") | ||
var mesh = BoxMesh.new() | ||
mesh.size = (node.shape as BoxShape3D).size | ||
gizmo.add_mesh(mesh, Transform3D.IDENTITY, get_material("handles")) | ||
|
||
return gizmo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[plugin] | ||
|
||
name="ColliderHelper" | ||
description="A custom plugin for Godot." | ||
author="GrahamDarcey" | ||
version="1.0" | ||
script="plugin.gd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@tool | ||
extends EditorPlugin | ||
|
||
var gizmo_plugin: EditorNode3DGizmoPlugin | ||
|
||
func _enter_tree(): | ||
# Load and instantiate the gizmo plugin | ||
gizmo_plugin = preload("res://addons/collider_helper/collidergizmos.gd").new() | ||
add_node_3d_gizmo_plugin(gizmo_plugin) | ||
print("Custom Gizmo Plugin added to editor.") | ||
|
||
func _exit_tree(): | ||
# Remove the gizmo plugin when the editor plugin is disabled | ||
if gizmo_plugin: | ||
remove_node_3d_gizmo_plugin(gizmo_plugin) | ||
gizmo_plugin = null | ||
print("Custom Gizmo Plugin removed from editor.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.