adding in some needed packages

This commit is contained in:
reisenlol 2026-01-02 01:31:54 -08:00
parent 9e739f5dc8
commit aba5310742
No known key found for this signature in database
1012 changed files with 494191 additions and 1 deletions

View file

@ -0,0 +1,112 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6656727562651948476
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2796862160257006055}
- component: {fileID: 3241674762504521747}
- component: {fileID: 6701917810003632763}
m_Layer: 0
m_Name: Game Maker Explosion
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2796862160257006055
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6656727562651948476}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &3241674762504521747
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6656727562651948476}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 888385823
m_SortingLayer: 3
m_SortingOrder: 1000
m_Sprite: {fileID: 8212609606336292601, guid: 627ad9148d395ed40920cedd1065c8b7, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 4, y: 4}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!95 &6701917810003632763
Animator:
serializedVersion: 7
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6656727562651948476}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: c34a1e4d8579cc94ab9136719b22098e, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_StabilizeFeet: 0
m_AnimatePhysics: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 051f99b16bca04740afc39d3f7b4056b
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,428 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1284474683989526541
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3056738278845536874}
- component: {fileID: 8845745571331175439}
m_Layer: 0
m_Name: Pause Action
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3056738278845536874
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1284474683989526541}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2304067790638222617}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &8845745571331175439
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1284474683989526541}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bcd07fdd60be4b2499d920f5e5c2a0fb, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &2152461217421339223
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5060974604485124748}
- component: {fileID: 5188442167180783980}
- component: {fileID: 9178559746328615319}
- component: {fileID: 5600763562313292931}
m_Layer: 5
m_Name: Loading UI
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &5060974604485124748
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2152461217421339223}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2465719283461132149}
m_Father: {fileID: 2304067790638222617}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!223 &5188442167180783980
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2152461217421339223}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_VertexColorAlwaysGammaSpace: 0
m_AdditionalShaderChannelsFlag: 25
m_UpdateRectTransformForStandalone: 0
m_SortingLayerID: 0
m_SortingOrder: 32767
m_TargetDisplay: 0
--- !u!114 &9178559746328615319
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2152461217421339223}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 1600, y: 900}
m_ScreenMatchMode: 1
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 0
--- !u!114 &5600763562313292931
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2152461217421339223}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!1 &7198060926564768246
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2465719283461132149}
- component: {fileID: 1195799660445020728}
- component: {fileID: 181661629318963400}
- component: {fileID: 5827123888280680543}
m_Layer: 5
m_Name: Load Canvas Container
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2465719283461132149
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7198060926564768246}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6927279723705986406}
m_Father: {fileID: 5060974604485124748}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1.1295166, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1195799660445020728
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7198060926564768246}
m_CullTransparentMesh: 1
--- !u!114 &181661629318963400
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7198060926564768246}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.5754717, g: 0.5754717, b: 0.5754717, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 8736314227388405715, guid: c73a6c77f06e1ef478f657fc29ca9ba7, type: 3}
m_Type: 2
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 0.15
--- !u!114 &5827123888280680543
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7198060926564768246}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 86710e43de46f6f4bac7c8e50813a599, type: 3}
m_Name:
m_EditorClassIdentifier:
m_AspectMode: 4
m_AspectRatio: 1.7777778
--- !u!1 &7331462678980301650
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6927279723705986406}
- component: {fileID: 5106761873570130516}
- component: {fileID: 8597913954976008033}
m_Layer: 5
m_Name: Loading Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6927279723705986406
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7331462678980301650}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2465719283461132149}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 764.5306, y: 418.0639}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5106761873570130516
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7331462678980301650}
m_CullTransparentMesh: 1
--- !u!114 &8597913954976008033
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7331462678980301650}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 'Loading: 0%'
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 9b7571b3e6a49494c8aef269b34dd028, type: 2}
m_sharedMaterial: {fileID: -7504494933660032812, guid: 9b7571b3e6a49494c8aef269b34dd028, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 72
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &8819992696731238189
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2304067790638222617}
- component: {fileID: 8829255101487187414}
m_Layer: 0
m_Name: General Manager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2304067790638222617
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8819992696731238189}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 340.42038, y: 244.79291, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3056738278845536874}
- {fileID: 5060974604485124748}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &8829255101487187414
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8819992696731238189}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6e4f9053e7492514b96e578010e50081, type: 3}
m_Name:
m_EditorClassIdentifier:
loadingScreen: {fileID: 2152461217421339223}
loadingScreenText: {fileID: 8597913954976008033}
funnyExplosion: {fileID: 6656727562651948476, guid: 051f99b16bca04740afc39d3f7b4056b, type: 3}
funnyExplosionSound: {fileID: 11400000, guid: 55ec0602485d61c47859cbc2e1a8ab95, type: 2}
breakDownScore: 1
visibleScoreDivisor: 0.01
visibleScoreMultiplier: 100

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 67e5d9ec227c3544fbaf385463230eb8
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,390 @@
using Core.Extensions;
using System.Collections;
using UnityEngine.SceneManagement;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.InputSystem;
namespace Bremsengine
{
#region Key Values
public partial class GeneralManager
{
public struct Keys
{
public const string PlayerBombs = "Player Bombs";
public const string PlayerLives = "Player Lives";
}
static Dictionary<string, dynamic> gameValues;
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)]
private static void InitializeGameValues()
{
gameValues = new();
}
public static void StartReplay()
{
Application.OpenURL("https://obsproject.com/");
}
public static void StoreGameValue<T>(string key, T data)
{
gameValues[key] = data;
}
public static bool TryFetchGameValue<T>(string key, out T output)
{
object value;
output = default(T);
if (gameValues.TryGetValue(key, out value))
{
output = (T)value;
}
return output != null;
}
}
#endregion
#region Load Scene
public partial class GeneralManager
{
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
private static void ReinitializeSceneLoader()
{
IsLoadingScene = false;
}
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)]
private static void InitializeStageActions()
{
StageActions = new();
}
public static void SetStageLoadAction(string key, StageExitAction action)
{
StageActions[key] = action;
}
[SerializeField] GameObject loadingScreen;
[SerializeField] TMP_Text loadingScreenText;
public static bool IsLoadingScene;
public static string CurrentSceneName => SceneManager.GetActiveScene().name;
public delegate void StageExitAction();
static Dictionary<string, StageExitAction> StageActions;
public static void LoadSceneAfterDelay(string sceneName, float delay, System.Action callback = null)
{
IEnumerator CO_LoadScene(string sceneName, float delay)
{
void SetLoadingProgress(float progress)
{
if (Instance.loadingScreenText != null)
{
Instance.loadingScreenText.text = "Loading: " + (progress * 100f).Clamp(0f, 100f).ToString("F0") + "%";
}
}
float storedTimescale = Time.timeScale;
IsLoadingScene = true;
yield return new WaitForSecondsRealtime(delay);
Time.timeScale = 0f;
StageExitAction toRun = null;
foreach (var item in StageActions)
{
toRun += item.Value;
}
toRun?.Invoke();
if (Instance != null && Instance.loadingScreen != null)
{
Instance.loadingScreenText.text = "Loading: 0%";
Instance.loadingScreen.SetActive(true);
yield return new WaitForSecondsRealtime(0.15f);
AsyncOperation o = SceneManager.LoadSceneAsync(sceneName);
float progress = 0f;
while (o != null && !o.isDone)
{
progress = progress.Lerp(o.progress / 0.9f, Time.deltaTime * 3f).Clamp(0f, 1f);
SetLoadingProgress(progress);
yield return null;
}
SetLoadingProgress(1f);
yield return new WaitForSecondsRealtime(0.45f);
callback?.Invoke();
Instance.loadingScreen.SetActive(false);
Time.timeScale = 1f;
}
else
{
yield return new WaitForSecondsRealtime(delay);
SceneManager.LoadScene(sceneName);
}
Time.timeScale = storedTimescale;
IsLoadingScene = false;
}
if (!IsLoadingScene)
{
Instance.StartCoroutine(CO_LoadScene(sceneName, delay));
}
}
}
#endregion
#region Difficulty
public partial class GeneralManager
{
#region Colors & Names
public static string GetDifficultyName(Difficulty d)
{
string difficultyName = "";
switch (d)
{
case Difficulty.Easy: difficultyName += "Easy"; break;
case Difficulty.Normal: difficultyName += "Normal"; break;
case Difficulty.Hard: difficultyName += "Hard"; break;
case Difficulty.Lunatic: difficultyName += "Lunatic"; break;
case Difficulty.Ultra: difficultyName += "Ultra"; break;
case Difficulty.Extra: difficultyName += "Extra"; break;
default: difficultyName = "Normal"; SetDifficulty(Difficulty.Normal); break;
}
return difficultyName;
}
public static Color32 GetDifficultyColor(Difficulty d)
{
switch (d)
{
case Difficulty.Easy: return ColorHelper.PastelGreen;
case Difficulty.Normal: return ColorHelper.PastelBlue;
case Difficulty.Hard: return ColorHelper.PastelYellow;
case Difficulty.Lunatic: return ColorHelper.PastelPurple;
case Difficulty.Ultra: return ColorHelper.PastelOrange;
case Difficulty.Extra: return ColorHelper.PastelRed;
default: return Color.blue;
}
}
#endregion
public static bool ChurroHardmode => CurrentDifficulty == Difficulty.Ultra;
public static Difficulty CurrentDifficulty { get; private set; } = Difficulty.Ultra;
public enum Difficulty
{
Easy = 1,
Normal = 2,
Hard = 3,
Lunatic = 4,
Ultra = 5,
Extra = 6
}
public delegate void DifficultyChange(Difficulty d);
public static event DifficultyChange OnDifficultyChanged;
public static void SetDifficulty(Difficulty d)
{
CurrentDifficulty = d;
OnDifficultyChanged?.Invoke(d);
}
public static bool IsDifficultyGreaterOrThanEqualTo(Difficulty d)
{
int selection = (int)d;
return (int)CurrentDifficulty >= selection;
}
}
#endregion
#region Pause
public partial class GeneralManager
{
public static bool IsPaused { get; private set; }
private static float StoredPausedTimescale = 1f;
public static void SetPause(bool state)
{
IsPaused = state;
if (state)
{
//Pause
StoredPausedTimescale = Time.timeScale;
Time.timeScale = 0f;
IsPaused = true;
Debug.Log("Paused Game");
//PlayerInputController.actions.Player.Disable(); GAME IS COMPLAINING SO I COMMENT THESE OUT - Sylvia
//PlayerInputController.actions.Shmup.Disable();
}
else
{
//Unpause
Time.timeScale = StoredPausedTimescale;
IsPaused = false;
Debug.Log("Un-paused Game");
//PlayerInputController.actions.Player.Enable();
//PlayerInputController.actions.Shmup.Enable();
}
}
public static void PauseGame()
{
SetPause(true);
}
public static void UnPauseGame()
{
SetPause(false);
}
public static void TogglePause()
{
SetPause(!IsPaused);
}
public static void Command_SetTimescale(float timescale)
{
StoredPausedTimescale = timescale;
UnPauseGame();
}
}
#endregion
#region Score
public partial class GeneralManager
{
private static float HiddenScoreValidationSum = 0;
private static float ScoreValidationMultiplier;
public static bool ShouldAddScoreKey => ScoreBreakdownAnalysis != null;
public static void AddScoreAnalysisKey(string scoreKey, float score)
{
if (!ShouldAddScoreKey)
return;
if (!ScoreBreakdownAnalysis.ContainsKey(scoreKey))
ScoreBreakdownAnalysis[scoreKey] = 0;
ScoreBreakdownAnalysis[scoreKey] += score;
}
public static bool IsScoreLegit()
{
float scoreAccuracy = HiddenScoreValidationSum / ScoreValidationMultiplier;
if (Mathf.Abs(scoreAccuracy - actualScore) < (actualScore * 0.05f))
{
return true;
}
return false;
}
public static float SumUpScoreAnalysis()
{
float sum = 0f;
foreach (var item in ScoreBreakdownAnalysis)
{
sum += item.Value;
}
return sum;
}
private static Dictionary<string, float> ScoreBreakdownAnalysis;
[SerializeField] bool breakDownScore = false;
public static float actualScore;
public static float HighestScore { get; private set; }
public static float VisibleScore;
[SerializeField] float visibleScoreDivisor = 0.01f;
[SerializeField] float visibleScoreMultiplier = 100f;
static string HighScoreStringKey = "HiScore_Save";
static bool IsHighscorePotentiallyOutOfSync = true;
public delegate void ScoreAction(float score, float hiscore);
public static ScoreAction OnScoreUpdate;
public static float LoadHighScore()
{
ResyncHighscore();
return HighestScore;
}
public static float ResetScore()
{
SetScoreValue(0f);
ScoreBreakdownAnalysis.Clear();
HiddenScoreValidationSum = 0;
return VisibleScore;
}
private static void SendUpdateScoreEvent(float scoreValue, float highScoreValue)
{
OnScoreUpdate?.Invoke(scoreValue, highScoreValue);
}
public static float AddScore(float value)
{
SetScoreValue(actualScore + value);
HiddenScoreValidationSum += value * ScoreValidationMultiplier;
return value;
}
public static void ApplyHighscoreToSave(float value)
{
PlayerPrefs.SetFloat(HighScoreStringKey, value);
}
static void ResyncHighscore()
{
if (!IsHighscorePotentiallyOutOfSync)
return;
IsHighscorePotentiallyOutOfSync = false;
float loadedScore = PlayerPrefs.GetFloat(HighScoreStringKey);
if (HighestScore < loadedScore) HighestScore = loadedScore;
}
private static void SetScoreValue(float value)
{
ResyncHighscore();
actualScore = value;
VisibleScore = (value.Multiply(Instance.visibleScoreDivisor)).Floor().Multiply(Instance.visibleScoreMultiplier);
if (actualScore > HighestScore)
{
HighestScore = VisibleScore;
}
SendUpdateScoreEvent(VisibleScore, HighestScore);
}
private void OnApplicationQuit()
{
ApplyHighscoreToSave(LoadHighScore());
if (ScoreBreakdownAnalysis != null)
{
foreach (var item in ScoreBreakdownAnalysis)
{
string scoreMessage = "Score Breakdown##".ReplaceLineBreaks("##");
scoreMessage += $"Score Partition({item.Key}) : {item.Value.ToString("F0")}##".ReplaceLineBreaks("##");
Debug.Log(scoreMessage);
}
}
}
}
#endregion
[DefaultExecutionOrder(-10)]
public partial class GeneralManager : MonoBehaviour
{
public static GeneralManager Instance { get; private set; }
private void Awake()
{
StartInstance();
}
private void OnDestroy()
{
if (Instance == this)
{
CloseInstance();
}
}
private void Start()
{
if (Instance == this)
{
IsHighscorePotentiallyOutOfSync = true;
SetScoreValue(0f);
ScoreValidationMultiplier = Random.Range(1f, 10f);
InputSystem.settings.updateMode = InputSettings.UpdateMode.ProcessEventsInDynamicUpdate;
}
}
private void StartInstance()
{
if (Instance != null)
{
Destroy(gameObject);
return;
}
Instance = this;
DontDestroyOnLoad(gameObject);
if (loadingScreen != null)
{
loadingScreen.SetActive(false);
}
if (breakDownScore)
{
ScoreBreakdownAnalysis = new();
}
}
private void CloseInstance()
{
if (Instance != this)
return;
Instance = null;
}
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
private static void ReInitialize()
{
Instance = null;
ScoreBreakdownAnalysis = null;
}
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6e4f9053e7492514b96e578010e50081

View file

@ -0,0 +1,16 @@
using UnityEngine;
namespace Bremsengine
{
public class GeneralManagerPauseAction : MonoBehaviour
{
public void SetPause(bool state)
{
GeneralManager.SetPause(state);
}
public void TogglePause()
{
SetPause(!GeneralManager.IsPaused);
}
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: bcd07fdd60be4b2499d920f5e5c2a0fb