From e127ad39e742396030352240d829bc903b1d4464 Mon Sep 17 00:00:00 2001 From: Sophia Pearson Date: Mon, 3 Oct 2022 22:22:50 +0200 Subject: godot: inital Godot 4 migration --- Scripts/GodotExtensions/ArrayExtensions.cs | 3 ++- Scripts/GodotExtensions/NodeExtensions.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'Scripts/GodotExtensions') diff --git a/Scripts/GodotExtensions/ArrayExtensions.cs b/Scripts/GodotExtensions/ArrayExtensions.cs index aa3a9c4..2712232 100644 --- a/Scripts/GodotExtensions/ArrayExtensions.cs +++ b/Scripts/GodotExtensions/ArrayExtensions.cs @@ -1,11 +1,12 @@ using System; +using Godot; using Godot.Collections; namespace Texty.Scripts.GodotExtensions { public static class ArrayExtensions { - public static void ForEach(this Array array, Action action) + public static void ForEach<[MustBeVariant] T>(this Array array, Action action) { foreach (var element in array) action.Invoke(element); } diff --git a/Scripts/GodotExtensions/NodeExtensions.cs b/Scripts/GodotExtensions/NodeExtensions.cs index b398985..c361496 100644 --- a/Scripts/GodotExtensions/NodeExtensions.cs +++ b/Scripts/GodotExtensions/NodeExtensions.cs @@ -6,7 +6,7 @@ namespace Texty.Scripts.GodotExtensions { public static class NodeExtensions { - public static Array GetChildren(this Node node) + public static Array GetChildren<[MustBeVariant] T>(this Node node) { return new Array(node.GetChildren().OfType()); } -- cgit v1.2.3