mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
No CoreCLR... for now
This commit is contained in:
@@ -15,32 +15,39 @@ public class Camera : Entity
|
||||
|
||||
public float DontFollowRadius = 3.0f;
|
||||
|
||||
void OnUpdate(float deltaTime)
|
||||
void OnCreate()
|
||||
{
|
||||
Entity player = FindEntityWithName("Player");
|
||||
Log.Info("Camera Create");
|
||||
}
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
float2 playerPosition = player.Transform.Translation.XY;
|
||||
public void OnUpdate(float deltaTime)
|
||||
{
|
||||
Log.Info($"Camera Update {deltaTime}");
|
||||
|
||||
float2 cameraPosition = Transform.Translation.XY;
|
||||
//Entity player = FindEntityWithName("Player");
|
||||
|
||||
float2 distanceVector = playerPosition - cameraPosition;
|
||||
//if (player != null)
|
||||
//{
|
||||
// float2 playerPosition = player.Transform.Translation.XY;
|
||||
|
||||
float distance = length(distanceVector);
|
||||
// float2 cameraPosition = Transform.Translation.XY;
|
||||
|
||||
float2 neededMovement = float2.Zero;
|
||||
// float2 distanceVector = playerPosition - cameraPosition;
|
||||
|
||||
if (distance > DontFollowRadius)
|
||||
{
|
||||
neededMovement = distanceVector - (distanceVector / distance) * DontFollowRadius;
|
||||
}
|
||||
// float distance = length(distanceVector);
|
||||
|
||||
Transform.Translation = new float3(cameraPosition + neededMovement, DistanceFromPlayer);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Error("Player not found!");
|
||||
}
|
||||
// float2 neededMovement = float2.Zero;
|
||||
|
||||
// if (distance > DontFollowRadius)
|
||||
// {
|
||||
// neededMovement = distanceVector - (distanceVector / distance) * DontFollowRadius;
|
||||
// }
|
||||
|
||||
// Transform.Translation = new float3(cameraPosition + neededMovement, DistanceFromPlayer);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// Log.Error("Player not found!");
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"Start Editor": {
|
||||
"commandName": "Executable",
|
||||
"executablePath": "D:\\Development\\Projects\\Beef\\GlitchyEngine\\build\\Debug_Win64\\GlitchyEditor\\GlitchyEditor.exe",
|
||||
"commandLineArgs": "\"content\\Scenes\\physics2D.scene\"",
|
||||
"workingDirectory": "D:\\Development\\Projects\\Beef\\GlitchyEngine\\GlitchyEditor",
|
||||
"nativeDebugging": true
|
||||
}
|
||||
|
||||
@@ -1,25 +1,15 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETStandard,Version=v2.0/",
|
||||
"name": ".NETCoreApp,Version=v7.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETStandard,Version=v2.0": {},
|
||||
".NETStandard,Version=v2.0/": {
|
||||
".NETCoreApp,Version=v7.0": {
|
||||
"ScriptCore/1.0.0": {
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "2.0.3"
|
||||
},
|
||||
"runtime": {
|
||||
"ScriptCore.dll": {}
|
||||
}
|
||||
},
|
||||
"Microsoft.NETCore.Platforms/1.1.0": {},
|
||||
"NETStandard.Library/2.0.3": {
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -28,20 +18,6 @@
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"Microsoft.NETCore.Platforms/1.1.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==",
|
||||
"path": "microsoft.netcore.platforms/1.1.0",
|
||||
"hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512"
|
||||
},
|
||||
"NETStandard.Library/2.0.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
|
||||
"path": "netstandard.library/2.0.3",
|
||||
"hashPath": "netstandard.library.2.0.3.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"additionalProbingPaths": [
|
||||
"C:\\Users\\Simon\\.dotnet\\store\\|arch|\\|tfm|",
|
||||
"C:\\Users\\Simon\\.nuget\\packages",
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net7.0",
|
||||
"rollForward": "LatestMinor",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "7.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -453,7 +453,8 @@ namespace GlitchyEditor.EditWindows
|
||||
|
||||
StringView search = StringView();
|
||||
|
||||
char8* scriptLabel = scriptComponent.Instance?.ScriptClass.FullName.ToScopeCStr!() ?? "Select Script...";
|
||||
//char8* scriptLabel = scriptComponent.Instance?.ScriptClass.FullName.ToScopeCStr!() ?? "Select Script...";
|
||||
char8* scriptLabel = scriptComponent.Instance?.ScriptClass.FullName.CStr() ?? "Select Script...";
|
||||
|
||||
if (ImGui.Button(scriptLabel))
|
||||
ImGui.OpenPopup("SelectScript");
|
||||
@@ -478,13 +479,15 @@ namespace GlitchyEditor.EditWindows
|
||||
//ScriptEngine.InitializeInstance(entity, scriptComponent);
|
||||
|
||||
scriptComponent.ScriptClassName = scriptClass.FullName;
|
||||
|
||||
ScriptEngine.CreateScriptFieldMap(entity);
|
||||
|
||||
//ScriptEngine.CreateScriptFieldMap(entity);
|
||||
}
|
||||
}
|
||||
ImGui.EndPopup();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
ScriptClass scriptClass = ScriptEngine.GetScriptClass(scriptComponent.ScriptClassName);
|
||||
|
||||
/*T GetFieldValue<T>()
|
||||
@@ -707,6 +710,8 @@ namespace GlitchyEditor.EditWindows
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
private static void LabelColumn(StringView label)
|
||||
|
||||
Reference in New Issue
Block a user