Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/AdronTech/GGJ_2017
Browse files Browse the repository at this point in the history
  • Loading branch information
LEM-II\Ilja committed Jan 22, 2017
2 parents e55e216 + 57b1b68 commit a12b0e0
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 5 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);
}
}
}

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

0 comments on commit a12b0e0

Please sign in to comment.