Commit d06866b5 authored by Andre Darius Janipour's avatar Andre Darius Janipour
Browse files

Pause Menu eingebaut und mit MainMenu verknüpft

parent 51d20cd3
......@@ -147,7 +147,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 960, y: -690}
m_AnchoredPosition: {x: 960, y: -689.7943}
m_SizeDelta: {x: 450, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &98908209
......@@ -552,6 +552,7 @@ RectTransform:
- {fileID: 1548701386}
- {fileID: 1791382075}
- {fileID: 1251655487}
- {fileID: 1524442979}
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -738,7 +739,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 960, y: -390}
m_AnchoredPosition: {x: 960, y: -389.7943}
m_SizeDelta: {x: 450, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1268737112
......@@ -779,18 +780,7 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 1268737113}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 0}
m_MethodName:
m_Mode: 5
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument: StartGame
m_BoolArgument: 0
m_CallState: 0
m_Calls: []
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &1268737113
......@@ -827,6 +817,151 @@ CanvasRenderer:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1268737110}
m_CullTransparentMesh: 0
--- !u!1 &1405428341
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1405428342}
- component: {fileID: 1405428344}
- component: {fileID: 1405428343}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1405428342
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1405428341}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.14802301, y: 0.15143019, z: 0.15143019}
m_Children: []
m_Father: {fileID: 1524442979}
m_RootOrder: 0
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: -221, y: 230}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1405428343
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1405428341}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 150
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
m_MaxSize: 300
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: "Teamleiter:\nManu\nOli\n\nAI:\nSteffan\n\nUI:\nAndr\xE9\n\nLeveldesigner:\nJens\n\nGamelogic:\nTomm\xE9\n\nArtist:\nChristian\nAntonia\n\n\n"
--- !u!222 &1405428344
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1405428341}
m_CullTransparentMesh: 0
--- !u!1 &1524442978
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1524442979}
- component: {fileID: 1524442981}
- component: {fileID: 1524442980}
m_Layer: 5
m_Name: Credits
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1524442979
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1524442978}
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_Children:
- {fileID: 1405428342}
m_Father: {fileID: 600579322}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -50, y: 0}
m_SizeDelta: {x: 500, y: 500}
m_Pivot: {x: 1, y: 0.5}
--- !u!114 &1524442980
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1524442978}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.392}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!222 &1524442981
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1524442978}
m_CullTransparentMesh: 0
--- !u!1 &1548701385
GameObject:
m_ObjectHideFlags: 0
......@@ -1071,7 +1206,9 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
StartButton: {fileID: 1268737112}
CreditsButton: {fileID: 2048910950}
ExitButton: {fileID: 98908209}
Creditspanel: {fileID: 1524442978}
--- !u!1 &1898117386
GameObject:
m_ObjectHideFlags: 0
......@@ -1168,7 +1305,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 960.00006, y: -540}
m_AnchoredPosition: {x: 960.00006, y: -539.7943}
m_SizeDelta: {x: 450, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2048910950
......
This diff is collapsed.
fileFormatVersion: 2
guid: c6fc4a36d06ae9a46ba8884f376512b9
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: db77a81cc87df7f47bc368f1d33bf466
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -113,48 +113,6 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &117270063
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4425526287611130, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4425526287611130, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4425526287611130, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4425526287611130, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4425526287611130, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4425526287611130, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4425526287611130, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4425526287611130, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
m_IsPrefabAsset: 0
--- !u!1001 &346759372
Prefab:
m_ObjectHideFlags: 0
......@@ -286,48 +244,6 @@ Prefab:
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0e932f5bf5f75fb4c829814e64a68d5b, type: 2}
m_IsPrefabAsset: 0
--- !u!1001 &1017495610
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4425526287611130, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4425526287611130, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4425526287611130, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4425526287611130, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4425526287611130, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4425526287611130, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4425526287611130, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4425526287611130, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
propertyPath: m_RootOrder
value: 5
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 2c0701af97284414c9d311d999051b6b, type: 2}
m_IsPrefabAsset: 0
--- !u!1 &1365802638
GameObject:
m_ObjectHideFlags: 0
......
......@@ -6,25 +6,50 @@ using UnityEngine.UI;
public class MainMenu : MonoBehaviour
{
public Button StartButton, ExitButton; // Make sure to attach these Buttons in the Inspector
public Button StartButton, CreditsButton, ExitButton; // Make sure to attach these Buttons in the Inspector
public GameObject Creditspanel;
void Start()
{
Button sbtn = StartButton.GetComponent<Button>();
Button cbtn = CreditsButton.GetComponent<Button>();
Button ebtn = ExitButton.GetComponent<Button>();
sbtn.onClick.AddListener(StartGame); // On click run function StartGame
ebtn.onClick.AddListener(delegate { Debug.Log("Ende"); }); //Application.Quit); // On click exit game
cbtn.onClick.AddListener(Credits);
ebtn.onClick.AddListener(QuitGame); //Application.Quit); // On click exit game
//delegate ist wie eine function ohne Name
}
public static void StartGame()
{
SceneManager.LoadScene("Test_Level");
SceneManager.LoadScene("Hud", LoadSceneMode.Additive);
SceneManager.LoadScene("Hud", LoadSceneMode.Additive); //load the Hud additive to the level
SceneManager.LoadScene("PauseMenu", LoadSceneMode.Additive);
var rootObjects = SceneManager.GetSceneByName("PauseMenu").GetRootGameObjects();
Debug.Log(rootObjects.Length);
foreach (var rootObject in rootObjects)
{
rootObject.SetActive(false);
}
//Debug.Log("StartButton pushed");
}
public static void QuitGame()
{
Application.Quit();
}
public void Credits()
{
Creditspanel.SetActive(!Creditspanel.activeSelf); //Switch visability of Credits dings
}
}
......
using UnityEngine;
using UnityEngine.SceneManagement;
using System.Collections;
using UnityEngine.UI;
public class PauseMenu : MonoBehaviour
{
public Button ResumeButton, RestartButton, MainMenuButton, ExitButton; // Make sure to attach these Buttons in the Inspector
void Start()
{
//Time.timeScale = 0; //Pause the Game
Button btn1 = ResumeButton.GetComponent<Button>();
Button btn2 = RestartButton.GetComponent<Button>();
Button btn3 = MainMenuButton.GetComponent<Button>();
Button btn4 = ExitButton.GetComponent<Button>();
btn1.onClick.AddListener(ResumeGame); // On click run function StartGame
btn2.onClick.AddListener(RestartGame);
btn3.onClick.AddListener(MainMenuReturn);
btn4.onClick.AddListener(ExitGame);
//delegate ist wie eine function ohne Name
}
public void ResumeGame()
{
//SceneManager.LoadScene("Test_Level");
//SceneManager.LoadScene("Hud", LoadSceneMode.Additive);
//Debug.Log("StartButton pushed");
//Time.timeScale = 1; //Resume The Game
}
public void RestartGame()
{
SceneManager.LoadScene("Test_Level");
SceneManager.LoadScene("Hud",LoadSceneMode.Additive); // LoadSceneMode.Additive läd das Hud zum TestLevel dazu
}
public void MainMenuReturn() //
{
Debug.Log("MainMenu");
SceneManager.LoadScene("MainMenu");
}
public static void ExitGame() // fertig
{
Debug.Log("Ende");
Application.Quit();
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 3b589897b355f50449b4c7dc7504b405
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 54e897489065240448d478b8891c61b0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/_Game/Sprites/UI/life.png

128 Bytes | W: | H:

Assets/_Game/Sprites/UI/life.png

128 Bytes | W: | H:

Assets/_Game/Sprites/UI/life.png
Assets/_Game/Sprites/UI/life.png
Assets/_Game/Sprites/UI/life.png
Assets/_Game/Sprites/UI/life.png
  • 2-up
  • Swipe
  • Onion skin
fileFormatVersion: 2
guid: ae2122f215065ab41b6301ec7fe1e3dd
guid: 1dae8b4baca33bc4aa80d88deee92ea1
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
......
......@@ -8,13 +8,19 @@ EditorBuildSettings:
- enabled: 0
path:
guid: 00000000000000000000000000000000
- enabled: 1
path: Assets/_Game/Scenes/Main Menu.unity
guid: 7769d4dbae8a97d4d93431ec4ed2ab22
- enabled: 0
path:
guid: 00000000000000000000000000000000
- enabled: 1
path: Assets/_Game/Scenes/Test_Level.unity
guid: 8f954e8084a22a043a7670648f11c80b
- enabled: 1
path: Assets/_Game/Scenes/HUD.unity
guid: 4c618612f2217be428f833f74203c962
- enabled: 1
path: Assets/_Game/Scenes/PauseMenu.unity
guid: c6fc4a36d06ae9a46ba8884f376512b9
- enabled: 1
path: Assets/_Game/Scenes/MainMenu.unity
guid: 34f14705e8cdf7b469f6267444e32b58
m_configObjects: {}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment