-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
134 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Unity.Burst; | ||
using Unity.Collections; | ||
using Unity.Entities; | ||
|
||
public class GameOver : ComponentSystem | ||
{ | ||
protected override void OnUpdate() | ||
{ | ||
var gameOver = false; | ||
var score = 0; | ||
Entities.ForEach((ref GameStatus gs) => | ||
{ | ||
gameOver = gs.gameOver; | ||
score = gs.score; | ||
}); | ||
if (gameOver) | ||
{ | ||
Entities.ForEach((ref Digit d) => | ||
{ | ||
d.isActive = true; | ||
switch (d.row) | ||
{ | ||
case 1: | ||
var s1 = " your score was: "; | ||
d.shownValue = s1[d.charIndex]; | ||
break; | ||
case 2: | ||
var s2 = " "; | ||
if (score <= 9) | ||
s2 += ' '; | ||
if (score <= 99) | ||
s2 += ' '; | ||
s2 += score.ToString(); | ||
s2 += " "; | ||
d.shownValue = s2[d.charIndex]; | ||
break; | ||
case 3: | ||
var s3 = "congratulations!"; | ||
d.shownValue = s3[d.charIndex]; | ||
break; | ||
} | ||
}); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Unity.Entities; | ||
using Unity.Mathematics; | ||
|
||
[GenerateAuthoringComponent] | ||
public struct PlayerPosition : IComponentData | ||
{ | ||
public float3 pos; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters