Subversion Repository Public Repository

Nextrek

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using UnityEngine;
using System.Collections;

public class GlobalObject : MonoBehaviour 
{
	public static GlobalObject Instance;
	public int nowLevel;
	public int shipType;
	public bool showMap = false;
	private bool pressEnter = false;
	void Awake()
	{
		Instance = this;
		nowLevel = PlayerPrefs.GetInt("PlayerFinishedLevel",0);
	}
	void Start()
	{
		DontDestroyOnLoad(gameObject);
	}
	public void WinThisLevel(bool win)
	{
		GlobalObject.Instance.showMap = true;
		if(win)
		{
			nowLevel++;
			PlayerPrefs.SetInt("PlayerFinishedLevel",nowLevel);
			if(StartGameUI.currentLanguage == 0)
			MessageWindow.Instance.NewMessage("You have finished this level,press 'Enter' to continue");
			if(StartGameUI.currentLanguage == 1)
			MessageWindow.Instance.NewMessage("Livello completato, spingi 'Enter' per continuare");
		}
		else
		{
			if(StartGameUI.currentLanguage == 0)
			MessageWindow.Instance.NewMessage("You lose,press 'Enter' to continue;");
			if(StartGameUI.currentLanguage == 1)
			MessageWindow.Instance.NewMessage("Hai perso,spingi 'Enter' per continuare;");
		}
		pressEnter = true;
	}
	void Update()
	{
		if(pressEnter&&Input.GetKeyDown(KeyCode.Return))
		{
			pressEnter = false;
			Application.LoadLevelAsync("SpaceMap");
		}
	}

}

Commits for Nextrek/3DSpace/Assets/Custum/Scripts/GlobalObject.cs

Diff revisions: vs.
Revision Author Commited Message
160 Diff Diff LMancini picture LMancini Fri 20 Feb, 2015 15:04:04 +0000
112 Diff Diff FMMortaroli picture FMMortaroli Thu 09 Oct, 2014 14:21:59 +0000
107 FMMortaroli picture FMMortaroli Thu 09 Oct, 2014 11:56:46 +0000