From 2da49f9855cbda97aa2ab3ce0f8c859a69bc3c35 Mon Sep 17 00:00:00 2001 From: Tony Pohto <tmpoht@utu.fi> Date: Sun, 3 Mar 2019 17:49:57 +0200 Subject: [PATCH] =?UTF-8?q?main=20menu=20lis=C3=A4tty=20ja=20muokattu=20na?= =?UTF-8?q?ppeja?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scenes/MainMenu.unity | 195 ++++++++++++++++++++-- Assets/Scripts/MenuSript.cs | 21 +++ Assets/Scripts/MenuSript.cs.meta | 11 ++ ProjectSettings/EditorBuildSettings.asset | 10 +- 4 files changed, 219 insertions(+), 18 deletions(-) create mode 100644 Assets/Scripts/MenuSript.cs create mode 100644 Assets/Scripts/MenuSript.cs.meta diff --git a/Assets/Scenes/MainMenu.unity b/Assets/Scenes/MainMenu.unity index 4486db2..b92f68b 100644 --- a/Assets/Scenes/MainMenu.unity +++ b/Assets/Scenes/MainMenu.unity @@ -185,7 +185,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 834199860} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 5.2034483, y: 2.3731437, z: 0} + m_LocalPosition: {x: -0.16, y: -2.91, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -264,7 +264,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1242906259} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -5.3051963, y: 2.9021022, z: 0} + m_LocalPosition: {x: 5.65, y: 1.53, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -343,7 +343,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1334682652} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -3.89, y: -3.87, z: 0} + m_LocalPosition: {x: -5.34, y: -2.93, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -359,6 +359,8 @@ GameObject: m_Component: - component: {fileID: 1346472592} - component: {fileID: 1346472591} + - component: {fileID: 1346472594} + - component: {fileID: 1346472593} m_Layer: 0 m_Name: ExitButton m_TagString: Untagged @@ -403,8 +405,8 @@ SpriteRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 1 - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Color: {r: 0.990566, g: 0, b: 0, a: 1} + m_Sprite: {fileID: 21300002, guid: 96af674e67bc4b521aa75450c40dfcbf, type: 3} + m_Color: {r: 0.8980393, g: 0.8980393, b: 0.8980393, a: 1} m_FlipX: 0 m_FlipY: 0 m_DrawMode: 0 @@ -422,12 +424,52 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1346472590} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: -1.22, z: 0.058931645} - m_LocalScale: {x: 20, y: 5, z: 1} + m_LocalPosition: {x: 2.5, y: 0, z: 0.058931645} + m_LocalScale: {x: 3, y: 3, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!61 &1346472593 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1346472590} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 1, y: 1} + newSize: {x: 0.16, y: 0.16} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 1, y: 1} + m_EdgeRadius: 0 +--- !u!114 &1346472594 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1346472590} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6b987107b9a225144a51d7e298dbf2aa, type: 3} + m_Name: + m_EditorClassIdentifier: + playButton: {fileID: 1377888703} + exitButton: {fileID: 1346472590} --- !u!1 &1377888703 GameObject: m_ObjectHideFlags: 0 @@ -438,6 +480,8 @@ GameObject: m_Component: - component: {fileID: 1377888705} - component: {fileID: 1377888704} + - component: {fileID: 1377888707} + - component: {fileID: 1377888708} m_Layer: 0 m_Name: PlayButton m_TagString: Untagged @@ -482,8 +526,8 @@ SpriteRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 1 - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Color: {r: 0.013082923, g: 0.9245283, b: 0.18797691, a: 1} + m_Sprite: {fileID: 21300000, guid: 96af674e67bc4b521aa75450c40dfcbf, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 m_FlipY: 0 m_DrawMode: 0 @@ -501,12 +545,131 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1377888703} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1.14, z: 0.058931645} - m_LocalScale: {x: 20, y: 5, z: 1} + m_LocalPosition: {x: -2.5, y: 0, z: 0.058931645} + m_LocalScale: {x: 3, y: 3, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1377888707 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1377888703} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6b987107b9a225144a51d7e298dbf2aa, type: 3} + m_Name: + m_EditorClassIdentifier: + playButton: {fileID: 1377888703} + exitButton: {fileID: 1346472590} +--- !u!61 &1377888708 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1377888703} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 1, y: 1} + newSize: {x: 0.16, y: 0.16} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 1, y: 1} + m_EdgeRadius: 0 +--- !u!1 &1490674628 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1490674630} + - component: {fileID: 1490674629} + m_Layer: 0 + m_Name: rock (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &1490674629 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1490674628} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 1 + m_Sprite: {fileID: 21300000, guid: 2d5618b5caec3c7d6bac162c4cd0a034, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!4 &1490674630 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1490674628} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -5.29, y: 2.63, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1507413978 GameObject: m_ObjectHideFlags: 0 @@ -580,7 +743,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1507413978} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 4.25, y: -2.0348446, z: 0} + m_LocalPosition: {x: 5.62, y: -2.75, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -640,8 +803,8 @@ SpriteRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 - m_Sprite: {fileID: 21300000, guid: fe463401d3186b54086acff6bb82891f, type: 3} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Color: {r: 1, g: 0.9111515, b: 0.6084906, a: 1} m_FlipX: 0 m_FlipY: 0 m_DrawMode: 0 @@ -659,8 +822,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1807990412} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.08, y: -0.1, z: 0} - m_LocalScale: {x: 13, y: 10, z: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 150, y: 100, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 1 diff --git a/Assets/Scripts/MenuSript.cs b/Assets/Scripts/MenuSript.cs new file mode 100644 index 0000000..ecb8b12 --- /dev/null +++ b/Assets/Scripts/MenuSript.cs @@ -0,0 +1,21 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class MenuSript : MonoBehaviour +{ + [SerializeField] + private GameObject playButton; + [SerializeField] + private GameObject exitButton; + + private void OnMouseDown() { + if (gameObject == exitButton) { + Application.Quit(); + } + if (gameObject == playButton) { + UnityEngine.SceneManagement.SceneManager.LoadScene(1); + } + + } +} diff --git a/Assets/Scripts/MenuSript.cs.meta b/Assets/Scripts/MenuSript.cs.meta new file mode 100644 index 0000000..7f2f2f1 --- /dev/null +++ b/Assets/Scripts/MenuSript.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6b987107b9a225144a51d7e298dbf2aa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index 82ab0f5..a25e4a7 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -5,7 +5,13 @@ EditorBuildSettings: m_ObjectHideFlags: 0 serializedVersion: 2 m_Scenes: + - enabled: 0 + path: + guid: 00000000000000000000000000000000 - enabled: 1 - path: Assets/Scenes/SampleScene.unity - guid: 2cda990e2423bbf4892e6590ba056729 + path: Assets/Scenes/MainMenu.unity + guid: 782780faed4d8b1409a6034453c0627c + - enabled: 1 + path: Assets/Scenes/MainScene.unity + guid: cad276c071768944288a0c09b5741599 m_configObjects: {} -- GitLab