namespacify everything
This commit is contained in:
@@ -6,19 +6,19 @@ using FlaxEngine;
|
||||
using Console = Game.Console;
|
||||
using Object = FlaxEngine.Object;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
[Flags]
|
||||
public enum AudioFlags
|
||||
{
|
||||
[Flags]
|
||||
public enum AudioFlags
|
||||
{
|
||||
None = 0,
|
||||
|
||||
/// Avoid replacing the existing playing audio source in this channel.
|
||||
ContinuePlayingExistingSource = 1
|
||||
}
|
||||
}
|
||||
|
||||
public static class AudioManager
|
||||
{
|
||||
public static class AudioManager
|
||||
{
|
||||
private static readonly Random random = new Random();
|
||||
|
||||
private static readonly Dictionary<string, AudioInfo> cachedAudioInfos = new Dictionary<string, AudioInfo>();
|
||||
@@ -252,5 +252,4 @@ namespace Game
|
||||
channelSources = new Dictionary<int, AudioSource>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,10 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public class AudioSourceDelayed : AudioSource
|
||||
{
|
||||
public class AudioSourceDelayed : AudioSource
|
||||
{
|
||||
public float Delay = 0f;
|
||||
public override void OnBeginPlay()
|
||||
{
|
||||
@@ -22,10 +22,10 @@ namespace Game
|
||||
base.OnBeginPlay();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class AudioSourceDelayedScript : Script
|
||||
{
|
||||
public class AudioSourceDelayedScript : Script
|
||||
{
|
||||
[NoSerialize]
|
||||
[HideInEditor]
|
||||
public float PlayStartTime = 0f;
|
||||
@@ -43,5 +43,4 @@ namespace Game
|
||||
Actor.As<AudioSourceDelayed>().Play();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using FlaxEngine;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public class CameraMovement : Script
|
||||
{
|
||||
public class CameraMovement : Script
|
||||
{
|
||||
private float viewPitch;
|
||||
private float viewRoll;
|
||||
private float viewYaw;
|
||||
@@ -95,5 +95,4 @@ namespace Game
|
||||
|
||||
Actor.Transform = camTrans;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
using FlaxEditor.Content.Settings;
|
||||
using FlaxEngine;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
/// <summary>
|
||||
/// CameraRender Script.
|
||||
/// </summary>
|
||||
[ExecuteInEditMode]
|
||||
public class CameraRender : PostProcessEffect
|
||||
{
|
||||
/// <summary>
|
||||
/// CameraRender Script.
|
||||
/// </summary>
|
||||
[ExecuteInEditMode]
|
||||
public class CameraRender : PostProcessEffect
|
||||
{
|
||||
public Camera camera;
|
||||
|
||||
private bool lastEnabled;
|
||||
@@ -178,5 +178,4 @@ namespace Game
|
||||
{
|
||||
//OnAwake();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using FlaxEngine;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public class CameraSpring : Script
|
||||
{
|
||||
public class CameraSpring : Script
|
||||
{
|
||||
private bool lastGround;
|
||||
private Float3 lastPosition;
|
||||
public float percY;
|
||||
@@ -71,5 +71,4 @@ namespace Game
|
||||
lastPosition = position;
|
||||
lastGround = playerMovement.OnGround;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using FlaxEngine;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public class WeaponSway : Script
|
||||
{
|
||||
public class WeaponSway : Script
|
||||
{
|
||||
private Actor cameraHolder;
|
||||
|
||||
private Actor rootActor;
|
||||
@@ -79,5 +79,4 @@ namespace Game
|
||||
|
||||
Actor.LocalOrientation = Quaternion.Euler(angles);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
// Holds common miscellaneous Console variables and commands
|
||||
public static class CommonCommands
|
||||
{
|
||||
// Holds common miscellaneous Console variables and commands
|
||||
public static class CommonCommands
|
||||
{
|
||||
[ConsoleVariable("developer")]
|
||||
public static string Developer
|
||||
{
|
||||
@@ -38,5 +38,4 @@ namespace Game
|
||||
{
|
||||
throw new Exception(string.Join(" ", text));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public class Config
|
||||
{
|
||||
public class Config
|
||||
{
|
||||
private Dictionary<string, string> dictionary = new Dictionary<string, string>();
|
||||
|
||||
public Config()
|
||||
@@ -30,5 +30,4 @@ namespace Game
|
||||
|
||||
return lines;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public class ConfigParser
|
||||
{
|
||||
public class ConfigParser
|
||||
{
|
||||
private ConfigParser()
|
||||
{
|
||||
|
||||
@@ -47,5 +47,4 @@ namespace Game
|
||||
|
||||
return config;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,10 @@ using System.Runtime.InteropServices;
|
||||
using FlaxEditor;
|
||||
using FlaxEngine;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public struct ConsoleLine
|
||||
{
|
||||
public struct ConsoleLine
|
||||
{
|
||||
public string content;
|
||||
|
||||
internal ConsoleLine(string line)
|
||||
@@ -33,10 +33,10 @@ namespace Game
|
||||
{
|
||||
return content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class Console
|
||||
{
|
||||
public static class Console
|
||||
{
|
||||
private static ConsoleInstance instance;
|
||||
|
||||
// Returns if Console window open right now.
|
||||
@@ -188,10 +188,10 @@ namespace Game
|
||||
{
|
||||
return instance.GetVariable(variableName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ConsoleInstance : IDisposable
|
||||
{
|
||||
public class ConsoleInstance : IDisposable
|
||||
{
|
||||
private readonly List<string> consoleBufferHistory = new List<string>();
|
||||
private readonly Dictionary<string, ConsoleCommand> consoleCommands = new Dictionary<string, ConsoleCommand>();
|
||||
|
||||
@@ -560,5 +560,4 @@ namespace Game
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public abstract class ConsoleBaseAttribute : Attribute
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public abstract class ConsoleBaseAttribute : Attribute
|
||||
{
|
||||
// Additional aliases for this command, these should only be used with user interaction.
|
||||
// Commands such as 'cvarlist' should not list these in order to avoid clutter.
|
||||
internal string[] aliases = new string[0];
|
||||
@@ -24,19 +24,19 @@ namespace Game
|
||||
}
|
||||
|
||||
public ConsoleFlags flags { get; private set; }
|
||||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public class ConsoleVariableAttribute : ConsoleBaseAttribute
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public class ConsoleVariableAttribute : ConsoleBaseAttribute
|
||||
{
|
||||
public ConsoleVariableAttribute(string name) : base(name)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public class ConsoleCommandAttribute : ConsoleBaseAttribute
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public class ConsoleCommandAttribute : ConsoleBaseAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers a command to Console system.
|
||||
/// </summary>
|
||||
@@ -55,13 +55,12 @@ namespace Game
|
||||
public ConsoleCommandAttribute(params string[] names) : base(names)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for the subsystem, must be called first before registering console commands.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public class ConsoleSubsystemInitializer : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for the subsystem, must be called first before registering console commands.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public class ConsoleSubsystemInitializer : Attribute
|
||||
{
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
internal struct ConsoleCommand
|
||||
{
|
||||
internal struct ConsoleCommand
|
||||
{
|
||||
public string name { get; }
|
||||
|
||||
private readonly MethodInfo[] methods;
|
||||
@@ -74,5 +74,4 @@ namespace Game
|
||||
|
||||
throw new Exception("Unexpected number of parameters.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,10 @@ using System.Text;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.GUI;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public class ConsoleContentTextBox : Control
|
||||
{
|
||||
public class ConsoleContentTextBox : Control
|
||||
{
|
||||
private readonly FontReference Font;
|
||||
|
||||
protected TextLayoutOptions _layout;
|
||||
@@ -680,5 +680,4 @@ namespace Game
|
||||
public int lineOffset;
|
||||
public int lineLength;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,10 @@
|
||||
using System.Linq;
|
||||
using FlaxEngine;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public class ConsoleInputTextBox : ConsoleTextBoxBase
|
||||
{
|
||||
public class ConsoleInputTextBox : ConsoleTextBoxBase
|
||||
{
|
||||
private readonly ConsoleContentTextBox contentBox;
|
||||
|
||||
private int inputHistoryIndex = -1;
|
||||
@@ -168,5 +168,4 @@ namespace Game
|
||||
base.Draw();
|
||||
Profiler.EndEvent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,10 @@ using System.Linq;
|
||||
using FlaxEditor;
|
||||
#endif
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public class ConsolePlugin : GamePlugin
|
||||
{
|
||||
public class ConsolePlugin : GamePlugin
|
||||
{
|
||||
public ConsolePlugin()
|
||||
{
|
||||
#if FLAX_EDITOR
|
||||
@@ -74,11 +74,11 @@ namespace Game
|
||||
foreach (var line in AssetManager.Config.GetLines())
|
||||
Console.Execute(line, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if FLAX_EDITOR
|
||||
public class ConsoleEditorPlugin : EditorPlugin
|
||||
{
|
||||
public class ConsoleEditorPlugin : EditorPlugin
|
||||
{
|
||||
public static PluginDescription DescriptionInternal = new PluginDescription
|
||||
{
|
||||
Author = "Ari Vuollet",
|
||||
@@ -178,6 +178,5 @@ namespace Game
|
||||
foreach (var line in AssetManager.Config.GetLines())
|
||||
Console.Execute(line, false, true);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -6,10 +6,10 @@ using FlaxEngine.Assertions;
|
||||
using FlaxEngine.GUI;
|
||||
using Object = FlaxEngine.Object;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public class ConsoleScript : Script
|
||||
{
|
||||
public class ConsoleScript : Script
|
||||
{
|
||||
public Color BackgroundColor;
|
||||
|
||||
public Texture BackgroundTexture;
|
||||
@@ -394,5 +394,4 @@ namespace Game
|
||||
{
|
||||
consoleInputBox.Text = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,11 @@
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.GUI;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
// Mostly based on TextBox
|
||||
public class ConsoleTextBoxBase : TextBoxBase
|
||||
{
|
||||
// Mostly based on TextBox
|
||||
public class ConsoleTextBoxBase : TextBoxBase
|
||||
{
|
||||
private readonly Stopwatch lastDoubleClick = new Stopwatch();
|
||||
protected TextLayoutOptions _layout;
|
||||
|
||||
@@ -386,5 +386,4 @@ namespace Game
|
||||
SetSelection(Mathf.Max(right, 0) + clipboardText.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
[Flags]
|
||||
public enum ConsoleFlags
|
||||
{
|
||||
[Flags]
|
||||
public enum ConsoleFlags
|
||||
{
|
||||
NoSerialize = 1, // Value does not persist
|
||||
|
||||
Alias = NoSerialize
|
||||
}
|
||||
}
|
||||
|
||||
internal struct ConsoleVariable
|
||||
{
|
||||
internal struct ConsoleVariable
|
||||
{
|
||||
public string name { get; }
|
||||
public ConsoleFlags flags { get; }
|
||||
|
||||
@@ -71,5 +71,4 @@ namespace Game
|
||||
throw new Exception("Unsupported type for SetValue: " + type.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,19 +9,19 @@ using FlaxEditor.Content.Settings;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.Networking;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public enum UpscalingMode
|
||||
{
|
||||
public enum UpscalingMode
|
||||
{
|
||||
None,
|
||||
FSR2,
|
||||
DLSS,
|
||||
FSR1,
|
||||
}
|
||||
}
|
||||
|
||||
// Holds Console variables and commands to control engine behaviour
|
||||
public static class EngineSubsystem
|
||||
{
|
||||
// Holds Console variables and commands to control engine behaviour
|
||||
public static class EngineSubsystem
|
||||
{
|
||||
private static FSR _fsrPlugin;
|
||||
public static FSR FsrPlugin
|
||||
{
|
||||
@@ -729,5 +729,4 @@ namespace Game
|
||||
{
|
||||
Debug.Log(string.Join(" ", text));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using FlaxEngine;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public static class Utilities
|
||||
{
|
||||
public static class Utilities
|
||||
{
|
||||
public static ScopeProfiler ProfileScope(string eventName)
|
||||
{
|
||||
return new ScopeProfiler(eventName);
|
||||
@@ -22,5 +22,4 @@ namespace Game
|
||||
Profiler.EndEvent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,31 +7,31 @@ using FlaxEngine.Assertions;
|
||||
using FlaxEngine.Networking;
|
||||
using Console = Game.Console;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class NetworkPredictedAttribute : Attribute
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class NetworkPredictedAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: insert code to update variables with this attribute?
|
||||
// rename to NetworkReplicatedAttribute?
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class NetworkedAttribute : Attribute
|
||||
{
|
||||
}
|
||||
// TODO: insert code to update variables with this attribute?
|
||||
// rename to NetworkReplicatedAttribute?
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class NetworkedAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
// NetworkMulticastAttribute: calls methods marked with this in all clients
|
||||
// NetworkMulticastAttribute: calls methods marked with this in all clients
|
||||
|
||||
public enum NetworkMessageType : byte
|
||||
{
|
||||
public enum NetworkMessageType : byte
|
||||
{
|
||||
Handshake = 1,
|
||||
Message
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static partial class NetworkManager
|
||||
{
|
||||
public static partial class NetworkManager
|
||||
{
|
||||
public delegate bool OnMessageDecl(ref NetworkEvent networkEvent);
|
||||
|
||||
private static bool initialized;
|
||||
@@ -201,5 +201,4 @@ namespace Game
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,10 @@ using FlaxEngine.Networking;
|
||||
using Console = Game.Console;
|
||||
using Object = FlaxEngine.Object;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public static partial class NetworkManager
|
||||
{
|
||||
public static partial class NetworkManager
|
||||
{
|
||||
public static uint LocalPlayerClientId { get; /*private*/ set; }
|
||||
|
||||
public static INetworkDriver ClientNetworkDriver { get; set; }
|
||||
@@ -154,5 +154,4 @@ namespace Game
|
||||
private static void OnClientActorSpawned(Actor actor)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,10 +11,10 @@ using FlaxEngine.Networking;
|
||||
using Console = Game.Console;
|
||||
using Object = FlaxEngine.Object;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public static unsafe partial class NetworkManager
|
||||
{
|
||||
public static unsafe partial class NetworkManager
|
||||
{
|
||||
public const byte DemoVer = 2;
|
||||
private struct DemoNetworkEventHeader
|
||||
{
|
||||
@@ -274,5 +274,4 @@ namespace Game
|
||||
|
||||
DemoEndFrame();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,10 @@ using FlaxEngine.Networking;
|
||||
using Console = Game.Console;
|
||||
using Object = FlaxEngine.Object;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public static partial class NetworkManager
|
||||
{
|
||||
public static partial class NetworkManager
|
||||
{
|
||||
private static List<NetworkConnection> ConnectedClients;
|
||||
|
||||
private static List<Type> NetworkedTypes;
|
||||
@@ -209,5 +209,4 @@ namespace Game
|
||||
{
|
||||
//Console.Print($"actor spawned: {actor.Name} ({actor.TypeName})");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,10 +10,10 @@ using FlaxEngine.Json;
|
||||
using FlaxEngine.Networking;
|
||||
using Console = Game.Console;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public enum GameModeMessageType : byte
|
||||
{
|
||||
public enum GameModeMessageType : byte
|
||||
{
|
||||
WelcomePlayer, // WelcomePlayerMessage
|
||||
SpawnPlayer,
|
||||
PlayerInput,
|
||||
@@ -21,12 +21,12 @@ namespace Game
|
||||
PlayerSnapshot, // send world state delta to client since last client's acknowledged frame
|
||||
|
||||
LastMessageType = 128,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Manages world simulation and handles network messages
|
||||
public class WorldStateManager
|
||||
{
|
||||
// Manages world simulation and handles network messages
|
||||
public class WorldStateManager
|
||||
{
|
||||
private class WorldState
|
||||
{
|
||||
public ulong frame;
|
||||
@@ -724,6 +724,5 @@ namespace Game
|
||||
if (simframs > 1)
|
||||
Console.Print($"simulated {simframs} frames");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -3,10 +3,10 @@ using System.Diagnostics;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.GUI;
|
||||
|
||||
namespace Game
|
||||
{
|
||||
namespace Game;
|
||||
|
||||
public class CrosshairWidget : Script
|
||||
{
|
||||
{
|
||||
private Image control;
|
||||
|
||||
public override void OnAwake()
|
||||
@@ -21,5 +21,4 @@ namespace Game
|
||||
public override void OnUpdate()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,11 @@ using System.Diagnostics;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.GUI;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
[ExecuteInEditMode]
|
||||
public class PerformanceWidget : Script
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class PerformanceWidget : Script
|
||||
{
|
||||
private const double updateInterval = 0.2;
|
||||
|
||||
public UIControl control;
|
||||
@@ -99,5 +99,4 @@ namespace Game
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,10 @@ using System.Diagnostics;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.GUI;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public class SpeedWidget : Script
|
||||
{
|
||||
public class SpeedWidget : Script
|
||||
{
|
||||
public override void OnAwake()
|
||||
{
|
||||
|
||||
@@ -16,5 +16,4 @@ namespace Game
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,22 @@
|
||||
using FlaxEngine;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
/// <summary>
|
||||
/// List of supported materials for loaded levels.
|
||||
/// Maps the given texture/shader name to Flax Material/MaterialInstance.
|
||||
/// </summary>
|
||||
public class BrushMaterialList
|
||||
{
|
||||
/// <summary>
|
||||
/// List of supported materials for loaded levels.
|
||||
/// Maps the given texture/shader name to Flax Material/MaterialInstance.
|
||||
/// </summary>
|
||||
public class BrushMaterialList
|
||||
{
|
||||
[EditorDisplay(name: "Material Assets")]
|
||||
public BrushMaterialListEntry[] materialAssets;
|
||||
}
|
||||
}
|
||||
|
||||
public struct BrushMaterialListEntry
|
||||
{
|
||||
public struct BrushMaterialListEntry
|
||||
{
|
||||
[EditorOrder(1)] [EditorDisplay(name: "Name")]
|
||||
public string name;
|
||||
|
||||
[EditorOrder(2)] [EditorDisplay(name: "Material")]
|
||||
public MaterialBase asset;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
using System;
|
||||
using FlaxEngine;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
[ExecuteInEditMode]
|
||||
public class BrushScript : Script
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class BrushScript : Script
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -2,18 +2,17 @@
|
||||
using FlaxEngine;
|
||||
using FlaxEditor;
|
||||
|
||||
namespace Game
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class LevelScript : Script
|
||||
{
|
||||
public string MapName;
|
||||
public DateTime MapTimestamp;
|
||||
}
|
||||
namespace Game;
|
||||
|
||||
public class LevelScript2 : Script
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class LevelScript : Script
|
||||
{
|
||||
public string MapName;
|
||||
public DateTime MapTimestamp;
|
||||
}
|
||||
|
||||
public class LevelScript2 : Script
|
||||
{
|
||||
public string MapName;
|
||||
public DateTime MapTimestamp;
|
||||
}
|
||||
}
|
||||
@@ -7,10 +7,10 @@ using FlaxEngine;
|
||||
// https://web.archive.org/web/20160316213335/http://forums.ubergames.net/topic/2658-understanding-the-quake-3-map-format/
|
||||
// https://web.archive.org/web/20210228125854/https://forums.thedarkmod.com/index.php?/topic/15668-plugin-request-save-map-in-quake-3-format/
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public struct MapFacePlane
|
||||
{
|
||||
public struct MapFacePlane
|
||||
{
|
||||
public Float3 v1, v2, v3;
|
||||
public Plane plane;
|
||||
public string texture;
|
||||
@@ -18,34 +18,34 @@ namespace Game
|
||||
public float rotation;
|
||||
public Float2 scale;
|
||||
public int contentFlags, surfaceFlags, surfaceValue;
|
||||
}
|
||||
}
|
||||
|
||||
public class MapBrush
|
||||
{
|
||||
public class MapBrush
|
||||
{
|
||||
public MapFacePlane[] planes;
|
||||
}
|
||||
}
|
||||
|
||||
public class MapPatch
|
||||
{
|
||||
public class MapPatch
|
||||
{
|
||||
public string name;
|
||||
}
|
||||
}
|
||||
|
||||
public struct PatchVertex
|
||||
{
|
||||
public struct PatchVertex
|
||||
{
|
||||
public Float3 v;
|
||||
public Float2 uv;
|
||||
}
|
||||
}
|
||||
|
||||
public class MapEntity
|
||||
{
|
||||
public class MapEntity
|
||||
{
|
||||
public List<MapBrush> brushes = new List<MapBrush>();
|
||||
public List<MapEntity> entities = new List<MapEntity>();
|
||||
public List<MapPatch> patches = new List<MapPatch>();
|
||||
public Dictionary<string, string> properties = new Dictionary<string, string>();
|
||||
}
|
||||
}
|
||||
|
||||
public static class MapParser
|
||||
{
|
||||
public static class MapParser
|
||||
{
|
||||
public static MapEntity Parse(byte[] data)
|
||||
{
|
||||
if (data.Length == 0)
|
||||
@@ -525,5 +525,4 @@ namespace Game
|
||||
}
|
||||
} while (index++ < data.Length && !verticesParsed);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,30 +17,30 @@ using FlaxEngine.GUI;
|
||||
using Console = Game.Console;
|
||||
using Debug = FlaxEngine.Debug;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public class BrushGeometryMesh
|
||||
{
|
||||
public class BrushGeometryMesh
|
||||
{
|
||||
public List<uint> indices = new List<uint>();
|
||||
public MaterialBase material;
|
||||
public List<Float3> normals = new List<Float3>();
|
||||
public List<Float2> uvs = new List<Float2>();
|
||||
public List<Float3> vertices = new List<Float3>();
|
||||
}
|
||||
}
|
||||
|
||||
public class BrushGeometry
|
||||
{
|
||||
public class BrushGeometry
|
||||
{
|
||||
public MapBrush brush;
|
||||
public Dictionary<string, MaterialBase> brushMaterials;
|
||||
public BrushGeometryMesh[] meshes;
|
||||
public Model model;
|
||||
public Float3 offset;
|
||||
public Float3[] vertices; // all vertices
|
||||
}
|
||||
}
|
||||
|
||||
[ExecuteInEditMode]
|
||||
public class Q3MapImporter : Script
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class Q3MapImporter : Script
|
||||
{
|
||||
//private string mapPath = @"C:\dev\GoakeFlax\Assets\Maps\cube_q1.map";u8
|
||||
//private string mapPath = @"C:\dev\GoakeFlax\Assets\Maps\cube_q3.map";
|
||||
//private string mapPath = @"C:\dev\GoakeFlax\Assets\Maps\cube_valve.map";
|
||||
@@ -1529,5 +1529,4 @@ namespace Game
|
||||
Destroy(ref model);
|
||||
base.OnDestroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,10 @@ using FlaxEngine;
|
||||
using FlaxEngine.Assertions;
|
||||
using FlaxEngine.Utilities;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public class HalfEdge
|
||||
{
|
||||
public class HalfEdge
|
||||
{
|
||||
public Face face;
|
||||
|
||||
//public Face oppositeFace;
|
||||
@@ -40,10 +40,10 @@ namespace Game
|
||||
opposite.edge.v1 = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public struct Edge
|
||||
{
|
||||
public struct Edge
|
||||
{
|
||||
public Float3 v1, v2;
|
||||
|
||||
public Edge(Float3 v1, Float3 v2)
|
||||
@@ -93,10 +93,10 @@ namespace Game
|
||||
{
|
||||
return !(edge == obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Face
|
||||
{
|
||||
public class Face
|
||||
{
|
||||
public Float3 v1, v2, v3;
|
||||
public List<HalfEdge> halfEdges;
|
||||
public bool visited;
|
||||
@@ -157,10 +157,10 @@ namespace Game
|
||||
|
||||
return areaNorm.Length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public struct Tetrahedron
|
||||
{
|
||||
public struct Tetrahedron
|
||||
{
|
||||
public Float3 v1, v2, v3, v4;
|
||||
|
||||
public Tetrahedron(Float3 v1, Vector3 v2, Vector3 v3, Vector3 v4)
|
||||
@@ -181,10 +181,10 @@ namespace Game
|
||||
new Face(v2, v4, v3),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class QuickHull
|
||||
{
|
||||
public class QuickHull
|
||||
{
|
||||
const float epsilon = 0.01f;
|
||||
|
||||
private void SortPoints(List<Float3> points, Vector3 planeNormal)
|
||||
@@ -855,7 +855,7 @@ namespace Game
|
||||
|
||||
Vector3 edgeVector = (nextVertex - vertex).Normalized;
|
||||
Vector3 outVector =
|
||||
Float3.Cross(-(new Plane(mergedFace.v1, mergedFace.v2, mergedFace.v3).Normal), edgeVector);
|
||||
Float3.Cross(-(new Plane(mergedFace.v1, mergedFace.v2, mergedFace.v3).Normal), edgeVector);
|
||||
|
||||
HalfEdge testHe = qhe.next;
|
||||
do
|
||||
@@ -1310,7 +1310,6 @@ namespace Game
|
||||
currentEdge = currentEdge.next;
|
||||
} while (currentEdge != startingEdge);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,9 +1,9 @@
|
||||
using FlaxEngine;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public static class InputManager
|
||||
{
|
||||
public static class InputManager
|
||||
{
|
||||
public static bool GetAction(string name)
|
||||
{
|
||||
if (Console.IsOpen)
|
||||
@@ -24,5 +24,4 @@ namespace Game
|
||||
return 0.0f;
|
||||
return Input.GetAxisRaw(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,11 @@
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.Networking;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct PlayerInputState
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct PlayerInputState
|
||||
{
|
||||
/*static PlayerInputState()
|
||||
{
|
||||
NetworkReplicator.AddSerializer(typeof(PlayerInputState),
|
||||
@@ -66,11 +66,11 @@ namespace Game
|
||||
public Float3 verificationVelocity;
|
||||
public Float3 verificationViewAngles;
|
||||
public Quaternion verificationOrientation;
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct PlayerActorState
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct PlayerActorState
|
||||
{
|
||||
public Float3 position;
|
||||
public Float3 velocity;
|
||||
public Quaternion orientation;
|
||||
@@ -78,17 +78,17 @@ namespace Game
|
||||
public float lastJumpTime;
|
||||
public int numJumps;
|
||||
public bool jumped;
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct PlayerState
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct PlayerState
|
||||
{
|
||||
public PlayerInputState input;
|
||||
public PlayerActorState actor;
|
||||
}
|
||||
}
|
||||
|
||||
public class PlayerInput
|
||||
{
|
||||
public class PlayerInput
|
||||
{
|
||||
public const byte DemoVer = 1;
|
||||
public const int MaxPlayerStates = 120;
|
||||
|
||||
@@ -170,5 +170,4 @@ namespace Game
|
||||
{
|
||||
return currentState.actor;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,10 @@ using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using Console = Game.Console;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public class PlayerInputDemo : PlayerInput
|
||||
{
|
||||
public class PlayerInputDemo : PlayerInput
|
||||
{
|
||||
protected List<PlayerInputState> buffer = new List<PlayerInputState>();
|
||||
protected IEnumerator<PlayerInputState> bufferEnumerable;
|
||||
|
||||
@@ -98,5 +98,4 @@ namespace Game
|
||||
//frame++;
|
||||
//currentState.actor = actorState;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,10 +9,10 @@ using FlaxEngine;
|
||||
using FlaxEngine.Networking;
|
||||
using Console = Game.Console;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public class PlayerInputLocal : PlayerInput
|
||||
{
|
||||
public class PlayerInputLocal : PlayerInput
|
||||
{
|
||||
protected List<PlayerInputState> buffer = new List<PlayerInputState>();
|
||||
protected GZipStream demoStream;
|
||||
protected FileStream demoFileStream;
|
||||
@@ -146,5 +146,4 @@ namespace Game
|
||||
demoFileStream.Close();
|
||||
demoFileStream = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public class PlayerInputNetwork : PlayerInput
|
||||
{
|
||||
public class PlayerInputNetwork : PlayerInput
|
||||
{
|
||||
public override bool Predict => true;
|
||||
|
||||
public override void OnEndFrame()
|
||||
@@ -9,5 +9,4 @@
|
||||
currentState.input.frame = frame;
|
||||
base.OnEndFrame();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,10 +9,10 @@ using FlaxEngine.Assertions;
|
||||
using FlaxEngine.Networking;
|
||||
using Console = Game.Console;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public class PlayerMovementParameters
|
||||
{
|
||||
public class PlayerMovementParameters
|
||||
{
|
||||
// FIXME, should be much smaller but needed to avoid issues with box collider edges against brush edges diagonally
|
||||
public float collisionMargin { get; } = 0.031f * 1.666f * 1.85f;
|
||||
public float slopeNormal { get; } = 0.7f;
|
||||
@@ -61,10 +61,10 @@ namespace Game
|
||||
public float autoJumpTime { get; } = 0.4f;
|
||||
|
||||
public int airStep { get; } = 2;
|
||||
}
|
||||
}
|
||||
|
||||
public struct PlayerMovementState
|
||||
{
|
||||
public struct PlayerMovementState
|
||||
{
|
||||
public Float3 position;
|
||||
public Float3 currentVelocity;
|
||||
//public Quaternion orientation;
|
||||
@@ -79,10 +79,10 @@ namespace Game
|
||||
public PlayerMovementState()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public struct TraceInfo
|
||||
{
|
||||
public struct TraceInfo
|
||||
{
|
||||
public RayCastHit[] hitInfos;
|
||||
public bool startSolid;
|
||||
|
||||
@@ -96,10 +96,10 @@ namespace Game
|
||||
//public float maxFraction;
|
||||
//public Float3 maxHitNormal;
|
||||
//public Float3 maxEndPosition;
|
||||
}
|
||||
}
|
||||
|
||||
public class PlayerMovement : Script
|
||||
{
|
||||
public class PlayerMovement : Script
|
||||
{
|
||||
private PlayerMovementParameters movementParameters = new PlayerMovementParameters();
|
||||
public PlayerMovementState movementState = new PlayerMovementState();
|
||||
|
||||
@@ -1464,5 +1464,4 @@ namespace Game
|
||||
Floor = 2,
|
||||
Other = 4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.IO;
|
||||
using FlaxEngine;
|
||||
|
||||
namespace Game
|
||||
namespace Game;
|
||||
|
||||
public static class AssetManager
|
||||
{
|
||||
public static class AssetManager
|
||||
{
|
||||
public static string ContentPath { get; private set; } =
|
||||
Path.Combine(Directory.GetCurrentDirectory(), "Content");
|
||||
|
||||
@@ -23,5 +23,4 @@ namespace Game
|
||||
Globals = Content.Load<GameplayGlobals>(Path.Combine(ContentPath, "Settings", "GameSettings", "GameplayGlobals.flax"));
|
||||
Config = ConfigParser.ParseFile(Path.Combine(ContentPath, "config.cfg"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user