Compare commits

...

5 Commits

Author SHA1 Message Date
c635e0a0b7 fix: unwanted ship rotations&displacement, fade audio being interrupted 2024-04-11 18:35:10 +02:00
5a658d6cd4 feat: audio management/playback features
Every sound in the game is now a ManageableAudio prefab.
The prefabs are picked up in an audio library automatically and other game objects
can get the sound they need from the AudioManager.
They obtain a ManageableAudio instance which offers various
methods to interact with the AudioSource.
Depending on how they request the ManageableAudio, the AudioSource
is attached to the requesting GameObject, to the Scene or the global management Scene.
This provides options to play sounds spatially, globally and scene independent.

The prefabs are identified by a tag and an ID, so it is easy to swap out sounds globally, by just replacing the prefab.
2024-04-10 16:57:25 +02:00
6f8b9fde9f
doc: Update README.md 2024-04-04 07:52:34 +00:00
Jakob Feldmann
cbfd16941c doc: Added and improved comments + project readme 2024-04-03 16:48:59 +02:00
64162cb4a1 feat: whole project restructuring
This can be seen as the initial state of the project after the released demo.

The changes include:
- New ship models
- Singleton manager structure to keep project scaleable in the future
     - Managing players, their settings, character choices, statistics, match setups, controls etc. in a separate decoupled scene
- Main menu with transitions to the arena scene
- Beginnings of a custom audio solution
- Logging with Log4Net

It is really a complete overhaul of the projects structure and management.
2024-04-01 23:06:39 +02:00
865 changed files with 106876 additions and 6539 deletions

View File

@ -15,7 +15,7 @@ MonoBehaviour:
m_Logging: 1
m_AutomaticPerformanceModeEnabled: 1
m_EnableBoostOnStartup: 1
m_StatsLoggingFrequencyInFrames: 50
m_StatsLoggingFrequencyInFrames: 30
m_IndexerSettings:
m_Active: 1
m_ThermalActionDelay: 10

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f1cc20c0d0cf7304a9295088a8302282
guid: e0e1d8057c7f97d4495b1827a30f941c
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c66bc34cb5c3ead4d95c6db73466a47e
guid: f1c5bdc7486d4604285dd44c4cbed571
folderAsset: yes
DefaultImporter:
externalObjects: {}

Binary file not shown.

View File

@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: f03afcd094e19824e8549f6fec3655ef
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 1
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 1
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 9664f04197907f443ab8a27e87ecc7fa
guid: 34f2d49886d8dc244bcc393efba8b70e
folderAsset: yes
DefaultImporter:
externalObjects: {}

Binary file not shown.

View File

@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 82a8d17c2698c834f96370756847edec
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@ -13,6 +13,7 @@ MonoBehaviour:
m_Name: Input System Input Settings
m_EditorClassIdentifier:
m_SupportedDevices:
- Mouse
- Gamepad
- Keyboard
m_UpdateMode: 1

View File

