Commit c91dc199 authored by Markus Schlösser's avatar Markus Schlösser

Added main menu

parent 70320e11
fileFormatVersion: 2
guid: 16ffbd3152392fe489e1e9db1ff0d23f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: b5c669e19a490ac409259bbcef1be499
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 770fb1889d99a484390de0cf2a2eaf9a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 60ab49492872e2c4eac539a7f9d9caa7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%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: 11500000, guid: 84c523596ac9b3048a65aa0732219edd, type: 3}
m_Name: Space Attacker
m_EditorClassIdentifier:
scenePath: Assets/_Game/SpaceAttacker/SpaceAttacker.unity
displayName: Space Attacker
sprite: {fileID: 21300000, guid: 5761aadb22620e849a62a15479a326fe, type: 3}
fileFormatVersion: 2
guid: a303eeabcc42b454e9498a98a2c46484
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8092f8c35ee336f4fa5aa2d6a6e5ef8d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%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: 11500000, guid: 84c523596ac9b3048a65aa0732219edd, type: 3}
m_Name: New Game
m_EditorClassIdentifier:
scenePath:
displayName: Fake Test
sprite: {fileID: 0}
fileFormatVersion: 2
guid: 3050f242b6d1b7b40bae99d6432cc741
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 9f593fcd25d7f20428f45979baaae4a9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Linq;
using UnityEditor;
using UnityEngine;
namespace Utilities {
[CustomPropertyDrawer(typeof(ScenePathAttribute))]
public class ScenePathAttributeDrawer : PropertyDrawer {
private const float FIX_BUTTON_WIDTH = 70.0f;
private static SceneAsset GetSceneAsset(SerializedProperty property) {
return AssetDatabase.LoadAssetAtPath<SceneAsset>(property.stringValue);
}
private static bool IsInBuildSettingsAndEnabled(string scenePath) {
string path = scenePath.Trim();
EditorBuildSettingsScene[] scenes = EditorBuildSettings.scenes;
return scenes.Any(x => x.path == path && x.enabled);
}
private static bool HasExtendedHeight(SerializedProperty property) {
return GetSceneAsset(property) != null && !IsInBuildSettingsAndEnabled(property.stringValue);
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) {
float defaultHeight = base.GetPropertyHeight(property, label);
return defaultHeight + (HasExtendedHeight(property) ? EditorGUIUtility.singleLineHeight + 2 : 0);
}
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) {
DrawSceneField(position, property, label);
DrawBuildSettingsWarning(position, property);
}
private static void DrawLabel(ref Rect position, GUIContent label) {
position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
}
private static void DrawSceneField(Rect position, SerializedProperty property, GUIContent label) {
using (new EditorGUI.PropertyScope(position, label, property)) {
position.height = EditorGUIUtility.singleLineHeight;
DrawLabel(ref position, label);
using (EditorGUI.ChangeCheckScope check = new EditorGUI.ChangeCheckScope()) {
SceneAsset scene = GetSceneAsset(property);
scene = EditorGUI.ObjectField(position, scene, typeof(SceneAsset), false) as SceneAsset;
if (check.changed) {
property.stringValue = AssetDatabase.GetAssetOrScenePath(scene);
}
}
}
}
private static void DrawBuildSettingsWarning(Rect position, SerializedProperty property) {
if (!HasExtendedHeight(property)) return;
float singleLineHeight = EditorGUIUtility.singleLineHeight;
Rect helpBox = new Rect(position.x, position.yMax - singleLineHeight, position.width - FIX_BUTTON_WIDTH, singleLineHeight);
Rect buttonRect = new Rect(position.xMax - FIX_BUTTON_WIDTH, position.yMax - singleLineHeight, FIX_BUTTON_WIDTH, singleLineHeight);
EditorGUI.HelpBox(helpBox, "Scene is not added to build settings", MessageType.Warning);
if (GUI.Button(buttonRect, "Fix Now")) {
EnsureSceneAddedToBuildSettings(property.stringValue);
}
}
private static void EnsureSceneAddedToBuildSettings(string scenePath) {
string path = scenePath.Trim();
EditorBuildSettingsScene[] scenes = EditorBuildSettings.scenes;
foreach (EditorBuildSettingsScene scene in scenes) {
if (scene.path == path) {
scene.enabled = true;
EditorBuildSettings.scenes = scenes;
return;
}
}
EditorBuildSettings.scenes = EditorBuildSettings.scenes.Append(new EditorBuildSettingsScene(scenePath, true)).ToArray();
}
}
}
fileFormatVersion: 2
guid: ecb9960971d1c3f47b273e7261dd8559
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
{
"name": "Supergame.MainMenu.Editor",
"references": [
"GUID:c3a068315699fdd46b960aaf5ffe39d7"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": []
}
\ No newline at end of file
fileFormatVersion: 2
guid: fd0985ce9787e764d8d4c46bcc9bfe80
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 13d29030f1dff6946bddb71ee85290be
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 44fe80093da7aa24dbb83d8eb7bf9c08
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 49676fc29d079494585eec6aa34152e5
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontName: Lucida Console
fontNames:
- Lucida Console
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: a1d735c3ae3d4fc42b57de4ced346425
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: ac5fca7ca4ee3ee4f8806a0b12017d41
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: a245df0857701994db3f77f769d31601
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6809626927723439284
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8729743269950843928}
m_Layer: 5
m_Name: GameObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8729743269950843928
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6809626927723439284}
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: 9082363233416221665}
m_Father: {fileID: 4994692637312868614}
m_RootOrder: 0
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: -100, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &7718283016460092572
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4994692637312868614}
m_Layer: 5
m_Name: Padding
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4994692637312868614
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7718283016460092572}
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: 8729743269950843928}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 200, y: 150}
m_Pivot: {x: 0, y: 1}
--- !u!1 &9082363233416221664
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 9082363233416221665}
- component: {fileID: 9082363233416221669}
- component: {fileID: 9082363233416221668}
- component: {fileID: 9082363233416221671}
- component: {fileID: 9082363233416221670}
- component: {fileID: 9082363233416221674}
- component: {fileID: 1447884624026788190}
m_Layer: 5
m_Name: Button
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &9082363233416221665
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9082363233416221664}
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: []
m_Father: {fileID: 8729743269950843928}
m_RootOrder: 0
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.5, y: 0.5}
--- !u!222 &9082363233416221669
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9082363233416221664}
m_CullTransparentMesh: 0
--- !u!114 &9082363233416221668
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9082363233416221664}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 39df46c82d839684ba4b9df37e01feec, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &9082363233416221671
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9082363233416221664}
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: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, 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
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &9082363233416221670
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9082363233416221664}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.7058824, g: 0.7058824, b: 0.7058824, a: 1}
m_PressedColor: {r: 0.43137255, g: 0.43137255, b: 0.43137255, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 9082363233416221671}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!114 &9082363233416221674
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9082363233416221664}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Delegates:
- eventID: 0
callback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 9082363233416221668}
m_MethodName: OnPointerEnter
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- eventID: 1
callback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 9082363233416221668}
m_MethodName: OnPointerExit
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &1447884624026788190
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9082363233416221664}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 86710e43de46f6f4bac7c8e50813a599, type: 3}
m_Name:
m_EditorClassIdentifier:
m_AspectMode: 3