dotnet6 compat and 1.4 fixes

This commit is contained in:
2022-08-20 14:24:53 +03:00
parent b2ad9ac57c
commit 411c341278
5 changed files with 25 additions and 13 deletions

View File

@@ -47,9 +47,13 @@ namespace Game
#if FLAX_EDITOR
public class ConsoleEditorPlugin : GEditorPlugin
{
public override PluginDescription Description => ConsolePlugin.DescriptionInternal;
public override Type GamePluginType => typeof(ConsolePlugin);
public ConsoleEditorPlugin()
{
_description = ConsolePlugin.DescriptionInternal;
}
public override void Init()
{
//FlaxEngine.Debug.Log("ConsolePlugin initialized");

View File

@@ -278,7 +278,7 @@ namespace Game
Graphics.PostProcessSettings = postProcessSettings;
Graphics.EnableGlobalSDF = boolValue;
//Graphics.EnableGlobalSDF = boolValue;
}
}
@@ -306,7 +306,7 @@ namespace Game
}
}
[ConsoleVariable("r_gi_spacing")]
/*[ConsoleVariable("r_gi_spacing")]
public static string GlobalIlluminationProbeSpacing
{
get
@@ -322,7 +322,7 @@ namespace Game
Graphics.GIProbesSpacing = valueFloat;
}
}
}
}*/
[ConsoleVariable("r_gi_time")]
public static string GlobalIlluminationTime

View File

@@ -2,6 +2,7 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
@@ -414,7 +415,7 @@ namespace Game
if (worldSpawnActor == null)
{
worldSpawnActor = Actor.AddChild<Actor>();
worldSpawnActor = Actor.AddChild<EmptyActor>();
worldSpawnActor.Name = "WorldSpawn";
worldSpawnActor.HideFlags &= ~HideFlags.DontSave;
//worldSpawnActor.HideFlags |= HideFlags.DontSave;
@@ -663,6 +664,9 @@ namespace Game
for (uint i = 0; i < indices.Length; i++)
indices[i] = i;
if (brushIndex == 84)
brushIndex = brushIndex;
bool isClipMaterial = false;
bool isMissingMaterial = false;
if (geom.meshes.Length == 1)
@@ -724,7 +728,7 @@ namespace Game
brushIndex = 0;
foreach (BrushGeometry geom in brushGeometries)
{
Actor childModel = worldSpawnActor.AddChild<Actor>();
Actor childModel = worldSpawnActor.AddChild<EmptyActor>();
childModel.Name = "Brush_" + brushIndex;
//childModel.Model = geom.model;
childModel.Position = geom.offset;
@@ -1296,7 +1300,7 @@ namespace Game
private void ParsePlayerSpawn(MapEntity entity, ref int playerSpawnIndex)
{
Actor spawn = worldSpawnActor.AddChild<Actor>();
Actor spawn = worldSpawnActor.AddChild<EmptyActor>();
spawn.Name = "PlayerSpawn_" + playerSpawnIndex;
spawn.LocalPosition = ParseOrigin(entity.properties["origin"]);
@@ -1311,26 +1315,26 @@ namespace Game
private static Float3 ParseOrigin(string origin)
{
string[] points = origin.Split(' ');
return new Float3(float.Parse(points[0]), float.Parse(points[2]), float.Parse(points[1]));
return new Float3(float.Parse(points[0], CultureInfo.InvariantCulture), float.Parse(points[2], CultureInfo.InvariantCulture), float.Parse(points[1], CultureInfo.InvariantCulture));
}
private static Color ParseColor(string origin)
{
string[] points = origin.Split(' ');
return new Color(float.Parse(points[0]), float.Parse(points[1]), float.Parse(points[2]));
return new Color(float.Parse(points[0], CultureInfo.InvariantCulture), float.Parse(points[1], CultureInfo.InvariantCulture), float.Parse(points[2], CultureInfo.InvariantCulture));
}
private static Quaternion ParseAngle(string origin)
{
string[] angles = origin.Split(' ');
//Console.Print("parseangle: " + new Float3(0f, float.Parse(angles[0]) + 45f, 0f).ToString());
return Quaternion.Euler(new Float3(0f, float.Parse(angles[0]) + 90f, 0f));
return Quaternion.Euler(new Float3(0f, float.Parse(angles[0], CultureInfo.InvariantCulture) + 90f, 0f));
}
private static Float3 ParseAngleEuler(string origin)
{
string[] angles = origin.Split(' ');
return new Float3(0f, float.Parse(angles[0]) + 45f, 0f);
return new Float3(0f, float.Parse(angles[0], CultureInfo.InvariantCulture) + 45f, 0f);
}
public override void OnDestroy()

View File

@@ -34,9 +34,13 @@ namespace Game
{
public override Type[] PluginDependencies { get => new Type[] { typeof(ConsoleEditorPlugin) }; }
public override PluginDescription Description => NetworkManagerPlugin.DescriptionInternal;
public override Type GamePluginType => typeof(NetworkManagerPlugin);
public NetworkManagerEditorPlugin()
{
_description = NetworkManagerPlugin.DescriptionInternal;
}
public override void Init()
{
//FlaxEngine.Debug.Log("NetworkManagerPlugin initialized");