Skip to content

Commit

Permalink
GameOver Screen starting
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMejmun committed Jan 22, 2017
1 parent 32c2ac7 commit 4cdbf1b
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 14 deletions.
Binary file added GGJ17/Assets/Models/Materials/modelFlag.mat
Binary file not shown.
8 changes: 8 additions & 0 deletions GGJ17/Assets/Models/Materials/modelFlag.mat.meta

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

Binary file modified GGJ17/Assets/Prefab/BuildingBlocks/Building_Flag.prefab
Binary file not shown.
Binary file modified GGJ17/Assets/Scene/GameOver.unity
Binary file not shown.
Binary file modified GGJ17/Assets/Scene/MainScene.unity
Binary file not shown.
5 changes: 4 additions & 1 deletion GGJ17/Assets/Script/Blocks/Building/Building_Flag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ void Awake () {
Init(bbi);
}

private void OnDestroy()
{
SceneManager.LoadScene(nextSceneName, LoadSceneMode.Single);
}

public new void DestroyBuilding()
{
// Todo GameOver
Destroy(gameObject);
SceneManager.LoadScene(nextSceneName, LoadSceneMode.Single);
}
}
9 changes: 7 additions & 2 deletions GGJ17/Assets/Script/GameOverScreen/gameOverInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,25 @@ public class gameOverInput : MonoBehaviour

public float waitBeforeInputSec;
public string nextSceneName;
private float sceneStartTime;

// Use this for initialization
void Start()
{
sceneStartTime = Time.time;
}

void Awake()
{
sceneStartTime = Time.time;
}

// Update is called once per frame
void Update()
{
if (Time.time >= waitBeforeInputSec && Input.anyKeyDown)
if (Time.time - sceneStartTime >= waitBeforeInputSec && Input.anyKeyDown)
{
SceneManager.LoadScene(nextSceneName, LoadSceneMode.Single);
}
}
}

9 changes: 7 additions & 2 deletions GGJ17/Assets/Script/TitleScreen/titleInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,25 @@ public class titleInput : MonoBehaviour

public float waitBeforeInputSec;
public string nextSceneName;
private float sceneStartTime;

// Use this for initialization
void Start()
{
sceneStartTime = Time.time;
}

void Awake()
{
sceneStartTime = Time.time;
}

// Update is called once per frame
void Update()
{
if (Time.time >= waitBeforeInputSec && Input.anyKeyDown)
if (Time.time - sceneStartTime >= waitBeforeInputSec && Input.anyKeyDown)
{
SceneManager.LoadScene(nextSceneName, LoadSceneMode.Single);
}
}
}

9 changes: 0 additions & 9 deletions GGJ17/Assets/Script/WorldControl.meta

This file was deleted.

Binary file modified GGJ17/ProjectSettings/EditorBuildSettings.asset
Binary file not shown.

0 comments on commit 4cdbf1b

Please sign in to comment.