fixed elements not simulating

updated to godot 4.3
This commit is contained in:
2024-12-18 20:48:01 +01:00
parent 383e1343ef
commit 8ebaa9e987
5 changed files with 3 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
<Project Sdk="Godot.NET.Sdk/4.2.2"> <Project Sdk="Godot.NET.Sdk/4.3.0">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading> <EnableDynamicLoading>true</EnableDynamicLoading>

View File

@@ -1,6 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using FOU.Scripts.Elements; using FOU.Scripts.Elements;
using Godot; using Godot;
@@ -79,9 +78,6 @@ public class Chunk {
} }
public void SetElementActive(Element e, bool active) { public void SetElementActive(Element e, bool active) {
if (e.Active == active) return;
GD.Print($"setting {e} to {active}");
if (active && e.GetType() != typeof(Element)) if (active && e.GetType() != typeof(Element))
activeElements.Add(e); activeElements.Add(e);
else else

View File

@@ -61,7 +61,7 @@ public class Element {
} }
public override string ToString() { public override string ToString() {
return $"{GetType()} {Position}[{Chunk.Index}]"; return $"{GetType()} {Position}[{Chunk.Index}] {active}";
} }
protected virtual void Tick() { protected virtual void Tick() {

View File

@@ -1,4 +1,3 @@
using System.Reflection;
using FOU.Scripts; using FOU.Scripts;
using FOU.Scripts.Elements; using FOU.Scripts.Elements;
using Godot; using Godot;

View File

@@ -12,7 +12,7 @@ config_version=5
config/name="FOU" config/name="FOU"
run/main_scene="res://Scenes/main.tscn" run/main_scene="res://Scenes/main.tscn"
config/features=PackedStringArray("4.2", "C#", "Forward Plus") config/features=PackedStringArray("4.3", "C#", "Forward Plus")
config/icon="res://icon.svg" config/icon="res://icon.svg"
[dotnet] [dotnet]