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

Commit

Permalink
Weitere Testfunktionen
Browse files Browse the repository at this point in the history
  • Loading branch information
pklaschka committed May 28, 2017
1 parent fb4f030 commit 4084daf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -917,12 +917,12 @@ Prefab:
- target: {fileID: 224902029835350780, guid: f6748a010e46d4334a2b9717aa34b24d,
type: 2}
propertyPath: m_AnchoredPosition.x
value: 176.39148
value: 159.47446
objectReference: {fileID: 0}
- target: {fileID: 224902029835350780, guid: f6748a010e46d4334a2b9717aa34b24d,
type: 2}
propertyPath: m_AnchoredPosition.y
value: -161.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224902029835350780, guid: f6748a010e46d4334a2b9717aa34b24d,
type: 2}
Expand Down Expand Up @@ -1125,13 +1125,13 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 971447814}
m_MethodName: Submit
m_Mode: 5
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument: Pablo
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Expand Down Expand Up @@ -1181,7 +1181,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
scoreList: {fileID: 0}
ownScore: {fileID: 0}
ownScore: {fileID: 104631839}
nameInput: {fileID: 704186048}
--- !u!1 &1091293677
GameObject:
m_ObjectHideFlags: 0
Expand Down
15 changes: 13 additions & 2 deletions Platformer_001/Assets/Scripts/Bestenliste/Bestenliste.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Runtime.InteropServices.ComTypes;
using UnityEngine;
using UnityEngine.UI;
Expand All @@ -8,6 +9,7 @@ public class Bestenliste : MonoBehaviour

public VerticalLayoutGroup scoreList;
public Text ownScore;
public InputField nameInput;

private int score;
private string scoreConfirmation;
Expand All @@ -16,11 +18,20 @@ private void Start()
{
score = PlayerPrefs.GetInt("maxEndlosweite", 0);
scoreConfirmation = PlayerPrefs.GetString("maxEndlosweiteConfirmation", "");

ownScore.text = "Ihr Ergebnis:\n" +
score + " (#" + GetPlace() + ")";
}

public void Submit(string playerName)
public void Submit()
{
// TODO: Implement submitting score
print("Submitting score: " + score + " (" + playerName + ")");
print("Submitting score: " + score + " (" + nameInput.text + ")");
}

private int GetPlace()
{
// TODO: Implementation of Rank
return Math.Max(score * -1 + 2000, 1);
}
}

0 comments on commit 4084daf

Please sign in to comment.