Skip to content
This repository has been archived by the owner on Dec 28, 2019. It is now read-only.

Commit

Permalink
Merge branch 'FixesbyPablo'
Browse files Browse the repository at this point in the history
  • Loading branch information
pklaschka committed May 25, 2017
2 parents d042dc7 + 13edadc commit 2d3cfcc
Show file tree
Hide file tree
Showing 10 changed files with 269 additions and 54 deletions.
21 changes: 21 additions & 0 deletions Platformer_001/Assets/GameOverErgebnis.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameOverErgebnis : MonoBehaviour {
public string aktuellesErgebnisPrefix = "Ihr Ergebnis:";
public string rekordErgebnisPrefix = "Ihr Rekord:";

private UnityEngine.UI.Text text;

void Start () {
text = GetComponent<UnityEngine.UI.Text> ();

string aktuell = PlayerPrefs.GetInt ("Endlosweite", 0) + "";
string rekord = PlayerPrefs.GetInt ("maxEndlosweite", 0) + "";

text.text = aktuellesErgebnisPrefix + " " + aktuell
+ "\n\r"
+ rekordErgebnisPrefix + " " + rekord;
}
}
12 changes: 12 additions & 0 deletions Platformer_001/Assets/GameOverErgebnis.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 108 additions & 5 deletions Platformer_001/Assets/Scenes (Level)/Endlosmodus.unity
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1897418663}
- {fileID: 838855298}
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -393,6 +394,95 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &838855297
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 838855298}
- component: {fileID: 838855300}
- component: {fileID: 838855299}
- component: {fileID: 838855301}
m_Layer: 5
m_Name: txtHighscore
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &838855298
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 838855297}
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: 272774632}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -24, y: -24}
m_SizeDelta: {x: -424, y: 32}
m_Pivot: {x: 1, y: 1}
--- !u!114 &838855299
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 838855297}
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: 1, g: 1, b: 1, 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: 12800000, guid: 661149363372f864f88f4656e047ae39, type: 3}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 1
m_MinSize: 10
m_MaxSize: 88
m_Alignment: 2
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 321
--- !u!222 &838855300
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 838855297}
--- !u!114 &838855301
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 838855297}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -900027084, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EffectColor: {r: 0, g: 0, b: 0, a: 1}
m_EffectDistance: {x: 2, y: 4}
m_UseGraphicAlpha: 1
--- !u!1001 &1017923747
Prefab:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -469,7 +559,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 4521087835583362, guid: 1b2499aef91c52844b533d1587e0fa93, type: 2}
propertyPath: m_RootOrder
value: 2
value: 4
objectReference: {fileID: 0}
- target: {fileID: 114734891911855100, guid: 1b2499aef91c52844b533d1587e0fa93,
type: 2}
Expand All @@ -496,6 +586,19 @@ Prefab:
propertyPath: schadenEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 4707568882645560, guid: 1b2499aef91c52844b533d1587e0fa93, type: 2}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4255438440512340, guid: 1b2499aef91c52844b533d1587e0fa93, type: 2}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 114194264613072214, guid: 1b2499aef91c52844b533d1587e0fa93,
type: 2}
propertyPath: liveAnzeige
value:
objectReference: {fileID: 838855299}
m_RemovedComponents:
- {fileID: 212122532486929758, guid: 1b2499aef91c52844b533d1587e0fa93, type: 2}
m_ParentPrefab: {fileID: 100100000, guid: 1b2499aef91c52844b533d1587e0fa93, type: 2}
Expand Down Expand Up @@ -684,12 +787,12 @@ Prefab:
- target: {fileID: 224827634028832918, guid: 16d9d4c47b9a281409a2ec2745214479,
type: 2}
propertyPath: m_AnchoredPosition.x
value: 68
value: 24
objectReference: {fileID: 0}
- target: {fileID: 224827634028832918, guid: 16d9d4c47b9a281409a2ec2745214479,
type: 2}
propertyPath: m_AnchoredPosition.y
value: -60
value: -24
objectReference: {fileID: 0}
- target: {fileID: 224827634028832918, guid: 16d9d4c47b9a281409a2ec2745214479,
type: 2}
Expand Down Expand Up @@ -724,12 +827,12 @@ Prefab:
- target: {fileID: 224827634028832918, guid: 16d9d4c47b9a281409a2ec2745214479,
type: 2}
propertyPath: m_Pivot.x
value: 0.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224827634028832918, guid: 16d9d4c47b9a281409a2ec2745214479,
type: 2}
propertyPath: m_Pivot.y
value: 0.5
value: 1
objectReference: {fileID: 0}
- target: {fileID: 114102300147083456, guid: 16d9d4c47b9a281409a2ec2745214479,
type: 2}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 20}
m_SizeDelta: {x: 100, y: 10}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &510551332
MonoBehaviour:
Expand All @@ -312,7 +312,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: 20
m_PreferredHeight: 10
m_FlexibleWidth: -1
m_FlexibleHeight: -1
--- !u!1 &697996902
Expand Down Expand Up @@ -757,12 +757,12 @@ Prefab:
- target: {fileID: 224352877973549818, guid: aaae8a054b8124035b794a6422a65bf4,
type: 2}
propertyPath: m_RootOrder
value: 2
value: 3
objectReference: {fileID: 0}
- target: {fileID: 224352877973549818, guid: aaae8a054b8124035b794a6422a65bf4,
type: 2}
propertyPath: m_AnchoredPosition.x
value: 203.69339
value: 175.12846
objectReference: {fileID: 0}
- target: {fileID: 224352877973549818, guid: aaae8a054b8124035b794a6422a65bf4,
type: 2}
Expand Down Expand Up @@ -899,6 +899,96 @@ MonoBehaviour:
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!1 &1265941936
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1265941937}
- component: {fileID: 1265941939}
- component: {fileID: 1265941938}
- component: {fileID: 1265941940}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1265941937
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1265941936}
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: 1519652592}
m_RootOrder: 1
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: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1265941938
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1265941936}
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: 1, g: 1, b: 1, 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: 12800000, guid: 661149363372f864f88f4656e047ae39, type: 3}
m_FontSize: 8
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
m_MaxSize: 40
m_Alignment: 1
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 2
m_Text: 'Ihr Ergebnis: 256
Ihr Rekord: 1280'
--- !u!222 &1265941939
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1265941936}
--- !u!114 &1265941940
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1265941936}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7322120ce567245d990627ca084d3edc, type: 3}
m_Name:
m_EditorClassIdentifier:
aktuellesErgebnisPrefix: 'Ihr Ergebnis:'
rekordErgebnisPrefix: 'Ihr Rekord:'
--- !u!1 &1315451871
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1031,6 +1121,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 510551331}
- {fileID: 1265941937}
- {fileID: 1646739534}
- {fileID: 920757851}
m_Father: {fileID: 697996906}
Expand Down Expand Up @@ -1226,12 +1317,12 @@ Prefab:
- target: {fileID: 224352877973549818, guid: aaae8a054b8124035b794a6422a65bf4,
type: 2}
propertyPath: m_RootOrder
value: 1
value: 2
objectReference: {fileID: 0}
- target: {fileID: 224352877973549818, guid: aaae8a054b8124035b794a6422a65bf4,
type: 2}
propertyPath: m_AnchoredPosition.x
value: 203.69339
value: 175.12846
objectReference: {fileID: 0}
- target: {fileID: 224352877973549818, guid: aaae8a054b8124035b794a6422a65bf4,
type: 2}
Expand Down
18 changes: 15 additions & 3 deletions Platformer_001/Assets/Scripts/Endlosmodus/Highscore.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Highscore : MonoBehaviour {
public Text liveAnzeige;

// Use this for initialization
void Start (){
Expand All @@ -14,11 +16,21 @@ void Update () {
}

public void saveLength(int length) {
if (length > PlayerPrefs.GetInt("maxEndlosweite")) {
if (liveAnzeige != null) {
liveAnzeige.text = "" + length;
}

if (length > PlayerPrefs.GetInt("maxEndlosweite", 0)) {
PlayerPrefs.SetInt ("maxEndlosweite", length);
PlayerPrefs.SetString("maxEndlosweiteConfirmation", getHashed(length));
}
PlayerPrefs.SetInt ("Endlosweite", length);
print ("Score:" + PlayerPrefs.GetInt ("Endlosweite"));
print ("Highscore:" + PlayerPrefs.GetInt ("maxEndlosweite"));
print ("Score:" + PlayerPrefs.GetInt ("Endlosweite", 0));
print ("Highscore:" + PlayerPrefs.GetInt ("maxEndlosweite", 0));
}

private string getHashed(int length) {
// TODO: Echten Hash erzeugen
return "confirming" + length;
}
}
Loading

0 comments on commit 2d3cfcc

Please sign in to comment.