Commit 6ff0739e authored by Michael But's avatar Michael But
Browse files

Scene übergreifender Startpoint verbunden mit Menü und "MainLevel Michi"

parent 5b26c471
fileFormatVersion: 2
guid: 7e01962f987334e4fb04e2687bb24485
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: 0916ffc5184f394459b34094edef0965, type: 3}
m_Name: Level1StartPoint
m_EditorClassIdentifier:
startPoint: {fileID: 6649025744541164928, guid: 612c05bc8661c2146947c42effb20f77,
type: 3}
fileFormatVersion: 2
guid: 54e03e86b8009b54f8d532f93b1f4339
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6649025744541164929
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6649025744541164928}
- component: {fileID: 6649025744541164935}
m_Layer: 0
m_Name: StartPoint
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6649025744541164928
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6649025744541164929}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -4.3, y: 0.11, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &6649025744541164935
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6649025744541164929}
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: 0
m_Sprite: {fileID: 21300000, guid: ecc204495234d40f091d828790c56287, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 2.875, y: 1.75}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
fileFormatVersion: 2
guid: 612c05bc8661c2146947c42effb20f77
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -166,85 +166,6 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &144892778
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 144892779}
- component: {fileID: 144892780}
m_Layer: 0
m_Name: StartPoint
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &144892779
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 144892778}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -4.3, y: 0.11, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 17
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &144892780
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 144892778}
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: 0
m_Sprite: {fileID: 21300000, guid: ecc204495234d40f091d828790c56287, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 2.875, y: 1.75}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &171962107
GameObject:
m_ObjectHideFlags: 0
......@@ -4681,6 +4602,11 @@ PrefabInstance:
propertyPath: m_Name
value: SavePoint
objectReference: {fileID: 0}
- target: {fileID: 395035932932740994, guid: 3ff4cf871f5edaa40b0530c80a9ff9df,
type: 3}
propertyPath: m_TagString
value: Respawn
objectReference: {fileID: 0}
- target: {fileID: 395035932932740992, guid: 3ff4cf871f5edaa40b0530c80a9ff9df,
type: 3}
propertyPath: m_LocalPosition.x
......@@ -5481,3 +5407,72 @@ EdgeCollider2D:
- {x: 38.2959, y: 5.64964}
- {x: 37.92376, y: 5.65967}
- {x: 37.54831, y: 5.67009}
--- !u!1001 &6649025744669198059
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 6649025744541164929, guid: 612c05bc8661c2146947c42effb20f77,
type: 3}
propertyPath: m_Name
value: StartPoint
objectReference: {fileID: 0}
- target: {fileID: 6649025744541164928, guid: 612c05bc8661c2146947c42effb20f77,
type: 3}
propertyPath: m_LocalPosition.x
value: -4.3
objectReference: {fileID: 0}
- target: {fileID: 6649025744541164928, guid: 612c05bc8661c2146947c42effb20f77,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.11
objectReference: {fileID: 0}
- target: {fileID: 6649025744541164928, guid: 612c05bc8661c2146947c42effb20f77,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6649025744541164928, guid: 612c05bc8661c2146947c42effb20f77,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6649025744541164928, guid: 612c05bc8661c2146947c42effb20f77,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6649025744541164928, guid: 612c05bc8661c2146947c42effb20f77,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6649025744541164928, guid: 612c05bc8661c2146947c42effb20f77,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6649025744541164928, guid: 612c05bc8661c2146947c42effb20f77,
type: 3}
propertyPath: m_RootOrder
value: 17
objectReference: {fileID: 0}
- target: {fileID: 6649025744541164928, guid: 612c05bc8661c2146947c42effb20f77,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6649025744541164928, guid: 612c05bc8661c2146947c42effb20f77,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6649025744541164928, guid: 612c05bc8661c2146947c42effb20f77,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 612c05bc8661c2146947c42effb20f77, type: 3}
......@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.12731725, g: 0.13414745, b: 0.12107873, a: 1}
m_IndirectSpecularColor: {r: 0.12731715, g: 0.13414736, b: 0.12107852, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
......@@ -225,6 +225,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a2c466d9a2ecbb34083c557281adfa83, type: 3}
m_Name:
m_EditorClassIdentifier:
startPointObject: {fileID: 11400000, guid: 54e03e86b8009b54f8d532f93b1f4339, type: 2}
--- !u!1 &153273652
GameObject:
m_ObjectHideFlags: 0
......@@ -564,7 +565,18 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 711920177}
m_OnClick:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 67646354}
m_MethodName: LoadGame
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
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &711920177
......
......@@ -19,18 +19,18 @@ namespace PlayerSpawnPointScript
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.N))
{
SaveSystem.NewGame();
}
//void Update()
//{
// if (Input.GetKeyDown(KeyCode.N))
// {
// SaveSystem.NewGame();
// }
if (Input.GetKeyDown(KeyCode.O))
{
SetPlayerPosition();
}
}
// if (Input.GetKeyDown(KeyCode.O))
// {
// SetPlayerPosition();
// }
//}
private void SetPlayerPosition()
{
......
......@@ -8,6 +8,8 @@ using PlayerSpawnPointScript;
public class SaveSystem
{
public static void SavePointUpdate(SavePoint save)
{
BinaryFormatter formatter = new BinaryFormatter();
......@@ -40,7 +42,7 @@ public class SaveSystem
}
}
public static void NewGame()
public static void NewGame(Vector3 vec)
{
BinaryFormatter formatter = new BinaryFormatter();
......@@ -49,7 +51,8 @@ public class SaveSystem
SavePointData data;
try
{
data = new SavePointData(new Vector2(PlayerSpawnPointScript.PlayerSpawnPoint.startPoint.transform.position.x, PlayerSpawnPointScript.PlayerSpawnPoint.startPoint.transform.position.y));
data = new SavePointData(new Vector2(vec.x, vec.y));
//data = new SavePointData(new Vector2(PlayerSpawnPointScript.PlayerSpawnPoint.startPoint.transform.position.x, PlayerSpawnPointScript.PlayerSpawnPoint.startPoint.transform.position.y));
//SavePointData data = new SavePointData(new Vector2(GameObject.Find("StartPoint").transform.position.x, GameObject.Find("StartPoint").transform.position.y));
}
catch (Exception e)
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(menuName = "startObject")]
public class StartPointObject : ScriptableObject
{
public Transform startPoint;
}
fileFormatVersion: 2
guid: 0916ffc5184f394459b34094edef0965
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
......@@ -9,11 +9,14 @@ using UnityEngine.SceneManagement;
public class MainMenu : MonoBehaviour
{
public StartPointObject startPointObject;
private EventSystem _myEventSystem;
private GameObject _backScreen, _currentScreen;
private Button _selectedBtn;
private GameObject _old, _new;
void Start()
{
_myEventSystem = EventSystem.current;
......@@ -42,12 +45,22 @@ public class MainMenu : MonoBehaviour
public void NewGame()
{
//SaveSystem.NewGame();
//Debug.Log(GameObject.Find("StartPoint").transform.position.x);
SceneManager.LoadScene("MainLevel Michi");
SaveSystem.NewGame(startPointObject.startPoint.position);
//SaveSystem.NewGame();
//SceneManager.LoadScene("MainLevel");
}
public void LoadGame()
{
SceneManager.LoadScene("MainLevel Michi");
}
public void SwitchToMouse()
{
_myEventSystem.GetComponent<UnityEngine.EventSystems.EventSystem>().SetSelectedGameObject(null);
......
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