mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2025-12-16 13:30:07 +01:00
Format files using updated file_format.sh
This commit is contained in:
@@ -72,7 +72,7 @@ public class Gizmo25D : Node2D
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Color modulate = lines[dominantAxis].Modulate;
|
||||
modulate.a = 1;
|
||||
lines[dominantAxis].Modulate = modulate;
|
||||
@@ -86,7 +86,7 @@ public class Gizmo25D : Node2D
|
||||
_moving = true;
|
||||
_startPosition = mousePosition;
|
||||
}
|
||||
|
||||
|
||||
if (_moving)
|
||||
{
|
||||
// Change modulate of unselected axes.
|
||||
@@ -153,14 +153,14 @@ public class Gizmo25D : Node2D
|
||||
{
|
||||
return Mathf.Inf;
|
||||
}
|
||||
|
||||
|
||||
Vector2 segmentEnd = lines[index].Points[1];
|
||||
float lengthSquared = segmentEnd.LengthSquared();
|
||||
if (lengthSquared < 400)
|
||||
{
|
||||
return Mathf.Inf;
|
||||
}
|
||||
|
||||
|
||||
var t = Mathf.Clamp(point.Dot(segmentEnd) / lengthSquared, 0, 1);
|
||||
var projection = t * segmentEnd;
|
||||
return point.DistanceTo(projection);
|
||||
|
||||
@@ -36,7 +36,7 @@ func _ready():
|
||||
func _process(delta):
|
||||
if !editor_interface: # Something's not right... bail!
|
||||
return
|
||||
|
||||
|
||||
# View mode polling.
|
||||
var view_mode_changed_this_frame = false
|
||||
var new_view_mode = view_mode_button_group.get_pressed_button().get_index()
|
||||
@@ -44,18 +44,18 @@ func _process(delta):
|
||||
view_mode_index = new_view_mode
|
||||
view_mode_changed_this_frame = true
|
||||
_recursive_change_view_mode(get_tree().edited_scene_root)
|
||||
|
||||
|
||||
# Zooming.
|
||||
if Input.is_mouse_button_pressed(BUTTON_WHEEL_UP):
|
||||
zoom_level += 1
|
||||
elif Input.is_mouse_button_pressed(BUTTON_WHEEL_DOWN):
|
||||
zoom_level -= 1
|
||||
var zoom = _get_zoom_amount()
|
||||
|
||||
|
||||
# Viewport size.
|
||||
var size = get_global_rect().size
|
||||
viewport_2d.size = size
|
||||
|
||||
|
||||
# Viewport transform.
|
||||
var viewport_trans = Transform2D.IDENTITY
|
||||
viewport_trans.x *= zoom
|
||||
@@ -63,7 +63,7 @@ func _process(delta):
|
||||
viewport_trans.origin = viewport_trans.basis_xform(viewport_center) + size / 2
|
||||
viewport_2d.canvas_transform = viewport_trans
|
||||
viewport_overlay.canvas_transform = viewport_trans
|
||||
|
||||
|
||||
# Delete unused gizmos.
|
||||
var selection = editor_interface.get_selection().get_selected_nodes()
|
||||
var overlay_children = viewport_overlay.get_children()
|
||||
@@ -74,7 +74,7 @@ func _process(delta):
|
||||
contains = true
|
||||
if !contains:
|
||||
overlay_child.queue_free()
|
||||
|
||||
|
||||
# Add new gizmos.
|
||||
for selected in selection:
|
||||
if selected.has_method("Node25DReady"):
|
||||
|
||||
@@ -9,13 +9,13 @@ func _enter_tree():
|
||||
main_panel_instance = MainPanel.instance()
|
||||
#main_panel_instance.get_child(1).set("editorInterface", get_editor_interface()) # For C#
|
||||
main_panel_instance.get_child(1).editor_interface = get_editor_interface()
|
||||
|
||||
|
||||
# Add the main panel to the editor's main viewport.
|
||||
get_editor_interface().get_editor_viewport().add_child(main_panel_instance)
|
||||
|
||||
|
||||
# Hide the main panel.
|
||||
make_visible(false)
|
||||
|
||||
|
||||
# When this plugin node enters tree, add the custom types.
|
||||
add_custom_type("Node25D", "Node2D", preload("Node25D.cs"), preload("icons/node_25d_icon.png"))
|
||||
add_custom_type("YSort25D", "Node", preload("YSort25D.cs"), preload("icons/y_sort_25d_icon.png"))
|
||||
@@ -24,7 +24,7 @@ func _enter_tree():
|
||||
|
||||
func _exit_tree():
|
||||
main_panel_instance.queue_free()
|
||||
|
||||
|
||||
# When the plugin node exits the tree, remove the custom types.
|
||||
remove_custom_type("ShadowMath25D")
|
||||
remove_custom_type("YSort25D")
|
||||
|
||||
Reference in New Issue
Block a user