Commit 0f489dcf authored by Isa's avatar Isa

Levelauswahl Versuch

parent f7e4d291
This diff is collapsed.
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2108024439
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2108024440}
- component: {fileID: 2108024442}
- component: {fileID: 2108024441}
m_Layer: 0
m_Name: Options
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &2108024440
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2108024439}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 3.22, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 395035932932740992}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &2108024442
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2108024439}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10100, guid: 0000000000000000e000000000000000, 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: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!102 &2108024441
TextMesh:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2108024439}
m_Text: 'E - Speichern
T - Teleport'
m_OffsetZ: 0
m_CharacterSize: 0.46
m_LineSpacing: 1
m_Anchor: 7
m_Alignment: 1
m_TabSize: 4
m_FontSize: 0
m_FontStyle: 0
m_RichText: 1
m_Font: {fileID: 0}
m_Color:
serializedVersion: 2
rgba: 4294967295
--- !u!1 &395035932932740994
GameObject:
m_ObjectHideFlags: 0
......@@ -122,8 +29,7 @@ Transform:
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: 2108024440}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......
This diff is collapsed.
......@@ -24,5 +24,10 @@ namespace PlayerSpawnPointScript
SavePointData savePosition = SaveSystem.LoadSavePoint();
transform.position = new Vector3(savePosition.position[0], savePosition.position[1], 0);
}
public void SetPlayerToSafePoint(Vector3 SafePoint)
{
transform.position = SafePoint;
}
}
}
......@@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using LevelauswahlScript;
using PlayerSpawnPointScript;
public class SavePoint : MonoBehaviour
{
......@@ -45,4 +46,10 @@ public class SavePoint : MonoBehaviour
{
isUsed = var;
}
public void LoadSafePoint()
{
SaveSystem.SavePointUpdate(this);
PlayerSpawnPoint.psp.SetPlayerToSafePoint(gameObject.transform.position);
}
}
......@@ -24,7 +24,6 @@ public class SavePointData
Debug.Log(e);
savePointIsActiv = null;
}
}
public SavePointData(Vector2 save)
......
......@@ -13,6 +13,7 @@ namespace SavePointListScript
{
spl = this;
savePointList = GameObject.FindGameObjectsWithTag("Respawn");
Debug.Log(savePointList.Length);
}
public bool[] GetIsActivList()
......@@ -20,6 +21,7 @@ namespace SavePointListScript
if (savePointList.Length > 0)
{
bool[] savePointIsActiv = new bool[savePointList.Length];
Debug.Log(savePointIsActiv.Length);
int i = 0;
foreach (GameObject var in savePointList)
{
......@@ -34,8 +36,10 @@ namespace SavePointListScript
public void SetIsActivList(bool[] savePointIsActiv)
{
int i = 0;
Debug.Log(savePointIsActiv.Length);
foreach (GameObject var in savePointList)
{
Debug.Log(var);
SavePoint temp = savePointList[i].GetComponent<SavePoint>();
temp.SetIsUsed(savePointIsActiv[i]);
i++;
......
......@@ -12,6 +12,8 @@ namespace LevelauswahlScript
public GameObject Auswahl;
private EventSystem _myEventSystem;
public Button firstSelect;
private SavePoint[] savePoints;
// Start is called before the first frame update
void Start()
{
......
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