Reworked options menu as a prefab and changed pause menu a bit. Need to work on option loading (Currently still old mechanic) and jumping cam when striving and looking.

This commit is contained in:
finnchen123
2026-02-22 12:42:52 +01:00
parent 72d1dae796
commit 85e659e23c
46 changed files with 15286 additions and 1555 deletions

View File

@@ -15,7 +15,7 @@ MonoBehaviour:
m_DefaultGroup: c16a2ef1bfc61606c9957985a200fcca
m_currentHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
Hash: b1aa80b7a4d9fb0c8d4294cc07b140c0
m_OptimizeCatalogSize: 0
m_BuildRemoteCatalog: 0
m_CatalogRequestsTimeout: 0
@@ -118,10 +118,9 @@ MonoBehaviour:
m_CertificateHandlerType:
m_AssemblyName:
m_ClassName:
m_ActivePlayerDataBuilderIndex: 3
m_ActivePlayerDataBuilderIndex: 2
m_DataBuilders:
- {fileID: 11400000, guid: 90ab9681875d7b4ee801f0cf2620d2d4, type: 2}
- {fileID: 11400000, guid: ba87c0c24e174058abc8397615483d27, type: 2}
- {fileID: 11400000, guid: 9742e03985d03ba3b99217d97677a9fd, type: 2}
- {fileID: 11400000, guid: 6d20afe04589ad76298b75b69f6069f7, type: 2}
m_ActiveProfileId: ecafb0400e3b7d72ea4c9737692c3b5b

View File

@@ -1368,6 +1368,14 @@ MonoBehaviour:
m_Key: escapeFailForced
m_Metadata:
m_Items: []
- m_Id: 347843257743626240
m_Key: txtKeyboard
m_Metadata:
m_Items: []
- m_Id: 347843368259342336
m_Key: txtController
m_Metadata:
m_Items: []
m_Metadata:
m_Items: []
m_KeyGenerator:

View File

@@ -636,7 +636,7 @@ MonoBehaviour:
m_Metadata:
m_Items: []
- m_Id: 204441706557440
m_Localized: Steuerung
m_Localized: Sprint
m_Metadata:
m_Items: []
- m_Id: 204474401157120
@@ -1379,6 +1379,14 @@ MonoBehaviour:
m_Localized: Du kannst diesem Kampf nicht entkommen.
m_Metadata:
m_Items: []
- m_Id: 347843257743626240
m_Localized: Tastatur/Maus
m_Metadata:
m_Items: []
- m_Id: 347843368259342336
m_Localized: Controller
m_Metadata:
m_Items: []
references:
version: 2
RefIds:

View File