@ -2,7 +2,7 @@
// <auto-generated>
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
// version 1.6.3
// from Assets/Input/InputActionMaps.inputactions
// from Assets/Input System Settings/InputActionMaps.inputactions
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@ -56,7 +56,7 @@ public partial class @InputActionMaps: IInputActionCollection2, IDisposable
},
{
""name"": ""Boost"",
""type"": ""Button"",
""type"": ""PassThrough"",
""id"": ""c8819d8c-8dc4-4eb6-ae07-132d6fffbed4"",
""expectedControlType"": ""Button"",
""processors"": """",
@ -429,6 +429,76 @@ public partial class @InputActionMaps: IInputActionCollection2, IDisposable
""isPartOfComposite"": false
}
]
},
{
""name"": ""Meta"",
""id"": ""a5c1447b-b3fb-4a89-b942-fdf9beb5a79f"",
""actions"": [
{
""name"": ""Start"",
""type"": ""Button"",
""id"": ""18797b6b-ee2f-4fde-85c6-b70e831cdf95"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""Pause"",
""type"": ""Button"",
""id"": ""2cf1215a-a9ec-4bce-8f08-978e08472f6a"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
}
],
""bindings"": [
{
""name"": """",
""id"": ""5a7b5d2a-ece5-46e0-a265-deb8949f1b47"",
""path"": ""<Gamepad>/start"",
""interactions"": """",
""processors"": """",
""groups"": ""Controller"",
""action"": ""Start"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""3cd0cfc6-4d22-448f-8f55-ce3678def10a"",
""path"": ""<Keyboard>/enter"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard 1;Keyboard 2"",
""action"": ""Start"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""98e0906e-0a6c-4097-a3f8-4d8640ad4d2a"",
""path"": ""<Gamepad>/start"",
""interactions"": """",
""processors"": """",
""groups"": ""Controller"",
""action"": ""Pause"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""fa09a433-c040-4da0-8e75-7c8a5f62d4ce"",
""path"": ""<Keyboard>/escape"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard 1;Keyboard 2"",
""action"": ""Pause"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
}
],
""controlSchemes"": [
@ -478,6 +548,10 @@ public partial class @InputActionMaps: IInputActionCollection2, IDisposable
m_Player_Steer = m_Player.FindAction("Steer", throwIfNotFound: true);
m_Player_Reset = m_Player.FindAction("Reset", throwIfNotFound: true);
m_Player_Boost = m_Player.FindAction("Boost", throwIfNotFound: true);
// Meta
m_Meta = asset.FindActionMap("Meta", throwIfNotFound: true);
m_Meta_Start = m_Meta.FindAction("Start", throwIfNotFound: true);
m_Meta_Pause = m_Meta.FindAction("Pause", throwIfNotFound: true);
}
public void Dispose()
@ -605,6 +679,60 @@ public partial class @InputActionMaps: IInputActionCollection2, IDisposable
}
}
public PlayerActions @Player => new PlayerActions(this);
// Meta
private readonly InputActionMap m_Meta;
private List<IMetaActions> m_MetaActionsCallbackInterfaces = new List<IMetaActions>();
private readonly InputAction m_Meta_Start;
private readonly InputAction m_Meta_Pause;
public struct MetaActions
{
private @InputActionMaps m_Wrapper;
public MetaActions(@InputActionMaps wrapper) { m_Wrapper = wrapper; }
public InputAction @Start => m_Wrapper.m_Meta_Start;
public InputAction @Pause => m_Wrapper.m_Meta_Pause;
public InputActionMap Get() { return m_Wrapper.m_Meta; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(MetaActions set) { return set.Get(); }
public void AddCallbacks(IMetaActions instance)
{
if (instance == null || m_Wrapper.m_MetaActionsCallbackInterfaces.Contains(instance)) return;
m_Wrapper.m_MetaActionsCallbackInterfaces.Add(instance);
@Start.started += instance.OnStart;
@Start.performed += instance.OnStart;
@Start.canceled += instance.OnStart;
@Pause.started += instance.OnPause;
@Pause.performed += instance.OnPause;
@Pause.canceled += instance.OnPause;
}
private void UnregisterCallbacks(IMetaActions instance)
{
@Start.started -= instance.OnStart;
@Start.performed -= instance.OnStart;
@Start.canceled -= instance.OnStart;
@Pause.started -= instance.OnPause;
@Pause.performed -= instance.OnPause;
@Pause.canceled -= instance.OnPause;
}
public void RemoveCallbacks(IMetaActions instance)
{
if (m_Wrapper.m_MetaActionsCallbackInterfaces.Remove(instance))
UnregisterCallbacks(instance);
}
public void SetCallbacks(IMetaActions instance)
{
foreach (var item in m_Wrapper.m_MetaActionsCallbackInterfaces)
UnregisterCallbacks(item);
m_Wrapper.m_MetaActionsCallbackInterfaces.Clear();
AddCallbacks(instance);
}
}
public MetaActions @Meta => new MetaActions(this);
private int m_ControllerSchemeIndex = -1;
public InputControlScheme ControllerScheme
{
@ -648,4 +776,9 @@ public partial class @InputActionMaps: IInputActionCollection2, IDisposable
void OnReset(InputAction.CallbackContext context);
void OnBoost(InputAction.CallbackContext context);
}
public interface IMetaActions
{
void OnStart(InputAction.CallbackContext context);
void OnPause(InputAction.CallbackContext context);
}
}

View File

