Compare commits
9 Commits
28c5f3ac1a
...
v0.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 8062242c1a | |||
| 157a4d38b1 | |||
| ceb4b81b36 | |||
| 82ff05fb30 | |||
| 5a6414b2dd | |||
| dceaea78c6 | |||
| d05e0b8710 | |||
| 9b83721f17 | |||
| 247300c09c |
40
.github/workflows/release.yaml
vendored
40
.github/workflows/release.yaml
vendored
@@ -65,14 +65,16 @@ jobs:
|
|||||||
# Use the .NET SDK from global.json in the root of the repository.
|
# Use the .NET SDK from global.json in the root of the repository.
|
||||||
global-json-file: global.json
|
global-json-file: global.json
|
||||||
# Write version to file so .NET will build correct version.
|
# Write version to file so .NET will build correct version.
|
||||||
|
# - name: Write Version to File
|
||||||
|
# uses: jacobtomlinson/gha-find-replace@v3
|
||||||
|
# with:
|
||||||
|
# find: "0.0.0-devbuild"
|
||||||
|
# replace: ${{ steps.next-version.outputs.version }}
|
||||||
|
# regex: false
|
||||||
|
# include: GodotHelper/GodotHelper.csproj
|
||||||
- name: Write Version to File
|
- name: Write Version to File
|
||||||
uses: jacobtomlinson/gha-find-replace@v3
|
run: |
|
||||||
with:
|
sed -i 's/0.0.0-devbuild/${{ steps.next-version.outputs.version }}/g' GodotHelper/GodotHelper.csproj
|
||||||
find: "0.0.0-devbuild"
|
|
||||||
replace: ${{ steps.next-version.outputs.version }}
|
|
||||||
regex: false
|
|
||||||
include: GodotHelper/GodotHelper.csproj
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: GodotHelper
|
working-directory: GodotHelper
|
||||||
run: dotnet build -c Release
|
run: dotnet build -c Release
|
||||||
@@ -85,25 +87,25 @@ jobs:
|
|||||||
echo "Found package: $package"
|
echo "Found package: $package"
|
||||||
echo "${{ steps.package-path.outputs.package }}"
|
echo "${{ steps.package-path.outputs.package }}"
|
||||||
|
|
||||||
- name: Create Release
|
# - name: Create Release
|
||||||
run: |
|
# run: |
|
||||||
version="${{ steps.next-version.outputs.version }}"
|
# version="${{ steps.next-version.outputs.version }}"
|
||||||
|
|
||||||
curl -X POST "http://192.168.1.4:3000/api/packages/Ronnie/GodotHelpers/releases" \
|
# curl -X POST "http://192.168.1.4:3000/api/packages/Ronnie/GodotHelpers/releases" \
|
||||||
-H "Authorization: token ${{ secrets.GH_BASIC }}" \
|
# -H "Authorization: token ${{ secrets.GH_BASIC }}" \
|
||||||
-H "Content-Type: application/json" \
|
# -H "Content-Type: application/json" \
|
||||||
-d "{
|
# -d "{
|
||||||
\"tag_name\": \"$version\",
|
# \"tag_name\": \"$version\",
|
||||||
\"name\": \"v$version\",
|
# \"name\": \"v$version\",
|
||||||
\"body\": \"Auto release $version\"
|
# \"body\": \"Auto release $version\"
|
||||||
}"
|
# }"
|
||||||
- name: Publish to Nuget
|
- name: Publish to Nuget
|
||||||
run: |
|
run: |
|
||||||
dotnet nuget push "${{ steps.package-path.outputs.package }}" \
|
dotnet nuget push "${{ steps.package-path.outputs.package }}" \
|
||||||
--source "http://192.168.1.4:3000/api/packages/Ronnie/nuget/index.json" \
|
--source "http://192.168.1.4:3000/api/packages/Ronnie/nuget/index.json" \
|
||||||
--allow-insecure-connections \
|
--allow-insecure-connections \
|
||||||
--api-key "${{ secrets.NUGET_KEY }}" \
|
--api-key "${{ secrets.NUGET_KEY }}" \
|
||||||
--skip-duplicate
|
# --skip-duplicate
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="GodotSharp" Version="4.6.2" />
|
<PackageReference Include="GodotSharp" Version="4.6.2" />
|
||||||
<PackageReference Include="SjkScripts" Version="1.0.15" />
|
<PackageReference Include="SjkScripts" Version="1.0.17" />
|
||||||
|
<!-- [1.2.3,2.3.4] use range of versions -->
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ public static partial class SJKMath
|
|||||||
// Mathf.Lerp(from.Y, to.Y, weight),
|
// Mathf.Lerp(from.Y, to.Y, weight),
|
||||||
// Mathf.Lerp(from.Z, to.Z, weight)
|
// Mathf.Lerp(from.Z, to.Z, weight)
|
||||||
// );
|
// );
|
||||||
public static Vector3 Lerp(Vector3 from, Vector3 to, float weight) => new Vector3(
|
public static Vector3 Lerp(this Vector3 from, Vector3 to, float weight) => new Vector3(
|
||||||
Mathf.Lerp(from.X, to.X, weight),
|
Mathf.Lerp(from.X, to.X, weight),
|
||||||
Mathf.Lerp(from.Y, to.Y, weight),
|
Mathf.Lerp(from.Y, to.Y, weight),
|
||||||
Mathf.Lerp(from.Z, to.Z, weight)
|
Mathf.Lerp(from.Z, to.Z, weight)
|
||||||
@@ -17,7 +17,7 @@ public static partial class SJKMath
|
|||||||
// Mathf.Lerp(from.X, to.X, weight),
|
// Mathf.Lerp(from.X, to.X, weight),
|
||||||
// Mathf.Lerp(from.Y, to.Y, weight)
|
// Mathf.Lerp(from.Y, to.Y, weight)
|
||||||
// );
|
// );
|
||||||
public static Vector2 Lerp(Vector2 from, Vector2 to, float weight) => new Vector2(
|
public static Vector2 Lerp(this Vector2 from, Vector2 to, float weight) => new Vector2(
|
||||||
Mathf.Lerp(from.X, to.X, weight),
|
Mathf.Lerp(from.X, to.X, weight),
|
||||||
Mathf.Lerp(from.Y, to.Y, weight)
|
Mathf.Lerp(from.Y, to.Y, weight)
|
||||||
);
|
);
|
||||||
|
|||||||
33
GodotHelper/src/Math/RoundVectors.cs
Normal file
33
GodotHelper/src/Math/RoundVectors.cs
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
namespace GodotHelpers;
|
||||||
|
|
||||||
|
using Godot;
|
||||||
|
public static partial class SJKMath
|
||||||
|
{
|
||||||
|
public static Vector3I RoundToIntVector(this Vector3 vector) => new Vector3I(
|
||||||
|
Mathf.RoundToInt(vector.X),
|
||||||
|
Mathf.RoundToInt(vector.Y),
|
||||||
|
Mathf.RoundToInt(vector.Z)
|
||||||
|
);
|
||||||
|
public static Vector3I FloorToIntVector(this Vector3 vector) => new Vector3I(
|
||||||
|
Mathf.FloorToInt(vector.X),
|
||||||
|
Mathf.FloorToInt(vector.Y),
|
||||||
|
Mathf.FloorToInt(vector.Z)
|
||||||
|
);
|
||||||
|
public static Vector3I CeilToIntVector(this Vector3 vector) => new Vector3I(
|
||||||
|
Mathf.CeilToInt(vector.X),
|
||||||
|
Mathf.CeilToInt(vector.Y),
|
||||||
|
Mathf.CeilToInt(vector.Z)
|
||||||
|
);
|
||||||
|
public static Vector2I RoundToIntVector(this Vector2 vector) => new Vector2I(
|
||||||
|
Mathf.RoundToInt(vector.X),
|
||||||
|
Mathf.RoundToInt(vector.Y)
|
||||||
|
);
|
||||||
|
public static Vector2I FloorToIntVector(this Vector2 vector) => new Vector2I(
|
||||||
|
Mathf.FloorToInt(vector.X),
|
||||||
|
Mathf.FloorToInt(vector.Y)
|
||||||
|
);
|
||||||
|
public static Vector2I CeilToIntVector(this Vector2 vector) => new Vector2I(
|
||||||
|
Mathf.CeilToInt(vector.X),
|
||||||
|
Mathf.CeilToInt(vector.Y)
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -11,10 +11,10 @@ public static class MyNodeExtensions
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if given Property exists on <c>Base</c>
|
/// Checks if given Property exists on <c>Base</c>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Base">Current <c>GodotObject</c></param>
|
/// <param name="base">Current <c>GodotObject</c></param>
|
||||||
/// <param name="PropertyName">Property Name</param>
|
/// <param name="propertyName">Property Name</param>
|
||||||
/// <returns><c>bool</c> true if given property exists on Base</returns>
|
/// <returns><c>bool</c> true if given property exists on Base</returns>
|
||||||
public static bool HasProperty(this GodotObject Base, string PropertyName)
|
public static bool HasProperty(this GodotObject @base, string propertyName)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
Returns the object's property list as an Godot.Collections.Array of dictionaries.
|
Returns the object's property list as an Godot.Collections.Array of dictionaries.
|
||||||
@@ -26,9 +26,9 @@ public static class MyNodeExtensions
|
|||||||
- hint_string depends on the hint (see PropertyHint);
|
- hint_string depends on the hint (see PropertyHint);
|
||||||
- usage is a combination of PropertyUsageFlags.
|
- usage is a combination of PropertyUsageFlags.
|
||||||
*/
|
*/
|
||||||
foreach (var Property in Base.GetPropertyListEx())
|
foreach (var property in @base.GetPropertyListEx())
|
||||||
{
|
{
|
||||||
if (Property.Name == PropertyName)
|
if (property.Name == propertyName)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ public static class MyNodeExtensions
|
|||||||
public static (Node node, Resource resource, NodePath remaining) GetNodeAndResourceEx(this Node self, NodePath path)
|
public static (Node node, Resource resource, NodePath remaining) GetNodeAndResourceEx(this Node self, NodePath path)
|
||||||
{
|
{
|
||||||
var result = self.GetNodeAndResource(path);
|
var result = self.GetNodeAndResource(path);
|
||||||
return ((Node)result[0], (Resource)result[1], (NodePath)result[2]);
|
return ((Node)(GodotObject)result[0], (Resource)(GodotObject)result[1], (NodePath)result[2]);
|
||||||
}
|
}
|
||||||
public static void QueueFreeChildren(this Node node) => node.GetChildren().ToList().ForEach(item => item.QueueFree());
|
public static void QueueFreeChildren(this Node node) => node.GetChildren().ToList().ForEach(item => item.QueueFree());
|
||||||
public static void QueueFreeChildren(this Node node, Func<Node, bool> predicate) => node.GetChildren().Where(predicate).ToList().ForEach(item => item.QueueFree());
|
public static void QueueFreeChildren(this Node node, Func<Node, bool> predicate) => node.GetChildren().Where(predicate).ToList().ForEach(item => item.QueueFree());
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Godot;
|
|
||||||
|
|
||||||
namespace GodotHelpers.Raycasts;
|
namespace GodotHelpers.Raycasts;
|
||||||
|
|
||||||
|
using Godot;
|
||||||
|
|
||||||
public record ShapeCastResult3D(
|
public record ShapeCastResult3D(
|
||||||
GodotObject Collider,
|
GodotObject Collider,
|
||||||
int ColliderId,
|
int ColliderId,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
namespace SJK.GodotHelpers;
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using Godot;
|
using Godot;
|
||||||
using Godot.Collections;
|
using Godot.Collections;
|
||||||
namespace SJK.GodotHelpers;
|
|
||||||
|
|
||||||
public static class VariantUtils
|
public static class VariantUtils
|
||||||
{
|
{
|
||||||
@@ -73,6 +73,18 @@ public static class VariantUtils
|
|||||||
Variant.Type.Signal => typeof(Signal),
|
Variant.Type.Signal => typeof(Signal),
|
||||||
Variant.Type.Dictionary => typeof(Dictionary),
|
Variant.Type.Dictionary => typeof(Dictionary),
|
||||||
Variant.Type.Array => typeof(Godot.Collections.Array),
|
Variant.Type.Array => typeof(Godot.Collections.Array),
|
||||||
|
Variant.Type.Projection => throw new NotImplementedException(),
|
||||||
|
Variant.Type.PackedByteArray => throw new NotImplementedException(),
|
||||||
|
Variant.Type.PackedInt32Array => throw new NotImplementedException(),
|
||||||
|
Variant.Type.PackedInt64Array => throw new NotImplementedException(),
|
||||||
|
Variant.Type.PackedFloat32Array => throw new NotImplementedException(),
|
||||||
|
Variant.Type.PackedFloat64Array => throw new NotImplementedException(),
|
||||||
|
Variant.Type.PackedStringArray => throw new NotImplementedException(),
|
||||||
|
Variant.Type.PackedVector2Array => throw new NotImplementedException(),
|
||||||
|
Variant.Type.PackedVector3Array => throw new NotImplementedException(),
|
||||||
|
Variant.Type.PackedColorArray => throw new NotImplementedException(),
|
||||||
|
Variant.Type.PackedVector4Array => throw new NotImplementedException(),
|
||||||
|
Variant.Type.Max => throw new NotImplementedException(),
|
||||||
_ => typeof(object)
|
_ => typeof(object)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
],
|
],
|
||||||
"ignorePaths": [
|
"ignorePaths": [
|
||||||
"**/*.tscn",
|
"**/*.tscn",
|
||||||
|
"**/*.uid",
|
||||||
"**/*.import",
|
"**/*.import",
|
||||||
"**/badges/**/*.*",
|
"**/badges/**/*.*",
|
||||||
"**/coverage/**/*.*",
|
"**/coverage/**/*.*",
|
||||||
|
|||||||
Reference in New Issue
Block a user