@@ -658,7 +658,7 @@ MonoBehaviour:
m_Metadata:
m_Items: []
- m_Id: 204441706557440
m_Localized: Movement
m_Localized: Sprint
m_Metadata:
m_Items: []
- m_Id: 204474401157120
@@ -1420,6 +1420,14 @@ MonoBehaviour:
m_Localized: You cannot escape this fight.
m_Metadata:
m_Items: []
- m_Id: 347843257743626240
m_Localized: Keyboard/Mouse
m_Metadata:
m_Items: []
- m_Id: 347843368259342336
m_Localized: Controller
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -24,18 +24,6 @@ namespace Assets.Scripts
fight = GameObject.Find("Fight");
}
public void openOptions()
{
audioHandler.playButtonClick();
uihandler.openOptions();
}
public void closeOptions()
{
audioHandler.playButtonClick();
uihandler.closeOptions();
}
public void exitToMenu()
{
audioHandler.playButtonClick();
@@ -78,22 +66,6 @@ namespace Assets.Scripts
player.upgradeSecondary();
}
public void saveOptions()
{
string saveText = "";
audioHandler.playButtonClick();
saveText = saveText + uihandler.saveVideoSettings() + "\r\n";
saveText = saveText + uihandler.saveLanguage() + "\r\n";
saveText = saveText + uihandler.saveAudioSettings() + "\r\n";
GameObject.Find("Controls").GetComponent<Controls>().sensitivityMouse = new Vector2(
GameObject.Find("slideSensitivityMouseHorizontal").GetComponent<Slider>().value,
GameObject.Find("slideSensitivityMouseVertical").GetComponent<Slider>().value
);
saveText = saveText + "SensitivityMouse:"+GameObject.Find("slideSensitivityMouseHorizontal").GetComponent<Slider>().value + "/" + GameObject.Find("slideSensitivityMouseVertical").GetComponent<Slider>().value;
FileHandler.saveOptions(saveText);
uihandler.closeOptions();
}
public void closeIntroduction()
{
audioHandler.playButtonClick();

View File

@@ -0,0 +1,97 @@
using Assets.Scripts;
using UnityEngine;
using UnityEngine.UI;
public class OptionHandler : MonoBehaviour
{
public bool isMenu = true;
public void saveOptions()
{
string saveText = "";
saveText = saveText + saveVideoSettings() + "\r\n";
saveText = saveText + saveLanguage() + "\r\n";
saveText = saveText + saveAudioSettings() + "\r\n";
saveText = saveText + "SensitivityMouse:" + GameObject.Find("slideSensitivityMouseHorizontal").GetComponent<Slider>().value + "/" + GameObject.Find("slideSensitivityMouseVertical").GetComponent<Slider>().value;
if (!isMenu)
{
GameObject.Find("Controls").GetComponent<Controls>().sensitivityMouse = new Vector2(
GameObject.Find("slideSensitivityMouseHorizontal").GetComponent<Slider>().value,
GameObject.Find("slideSensitivityMouseVertical").GetComponent<Slider>().value
);
}
FileHandler.saveOptions(saveText);
}
public string saveVideoSettings()
{
GameObject resolution = GameObject.Find("dropResolution");
GameObject mode = GameObject.Find("dropMode");
string result = "";
switch (resolution.GetComponent<Dropdown>().value)
{
case 0:
Screen.SetResolution(800, 600, Screen.fullScreenMode);
break;
case 1:
Screen.SetResolution(1280, 800, Screen.fullScreenMode);
break;
case 2:
Screen.SetResolution(1920, 1080, Screen.fullScreenMode);
break;
}
switch (mode.GetComponent<Dropdown>().value)
{
case 0:
if (Screen.fullScreenMode != FullScreenMode.Windowed)
{
Screen.fullScreenMode = FullScreenMode.Windowed;
}
break;
case 1:
if (Screen.fullScreenMode != FullScreenMode.ExclusiveFullScreen)
{
Screen.fullScreenMode = FullScreenMode.ExclusiveFullScreen;
}
break;
case 2:
if (Screen.fullScreenMode != FullScreenMode.FullScreenWindow)
{
Screen.fullScreenMode = FullScreenMode.FullScreenWindow;
}
break;
}
result = result + "Resolution:" + resolution.GetComponent<Dropdown>().value + "\r\n";
result = result + "Mode:" + mode.GetComponent<Dropdown>().value;
return result;
}
public string saveLanguage()
{
GameObject language = GameObject.Find("dropLanguage");
string result = "";
switch (language.GetComponent<Dropdown>().value)
{
case 0:
result = "de";
break;
case 1:
result = "en";
break;
}
result = "Language:" + result;
return result;
}
public string saveAudioSettings()
{
string result = "";
float music = GameObject.Find("slideMusic").GetComponent<Slider>().value;
float effects = GameObject.Find("slideEffects").GetComponent<Slider>().value;
result = result + "Music:" + music + "\r\n";
result = result + "Effects:" + effects;
return result;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 01be303a57f148e4791a13abf141956a

View File

@@ -115,19 +115,6 @@ namespace Assets.Scripts
EventSystem.current.SetSelectedGameObject(GameObject.Find("btnCloseTutorial"));
}
public void openOptions()
{
FileHandler.loadOptionDisplay();
hideOtherElements(options);
state = UIState.PAUSEOPTIONS;
}
public void closeOptions()
{
state = UIState.PAUSE;
openPauseMenu();
}
public void switchInventory()
{
if (state == UIState.INVENTORY)
@@ -233,77 +220,6 @@ namespace Assets.Scripts
showHUD();
}
public string saveVideoSettings()
{
GameObject resolution = GameObject.Find("dropResolution");
GameObject mode = GameObject.Find("dropMode");
string result = "";
switch (resolution.GetComponent<Dropdown>().value)
{
case 0:
Screen.SetResolution(800, 600, Screen.fullScreenMode);
break;
case 1:
Screen.SetResolution(1280, 800, Screen.fullScreenMode);
break;
case 2:
Screen.SetResolution(1920, 1080, Screen.fullScreenMode);
break;
}
switch (mode.GetComponent<Dropdown>().value)
{
case 0:
if (Screen.fullScreenMode != FullScreenMode.Windowed)
{
Screen.fullScreenMode = FullScreenMode.Windowed;
}
break;
case 1:
if (Screen.fullScreenMode != FullScreenMode.ExclusiveFullScreen)
{
Screen.fullScreenMode = FullScreenMode.ExclusiveFullScreen;
}
break;
case 2:
if (Screen.fullScreenMode != FullScreenMode.FullScreenWindow)
{
Screen.fullScreenMode = FullScreenMode.FullScreenWindow;
}
break;
}
result = result + "Resolution:" + resolution.GetComponent<Dropdown>().value + "\r\n";
result = result + "Mode:" + mode.GetComponent<Dropdown>().value;
return result;
}
public string saveLanguage()
{
GameObject language = GameObject.Find("dropLanguage");
string result = "";
switch (language.GetComponent<Dropdown>().value)
{
case 0:
result = "de";
break;
case 1:
result = "en";
break;
}
result = "Language:" + result;
return result;
}
public string saveAudioSettings()
{
string result = "";
float music = GameObject.Find("slideMusic").GetComponent<Slider>().value;
float effects = GameObject.Find("slideEffects").GetComponent<Slider>().value;
result = result + "Music:" + music + "\r\n";
result = result + "Effects:" + effects;
return result;
}
public void openPauseMenu()
{
hideOtherElements(pauseMenu);

View File

@@ -56,17 +56,6 @@ namespace Assets.Scripts.Menu
uihandler.closeCharacterCreation();
}
public void saveOptions()
{
string saveText = "";
saveText = saveText + uihandler.saveVideoSettings() + "\r\n";
saveText = saveText + uihandler.saveLanguage() + "\r\n";
saveText = saveText + uihandler.saveAudioSettings() + "\r\n";
saveText = saveText + "SensitivityMouse:"+GameObject.Find("slideSensitivityMouseHorizontal").GetComponent<Slider>().value + "/" + GameObject.Find("slideSensitivityMouseVertical").GetComponent<Slider>().value;
FileHandler.saveOptions(saveText);
uihandler.closeOptions();
}
public void loadGame()
{
uihandler.loadGame(sceneHandler);

View File

@@ -65,78 +65,7 @@ namespace Assets.Scripts.Menu
characterCreation.transform.localScale = new Vector3(0, 0, 0);
EventSystem.current.SetSelectedGameObject(GameObject.Find("btnStart"));
}
public string saveVideoSettings()
{
GameObject resolution = GameObject.Find("dropResolution");
GameObject mode = GameObject.Find("dropMode");
string result = "";
switch (resolution.GetComponent<Dropdown>().value)
{
case 0:
Screen.SetResolution(800, 600, Screen.fullScreenMode);
break;
case 1:
Screen.SetResolution(1280, 800, Screen.fullScreenMode);
break;
case 2:
Screen.SetResolution(1920, 1080, Screen.fullScreenMode);
break;
}
switch (mode.GetComponent<Dropdown>().value)
{
case 0:
if (Screen.fullScreenMode != FullScreenMode.Windowed)
{
Screen.fullScreenMode = FullScreenMode.Windowed;
}
break;
case 1:
if (Screen.fullScreenMode != FullScreenMode.ExclusiveFullScreen)
{
Screen.fullScreenMode = FullScreenMode.ExclusiveFullScreen;
}
break;
case 2:
if (Screen.fullScreenMode != FullScreenMode.FullScreenWindow)
{
Screen.fullScreenMode = FullScreenMode.FullScreenWindow;
}
break;
}
result = result + "Resolution:" + resolution.GetComponent<Dropdown>().value + "\r\n";
result = result + "Mode:" + mode.GetComponent<Dropdown>().value;
return result;
}
public string saveLanguage()
{
GameObject language = GameObject.Find("dropLanguage");
string result = "";
switch (language.GetComponent<Dropdown>().value)
{
case 0:
result = "de";
break;
case 1:
result = "en";
break;
}
result = "Language:" + result;
return result;
}
public string saveAudioSettings()
{
string result = "";
float music = GameObject.Find("slideMusic").GetComponent<Slider>().value;
float effects = GameObject.Find("slideEffects").GetComponent<Slider>().value;
result = result + "Music:" + music + "\r\n";
result = result + "Effects:" + effects;
return result;
}
public void loadGame(SceneHandler sceneHandler)
{
PlayerPrefs.SetInt("isLoad", 1);

8
Assets/UI Toolkit.meta Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5cf7b4d6f44f8d161a2177c0ea10607b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,52 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 19101, guid: 0000000000000000e000000000000000, type: 0}
m_Name: PanelSettings
m_EditorClassIdentifier: UnityEngine.dll::UnityEngine.UIElements.PanelSettings
themeUss: {fileID: -4733365628477956816, guid: 85db00abc510f25579e57b989eb4201b, type: 3}
m_DisableNoThemeWarning: 0
m_TargetTexture: {fileID: 0}
m_RenderMode: 0
m_ColliderUpdateMode: 0
m_ColliderIsTrigger: 1
m_ScaleMode: 1
m_ReferenceSpritePixelsPerUnit: 100
m_PixelsPerUnit: 100
m_Scale: 1
m_ReferenceDpi: 96
m_FallbackDpi: 96
m_ReferenceResolution: {x: 1200, y: 800}
m_ScreenMatchMode: 0
m_Match: 0
m_SortingOrder: 0
m_TargetDisplay: 0
m_BindingLogLevel: 0
m_ClearDepthStencil: 1
m_ClearColor: 0
m_ColorClearValue: {r: 0, g: 0, b: 0, a: 0}
m_VertexBudget: 0
m_TextureSlotCount: 8
m_DynamicAtlasSettings:
m_MinAtlasSize: 64
m_MaxAtlasSize: 4096
m_MaxSubTextureSize: 64
m_ActiveFilters: -1
m_AtlasBlitShader: {fileID: 9101, guid: 0000000000000000f000000000000000, type: 0}
m_DefaultShader: {fileID: 9100, guid: 0000000000000000f000000000000000, type: 0}
m_RuntimeGaussianBlurShader: {fileID: 20300, guid: 0000000000000000f000000000000000, type: 0}
m_RuntimeColorEffectShader: {fileID: 20301, guid: 0000000000000000f000000000000000, type: 0}
m_SDFShader: {fileID: 19011, guid: 0000000000000000f000000000000000, type: 0}
m_BitmapShader: {fileID: 9001, guid: 0000000000000000f000000000000000, type: 0}
m_SpriteShader: {fileID: 19012, guid: 0000000000000000f000000000000000, type: 0}
m_ICUDataAsset: {fileID: 0}
forceGammaRendering: 0
textSettings: {fileID: 0}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1e9bc3765e97603a498937352136b320
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cd5f5818f2319572fb9e903910185841
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1 @@
@import url("unity-theme://default");

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 85db00abc510f25579e57b989eb4201b
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12388, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0
unsupportedSelectorAction: 0