@ -34,7 +34,7 @@
},
{
"name": "Boost",
"type": "Button",
"type": "PassThrough",
"id": "c8819d8c-8dc4-4eb6-ae07-132d6fffbed4",
"expectedControlType": "Button",
"processors": "",
@ -407,6 +407,76 @@
"isPartOfComposite": false
}
]
},
{
"name": "Meta",
"id": "a5c1447b-b3fb-4a89-b942-fdf9beb5a79f",
"actions": [
{
"name": "Start",
"type": "Button",
"id": "18797b6b-ee2f-4fde-85c6-b70e831cdf95",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "Pause",
"type": "Button",
"id": "2cf1215a-a9ec-4bce-8f08-978e08472f6a",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
}
],
"bindings": [
{
"name": "",
"id": "5a7b5d2a-ece5-46e0-a265-deb8949f1b47",
"path": "<Gamepad>/start",
"interactions": "",
"processors": "",
"groups": "Controller",
"action": "Start",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "3cd0cfc6-4d22-448f-8f55-ce3678def10a",
"path": "<Keyboard>/enter",
"interactions": "",
"processors": "",
"groups": "Keyboard 1;Keyboard 2",
"action": "Start",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "98e0906e-0a6c-4097-a3f8-4d8640ad4d2a",
"path": "<Gamepad>/start",
"interactions": "",
"processors": "",
"groups": "Controller",
"action": "Pause",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "fa09a433-c040-4da0-8e75-7c8a5f62d4ce",
"path": "<Keyboard>/escape",
"interactions": "",
"processors": "",
"groups": "Keyboard 1;Keyboard 2",
"action": "Pause",
"isComposite": false,
"isPartOfComposite": false
}
]
}
],
"controlSchemes": [

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: cb7df17cd29013e46a4aa3b247344c43
guid: 51f0da2801c1c1d4a9f5b0b465c0cbe5
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<log4net>
<!-- Define custom log levels -->
<level name="Debug" value="DEBUG" />
<level name="Info" value="INFO" />
<level name="Warn" value="WARN" />
<level name="Error" value="ERROR" />
<!-- Console appender -->
<appender name="UnityDebugConsole" type="UnityDebugAppender">
<layout type="log4net.Layout.PatternLayout" name="DefaultLayout">
<conversionPattern
value=" %message | %logger | Thread: [%thread] %date{ss:fff}ms %newline" />
</layout>
</appender>
<!-- Rolling file appender -->
<appender name="File" type="log4net.Appender.RollingFileAppender">
<file type="log4net.Util.PatternString" value="%property{LogFileName}.log" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="5" />
<maximumFileSize value="10MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout" name="DefaultLayout">
<conversionPattern
value="%date{yyyy-MM-dd HH:mm:ss.ffff} Thread: [%thread] %level %logger - %message%newline" />
</layout>
</appender>
<!-- Root logger -->
<root>
<level value="Debug" />
<appender-ref ref="UnityDebugConsole" />
<appender-ref ref="File" />
</root>
</log4net>

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ec15dad1b04214281a9b4853b22e16f8
guid: 7c1001ab95d71c345aac765158c01a9f
TextScriptImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e363a7a3b19f9476eafd671062b7b491
guid: 0df9c17681eebce4eabca03ea64a85dc
DefaultImporter:
externalObjects: {}
userData:

View File

@ -0,0 +1,24 @@
using log4net.Appender;
using log4net.Core;
using UnityEngine;
public class UnityDebugAppender : AppenderSkeleton
{
protected override void Append(LoggingEvent loggingEvent)
{
string message = RenderLoggingEvent(loggingEvent);
string colorTag = GetColorTag(loggingEvent.Level);
Debug.Log($"<b>{colorTag}</b> {message}");
}
private string GetColorTag(Level level)
{
// Map log levels to colors (customize as needed)
switch (level.Name)
{
case "DEBUG": return "<color=green>Debug: </color>";
case "INFO": return @"<color=black>Info: </color>";
case "WARN": return @"<color=yellow>Warning: </color>";
case "ERROR": return @"<color=red>Error: </color>";
default: return "";
}
}
}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 092bf3b983af64d85be968602701f933
guid: b7edba1b4c159d1489cc9ee1d2624e7e
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@ -13,6 +13,7 @@ Material:
m_ModifiedSerializedProperties: 24
m_ValidKeywords:
- _ALPHAPREMULTIPLY_ON
- _MANUAL_RIPPLE
- _OCCLUSIONMAP
- _SPECULARHIGHLIGHTS_OFF
- _SPECULAR_SETUP

View File

@ -26,6 +26,7 @@ Material:
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _ALPHAPREMULTIPLY_ON
- _MANUAL_RIPPLE
- _OCCLUSIONMAP
- _SPECULARHIGHLIGHTS_OFF
- _SURFACE_TYPE_TRANSPARENT
@ -134,12 +135,12 @@ Material:
- _Glossiness: 0
- _GlossyReflections: 0
- _ImpactSpeed: 4.22
- _ManualRipple: 0
- _ManualRippleAmplitude: 0.1
- _ManualRippleAnim: 0
- _ManualRipple: 1
- _ManualRippleAmplitude: 0.07
- _ManualRippleAnim: 1
- _ManualRippleDensity: 15
- _ManualRippleFrequency: 20
- _ManualRippleRadius: 4
- _ManualRippleRadius: 2.5
- _MaxWaveDistortion: 1.13
- _Metallic: 0.88
- _MetallicSpecGlossMapToggle: 0

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Some files were not shown because too many files have changed in this diff Show More