summaryrefslogtreecommitdiff
path: root/Scripts/GodotExtensions
diff options
context:
space:
mode:
authorSophia Pearson <codergal89@gmail.com>2022-10-03 22:22:50 +0200
committerSophia Pearson <codergal89@gmail.com>2022-10-04 22:18:18 +0200
commite127ad39e742396030352240d829bc903b1d4464 (patch)
tree10cc21d70bf13181aef7c8ad0344077ff63579a3 /Scripts/GodotExtensions
parentddbb045f6387a8ba23b1210b27a745516a387a52 (diff)
downloadtexty-e127ad39e742396030352240d829bc903b1d4464.tar.xz
texty-e127ad39e742396030352240d829bc903b1d4464.zip
godot: inital Godot 4 migration
Diffstat (limited to 'Scripts/GodotExtensions')
-rw-r--r--Scripts/GodotExtensions/ArrayExtensions.cs3
-rw-r--r--Scripts/GodotExtensions/NodeExtensions.cs2
2 files changed, 3 insertions, 2 deletions
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<T>(this Array<T> array, Action<T> action)
+ public static void ForEach<[MustBeVariant] T>(this Array<T> array, Action<T> 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<T> GetChildren<T>(this Node node)
+ public static Array<T> GetChildren<[MustBeVariant] T>(this Node node)
{
return new Array<T>(node.GetChildren().OfType<T>());
}