├── Library
├── BuildPlayer.prefs
├── AssetImportState
├── FailedAssetImports.txt
├── ScriptAssemblies
│ ├── CompilationCompleted.txt
│ ├── Assembly-CSharp.dll
│ └── Assembly-CSharp.dll.mdb
├── guidmapper
├── ScriptMapper
├── assetDatabase3
├── expandedItems
├── AnnotationManager
├── MonoManager.asset
├── AssetServerCacheV3
├── AssetVersioning.db
├── BuildSettings.asset
├── ProjectSettings.asset
├── EditorUserSettings.asset
├── EditorUserBuildSettings.asset
├── InspectorExpandedItems.asset
└── metadata
│ ├── 21
│ └── 2147ec38f5687144791d865030719971
│ ├── 25
│ └── 25a2ed12987b6ed45aa612e1575ac71c
│ ├── 26
│ ├── 2601e1d2377154e469efd65400756e3a
│ └── 264b8572d18b5ca4694d4d99b8790648
│ ├── 30
│ └── 30a7850097c69b7428293eb982a1e3c2
│ ├── 36
│ └── 36c7109bb313b34429c5f7ec2ba1b103
│ ├── 47
│ └── 47b75bd20db3acd4f92ed626a59038ee
│ ├── 56
│ └── 56d46be3a3c52b947b08504079361da8
│ ├── 57
│ └── 57f517725180d8b4c9d8f178df9b0e53
│ ├── 70
│ └── 7045aadf6e0978e4db97130cd841cc66
│ ├── 74
│ └── 74504f8da1e7ad1459f9c2671da70a25
│ ├── 77
│ └── 77f3788057226d3449d65461898b714c
│ ├── 81
│ └── 81d54a95619c60b459579ff990a95a97
│ ├── 82
│ └── 8286e4ca0f110b748b5c3a7117de6f03
│ ├── 84
│ └── 84e7bff2ac9f6b148a074a080167f695
│ ├── 00
│ ├── 00000000000000001000000000000000
│ ├── 00000000000000002000000000000000
│ ├── 00000000000000003000000000000000
│ ├── 00000000000000004000000000000000
│ ├── 00000000000000004100000000000000
│ ├── 00000000000000005000000000000000
│ ├── 00000000000000006000000000000000
│ ├── 00000000000000007000000000000000
│ ├── 00000000000000008000000000000000
│ ├── 00000000000000009000000000000000
│ ├── 0000000000000000a000000000000000
│ ├── 0000000000000000b000000000000000
│ └── 0000000000000000c000000000000000
│ ├── 09
│ └── 09315f6cf26faac41ab22dce3851d0a0
│ ├── 0e
│ └── 0ef7f8373b05f85488cb14de21176809
│ ├── 1e
│ └── 1e8b773017c9dac42967563d1f8af363
│ ├── 3a
│ └── 3a75c578d8690e24f9588b70bdfc3c90
│ ├── 3b
│ └── 3b5e082e589c7aa4299e8008d495739c
│ ├── 3f
│ └── 3fa1243ee76b478459b0a7636acf8ee9
│ ├── 5f
│ └── 5fbb09e31cc0cad48ae6dfad6bcac274
│ ├── 6c
│ └── 6c16d832035f5cf449ecf318ee7a517b
│ ├── a9
│ └── a9aee8724bfb93b40b20c4cbe05fb7eb
│ ├── af
│ └── afa002d1f33588349bab25fef864f4e1
│ ├── b0
│ └── b0abaa1e02430eb4584aef8a7ff04971
│ ├── b3
│ └── b32b098f7d349a943a65543359efaa06
│ ├── b9
│ └── b98bd18ab4be6104b87f2507f69f35b5
│ ├── ba
│ └── bac3f99e55e92704e8b560316e9000ad
│ ├── c5
│ └── c58dea4fb06d25249974048a12184d1a
│ ├── d1
│ └── d1a6a5c70c37ccc4abebaf14de1d5ccb
│ ├── d5
│ └── d55aaa2624c82dd409172fabe7a87ebc
│ ├── eb
│ └── eb8ce08b812ad6a4a9ac62828caa52fe
│ └── ee
│ └── ee3104df33533b14caf2f6098fbe5a20
├── tetris.v11.suo
├── Assembly-CSharp.pidb
├── Assets
├── SFX
│ ├── move.wav
│ ├── explosion.wav
│ ├── explosion2.wav
│ └── explosion3.wav
├── Fonts
│ └── YEWBB.ttf
├── Scenes
│ ├── Match.unity
│ ├── GameOver.unity
│ └── MainMenu.unity
├── Textures
│ ├── jgrey.png
│ ├── icon128.png
│ ├── lawa800.png
│ └── tetris-title.png
├── Materials
│ ├── 4Lines.mat
│ ├── GameField.mat
│ ├── InGameHUD.mat
│ ├── TetrimoPart.mat
│ └── Lavabackground.mat
├── Prefabs
│ ├── TetrimoPrefab.prefab
│ ├── TetrimoPartPrefab.prefab
│ ├── FourLinesLabelPrefab.prefab
│ └── TetrimoExplosionPrefab.prefab
└── Scripts
│ ├── FourLinesLabel.cs
│ ├── HighScore.cs
│ ├── MatchCamera.cs
│ ├── GameOverCamera.cs
│ ├── MainMenuCamera.cs
│ └── Tetrimo.cs
├── tetris-csharp.v11.suo
├── ProjectSettings
├── TagManager.asset
├── TimeManager.asset
├── AudioManager.asset
├── InputManager.asset
├── NavMeshLayers.asset
├── DynamicsManager.asset
├── EditorSettings.asset
├── NetworkManager.asset
├── ProjectSettings.asset
├── QualitySettings.asset
└── EditorBuildSettings.asset
├── .gitignore
├── tetris.userprefs
├── LICENSE.md
├── README.md
├── tetris.sln
├── tetris-csharp.sln
├── Assembly-CSharp-vs.csproj
└── Assembly-CSharp.csproj
/Library/BuildPlayer.prefs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Library/AssetImportState:
--------------------------------------------------------------------------------
1 | 6;0;-1
--------------------------------------------------------------------------------
/Library/FailedAssetImports.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Library/ScriptAssemblies/CompilationCompleted.txt:
--------------------------------------------------------------------------------
1 | Completed
2 |
--------------------------------------------------------------------------------
/tetris.v11.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/tetris.v11.suo
--------------------------------------------------------------------------------
/Library/guidmapper:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/guidmapper
--------------------------------------------------------------------------------
/Assembly-CSharp.pidb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assembly-CSharp.pidb
--------------------------------------------------------------------------------
/Assets/SFX/move.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/SFX/move.wav
--------------------------------------------------------------------------------
/Library/ScriptMapper:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/ScriptMapper
--------------------------------------------------------------------------------
/Assets/Fonts/YEWBB.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/Fonts/YEWBB.ttf
--------------------------------------------------------------------------------
/Library/assetDatabase3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/assetDatabase3
--------------------------------------------------------------------------------
/Library/expandedItems:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/expandedItems
--------------------------------------------------------------------------------
/tetris-csharp.v11.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/tetris-csharp.v11.suo
--------------------------------------------------------------------------------
/Assets/SFX/explosion.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/SFX/explosion.wav
--------------------------------------------------------------------------------
/Assets/SFX/explosion2.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/SFX/explosion2.wav
--------------------------------------------------------------------------------
/Assets/SFX/explosion3.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/SFX/explosion3.wav
--------------------------------------------------------------------------------
/Assets/Scenes/Match.unity:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/Scenes/Match.unity
--------------------------------------------------------------------------------
/Assets/Textures/jgrey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/Textures/jgrey.png
--------------------------------------------------------------------------------
/Library/AnnotationManager:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/AnnotationManager
--------------------------------------------------------------------------------
/Library/MonoManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/MonoManager.asset
--------------------------------------------------------------------------------
/Assets/Materials/4Lines.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/Materials/4Lines.mat
--------------------------------------------------------------------------------
/Assets/Scenes/GameOver.unity:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/Scenes/GameOver.unity
--------------------------------------------------------------------------------
/Assets/Scenes/MainMenu.unity:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/Scenes/MainMenu.unity
--------------------------------------------------------------------------------
/Assets/Textures/icon128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/Textures/icon128.png
--------------------------------------------------------------------------------
/Assets/Textures/lawa800.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/Textures/lawa800.png
--------------------------------------------------------------------------------
/Library/AssetServerCacheV3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/AssetServerCacheV3
--------------------------------------------------------------------------------
/Library/AssetVersioning.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/AssetVersioning.db
--------------------------------------------------------------------------------
/Library/BuildSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/BuildSettings.asset
--------------------------------------------------------------------------------
/Assets/Materials/GameField.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/Materials/GameField.mat
--------------------------------------------------------------------------------
/Assets/Materials/InGameHUD.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/Materials/InGameHUD.mat
--------------------------------------------------------------------------------
/Library/ProjectSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/ProjectSettings.asset
--------------------------------------------------------------------------------
/Assets/Materials/TetrimoPart.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/Materials/TetrimoPart.mat
--------------------------------------------------------------------------------
/Assets/Textures/tetris-title.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/Textures/tetris-title.png
--------------------------------------------------------------------------------
/Library/EditorUserSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/EditorUserSettings.asset
--------------------------------------------------------------------------------
/ProjectSettings/TagManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/ProjectSettings/TagManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/TimeManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/ProjectSettings/TimeManager.asset
--------------------------------------------------------------------------------
/Assets/Materials/Lavabackground.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/Materials/Lavabackground.mat
--------------------------------------------------------------------------------
/Assets/Prefabs/TetrimoPrefab.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/Prefabs/TetrimoPrefab.prefab
--------------------------------------------------------------------------------
/ProjectSettings/AudioManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/ProjectSettings/AudioManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/InputManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/ProjectSettings/InputManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/NavMeshLayers.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/ProjectSettings/NavMeshLayers.asset
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | Output/
2 | Output/*
3 | Output/**/*
4 |
5 | obj/
6 | obj/*
7 | obj/**/*
8 |
9 | Temp/
10 | Temp/*
11 | Temp/**/*
--------------------------------------------------------------------------------
/Library/EditorUserBuildSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/EditorUserBuildSettings.asset
--------------------------------------------------------------------------------
/Library/InspectorExpandedItems.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/InspectorExpandedItems.asset
--------------------------------------------------------------------------------
/ProjectSettings/DynamicsManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/ProjectSettings/DynamicsManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/EditorSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/ProjectSettings/EditorSettings.asset
--------------------------------------------------------------------------------
/ProjectSettings/NetworkManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/ProjectSettings/NetworkManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/ProjectSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/ProjectSettings/ProjectSettings.asset
--------------------------------------------------------------------------------
/ProjectSettings/QualitySettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/ProjectSettings/QualitySettings.asset
--------------------------------------------------------------------------------
/Assets/Prefabs/TetrimoPartPrefab.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/Prefabs/TetrimoPartPrefab.prefab
--------------------------------------------------------------------------------
/Assets/Prefabs/FourLinesLabelPrefab.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/Prefabs/FourLinesLabelPrefab.prefab
--------------------------------------------------------------------------------
/ProjectSettings/EditorBuildSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/ProjectSettings/EditorBuildSettings.asset
--------------------------------------------------------------------------------
/Assets/Prefabs/TetrimoExplosionPrefab.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Assets/Prefabs/TetrimoExplosionPrefab.prefab
--------------------------------------------------------------------------------
/Library/ScriptAssemblies/Assembly-CSharp.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/ScriptAssemblies/Assembly-CSharp.dll
--------------------------------------------------------------------------------
/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb
--------------------------------------------------------------------------------
/Library/metadata/00/00000000000000001000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/00/00000000000000001000000000000000
--------------------------------------------------------------------------------
/Library/metadata/00/00000000000000002000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/00/00000000000000002000000000000000
--------------------------------------------------------------------------------
/Library/metadata/00/00000000000000003000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/00/00000000000000003000000000000000
--------------------------------------------------------------------------------
/Library/metadata/00/00000000000000004000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/00/00000000000000004000000000000000
--------------------------------------------------------------------------------
/Library/metadata/00/00000000000000004100000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/00/00000000000000004100000000000000
--------------------------------------------------------------------------------
/Library/metadata/00/00000000000000005000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/00/00000000000000005000000000000000
--------------------------------------------------------------------------------
/Library/metadata/00/00000000000000006000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/00/00000000000000006000000000000000
--------------------------------------------------------------------------------
/Library/metadata/00/00000000000000007000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/00/00000000000000007000000000000000
--------------------------------------------------------------------------------
/Library/metadata/00/00000000000000008000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/00/00000000000000008000000000000000
--------------------------------------------------------------------------------
/Library/metadata/00/00000000000000009000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/00/00000000000000009000000000000000
--------------------------------------------------------------------------------
/Library/metadata/00/0000000000000000a000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/00/0000000000000000a000000000000000
--------------------------------------------------------------------------------
/Library/metadata/00/0000000000000000b000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/00/0000000000000000b000000000000000
--------------------------------------------------------------------------------
/Library/metadata/00/0000000000000000c000000000000000:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/00/0000000000000000c000000000000000
--------------------------------------------------------------------------------
/Library/metadata/09/09315f6cf26faac41ab22dce3851d0a0:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/09/09315f6cf26faac41ab22dce3851d0a0
--------------------------------------------------------------------------------
/Library/metadata/0e/0ef7f8373b05f85488cb14de21176809:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/0e/0ef7f8373b05f85488cb14de21176809
--------------------------------------------------------------------------------
/Library/metadata/1e/1e8b773017c9dac42967563d1f8af363:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/1e/1e8b773017c9dac42967563d1f8af363
--------------------------------------------------------------------------------
/Library/metadata/21/2147ec38f5687144791d865030719971:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/21/2147ec38f5687144791d865030719971
--------------------------------------------------------------------------------
/Library/metadata/25/25a2ed12987b6ed45aa612e1575ac71c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/25/25a2ed12987b6ed45aa612e1575ac71c
--------------------------------------------------------------------------------
/Library/metadata/26/2601e1d2377154e469efd65400756e3a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/26/2601e1d2377154e469efd65400756e3a
--------------------------------------------------------------------------------
/Library/metadata/26/264b8572d18b5ca4694d4d99b8790648:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/26/264b8572d18b5ca4694d4d99b8790648
--------------------------------------------------------------------------------
/Library/metadata/30/30a7850097c69b7428293eb982a1e3c2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/30/30a7850097c69b7428293eb982a1e3c2
--------------------------------------------------------------------------------
/Library/metadata/36/36c7109bb313b34429c5f7ec2ba1b103:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/36/36c7109bb313b34429c5f7ec2ba1b103
--------------------------------------------------------------------------------
/Library/metadata/3a/3a75c578d8690e24f9588b70bdfc3c90:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/3a/3a75c578d8690e24f9588b70bdfc3c90
--------------------------------------------------------------------------------
/Library/metadata/3b/3b5e082e589c7aa4299e8008d495739c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/3b/3b5e082e589c7aa4299e8008d495739c
--------------------------------------------------------------------------------
/Library/metadata/3f/3fa1243ee76b478459b0a7636acf8ee9:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/3f/3fa1243ee76b478459b0a7636acf8ee9
--------------------------------------------------------------------------------
/Library/metadata/47/47b75bd20db3acd4f92ed626a59038ee:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/47/47b75bd20db3acd4f92ed626a59038ee
--------------------------------------------------------------------------------
/Library/metadata/56/56d46be3a3c52b947b08504079361da8:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/56/56d46be3a3c52b947b08504079361da8
--------------------------------------------------------------------------------
/Library/metadata/57/57f517725180d8b4c9d8f178df9b0e53:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/57/57f517725180d8b4c9d8f178df9b0e53
--------------------------------------------------------------------------------
/Library/metadata/5f/5fbb09e31cc0cad48ae6dfad6bcac274:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/5f/5fbb09e31cc0cad48ae6dfad6bcac274
--------------------------------------------------------------------------------
/Library/metadata/6c/6c16d832035f5cf449ecf318ee7a517b:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/6c/6c16d832035f5cf449ecf318ee7a517b
--------------------------------------------------------------------------------
/Library/metadata/70/7045aadf6e0978e4db97130cd841cc66:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/70/7045aadf6e0978e4db97130cd841cc66
--------------------------------------------------------------------------------
/Library/metadata/74/74504f8da1e7ad1459f9c2671da70a25:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/74/74504f8da1e7ad1459f9c2671da70a25
--------------------------------------------------------------------------------
/Library/metadata/77/77f3788057226d3449d65461898b714c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/77/77f3788057226d3449d65461898b714c
--------------------------------------------------------------------------------
/Library/metadata/81/81d54a95619c60b459579ff990a95a97:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/81/81d54a95619c60b459579ff990a95a97
--------------------------------------------------------------------------------
/Library/metadata/82/8286e4ca0f110b748b5c3a7117de6f03:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/82/8286e4ca0f110b748b5c3a7117de6f03
--------------------------------------------------------------------------------
/Library/metadata/84/84e7bff2ac9f6b148a074a080167f695:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/84/84e7bff2ac9f6b148a074a080167f695
--------------------------------------------------------------------------------
/Library/metadata/a9/a9aee8724bfb93b40b20c4cbe05fb7eb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/a9/a9aee8724bfb93b40b20c4cbe05fb7eb
--------------------------------------------------------------------------------
/Library/metadata/af/afa002d1f33588349bab25fef864f4e1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/af/afa002d1f33588349bab25fef864f4e1
--------------------------------------------------------------------------------
/Library/metadata/b0/b0abaa1e02430eb4584aef8a7ff04971:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/b0/b0abaa1e02430eb4584aef8a7ff04971
--------------------------------------------------------------------------------
/Library/metadata/b3/b32b098f7d349a943a65543359efaa06:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/b3/b32b098f7d349a943a65543359efaa06
--------------------------------------------------------------------------------
/Library/metadata/b9/b98bd18ab4be6104b87f2507f69f35b5:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/b9/b98bd18ab4be6104b87f2507f69f35b5
--------------------------------------------------------------------------------
/Library/metadata/ba/bac3f99e55e92704e8b560316e9000ad:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/ba/bac3f99e55e92704e8b560316e9000ad
--------------------------------------------------------------------------------
/Library/metadata/c5/c58dea4fb06d25249974048a12184d1a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/c5/c58dea4fb06d25249974048a12184d1a
--------------------------------------------------------------------------------
/Library/metadata/d1/d1a6a5c70c37ccc4abebaf14de1d5ccb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/d1/d1a6a5c70c37ccc4abebaf14de1d5ccb
--------------------------------------------------------------------------------
/Library/metadata/d5/d55aaa2624c82dd409172fabe7a87ebc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/d5/d55aaa2624c82dd409172fabe7a87ebc
--------------------------------------------------------------------------------
/Library/metadata/eb/eb8ce08b812ad6a4a9ac62828caa52fe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/eb/eb8ce08b812ad6a4a9ac62828caa52fe
--------------------------------------------------------------------------------
/Library/metadata/ee/ee3104df33533b14caf2f6098fbe5a20:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DraphonyGames/tetris-unity/HEAD/Library/metadata/ee/ee3104df33533b14caf2f6098fbe5a20
--------------------------------------------------------------------------------
/tetris.userprefs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | tetris-unity
2 | ============
3 |
4 | Copyright (c) 2013 Draphony Games
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7 |
8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 |
10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 |
--------------------------------------------------------------------------------
/Assets/Scripts/FourLinesLabel.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System.Collections;
3 |
4 | public class FourLinesLabel : MonoBehaviour {
5 | public float LiftUpBy;
6 | public float LiftSpeed;
7 | public float FadeSpeed;
8 | /// Avoid creating a new font
9 | public Color FontColor;
10 |
11 | float Lifted;
12 |
13 | // Use this for initialization
14 | void Start () {
15 | Lifted = 0;
16 | renderer.material.color = FontColor;
17 | }
18 |
19 | // Update is called once per frame
20 | void Update () {
21 | if (Lifted < LiftUpBy) {
22 | float amtToMove = LiftSpeed * Time.deltaTime;
23 | float amtToFade = FadeSpeed * Time.deltaTime;
24 |
25 | transform.Translate(Vector3.up * amtToMove);
26 | this.renderer.material.color = new Color(this.renderer.material.color.r, this.renderer.material.color.g,
27 | this.renderer.material.color.b, Mathf.Max(this.renderer.material.color.a - amtToFade, 0.01f));
28 |
29 | Lifted += (Vector3.up * amtToMove).y;
30 | }
31 | else
32 | Destroy(gameObject);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Tetris Unity
2 | ============
3 | A Tetris clone created with Unity.
4 |
5 | You are welcome to fork this project and create your own version of a Tetris clone.
6 |
7 |
8 | License
9 | -------
10 |
11 | Copyright (c) 2013 [Draphony Games](http://www.draphony.de)
12 |
13 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18 |
--------------------------------------------------------------------------------
/tetris.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 11.00
2 | # Visual Studio 2008
3 |
4 | Project("{F76E5342-51C8-595A-9746-FDE225F9289B}") = "tetris", "Assembly-CSharp.csproj", "{4B1219B7-556C-71C6-14F5-4BD473BDE852}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {4B1219B7-556C-71C6-14F5-4BD473BDE852}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {4B1219B7-556C-71C6-14F5-4BD473BDE852}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {4B1219B7-556C-71C6-14F5-4BD473BDE852}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {4B1219B7-556C-71C6-14F5-4BD473BDE852}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | GlobalSection(MonoDevelopProperties) = preSolution
21 | StartupItem = Assembly-CSharp.csproj
22 | Policies = $0
23 | $0.TextStylePolicy = $1
24 | $1.inheritsSet = null
25 | $1.scope = text/x-csharp
26 | $0.CSharpFormattingPolicy = $2
27 | $2.inheritsSet = Mono
28 | $2.inheritsScope = text/x-csharp
29 | $2.scope = text/x-csharp
30 | $0.TextStylePolicy = $3
31 | $3.FileWidth = 120
32 | $3.TabWidth = 4
33 | $3.EolMarker = Unix
34 | $3.inheritsSet = Mono
35 | $3.inheritsScope = text/plain
36 | $3.scope = text/plain
37 | EndGlobalSection
38 |
39 | EndGlobal
40 |
--------------------------------------------------------------------------------
/tetris-csharp.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 11.00
2 | # Visual Studio 2008
3 |
4 | Project("{F76E5342-51C8-595A-9746-FDE225F9289B}") = "tetris", "Assembly-CSharp-vs.csproj", "{4B1219B7-556C-71C6-14F5-4BD473BDE852}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {4B1219B7-556C-71C6-14F5-4BD473BDE852}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {4B1219B7-556C-71C6-14F5-4BD473BDE852}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {4B1219B7-556C-71C6-14F5-4BD473BDE852}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {4B1219B7-556C-71C6-14F5-4BD473BDE852}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | GlobalSection(MonoDevelopProperties) = preSolution
21 | StartupItem = Assembly-CSharp.csproj
22 | Policies = $0
23 | $0.TextStylePolicy = $1
24 | $1.inheritsSet = null
25 | $1.scope = text/x-csharp
26 | $0.CSharpFormattingPolicy = $2
27 | $2.inheritsSet = Mono
28 | $2.inheritsScope = text/x-csharp
29 | $2.scope = text/x-csharp
30 | $0.TextStylePolicy = $3
31 | $3.FileWidth = 120
32 | $3.TabWidth = 4
33 | $3.EolMarker = Unix
34 | $3.inheritsSet = Mono
35 | $3.inheritsScope = text/plain
36 | $3.scope = text/plain
37 | EndGlobalSection
38 |
39 | EndGlobal
40 |
--------------------------------------------------------------------------------
/Assets/Scripts/HighScore.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | public static class HighScore {
8 | ///
9 | /// HighScore Array must be sorted! With the #0-element has the lowest value.
10 | ///
11 | static int[] Scores = new int[3] { 0, 0, 0};
12 |
13 | static HighScore() {
14 | for (int i = 0; i < Scores.Length; i++)
15 | Scores[i] = PlayerPrefs.GetInt("HighScore#" + i, 0);
16 | }
17 |
18 | static public int get(int i) {
19 | return Scores[i];
20 | }
21 |
22 | ///
23 | /// Try to add the newScore to the HighScore list.
24 | /// If successed, the new highscore is saved automatically.
25 | ///
26 | ///
27 | /// 'true' if newScore has been placed in the highscore list. Otherwise false.
28 | static public bool TryAddHighScore(int newScore) {
29 | int found = 0;
30 |
31 | for (int i = 0; i < Scores.Length; i++) {
32 | if (newScore >= Scores[i])
33 | found++;
34 | }
35 |
36 | int newValue = newScore,
37 | tmp;
38 | if(found == 0)
39 | return false;
40 | while (found > 0) {
41 | int index = (found - 1);
42 | tmp = Scores[index];
43 | Scores[index] = newValue;
44 | newValue = tmp;
45 | PlayerPrefs.SetInt("HighScore#" + index, Scores[index]);
46 | found--;
47 | }
48 | return true;
49 | }
50 | }
--------------------------------------------------------------------------------
/Assets/Scripts/MatchCamera.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System.Collections;
3 |
4 | public class MatchCamera : MonoBehaviour {
5 | static public int Scores = 0;
6 | static public int Level = 1;
7 |
8 | public const int ScoresForNextLevel = 100;
9 | /// Lines continuously created
10 | static public int Continuous = 0;
11 |
12 | #region Event Handler
13 | void Start() {
14 | NewGame();
15 | }
16 |
17 |
18 | void OnGUI() {
19 | // Use OnGUI rather than GUIObject inside the editor
20 | // http://docs.unity3d.com/Documentation/Components/class-GuiText.html
21 |
22 | // To have a complete dark scene. Go to Rendering Settings and turn "Ambient Light" to "black"
23 |
24 | GUIStyle textStyle = new GUIStyle();
25 | textStyle.normal.textColor = Color.white;
26 | textStyle.fontSize = 36;
27 |
28 | // Using Automatic Mode
29 | // http://docs.unity3d.com/Documentation/Components/gui-Layout.html
30 | GUILayout.BeginArea(new Rect(Screen.width / 2, Screen.height / 2, Screen.width/2, Screen.height / 2));
31 |
32 | GUILayout.Label("Scores:\t" + Scores, textStyle);
33 | GUILayout.Label("Level:\t" + Level, textStyle);
34 | if (Continuous > 1)
35 | GUILayout.Label("Continuously:" + Continuous, textStyle);
36 | GUILayout.EndArea();
37 | }
38 | #endregion
39 |
40 | #region Helper function
41 | void NewGame() {
42 | Scores = 0;
43 | Level = 1;
44 | Continuous = 0;
45 | Tetrimo.TetrimoCount = 0;
46 | }
47 | #endregion
48 | }
49 |
--------------------------------------------------------------------------------
/Assets/Scripts/GameOverCamera.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System.Collections;
3 |
4 | public class GameOverCamera : MonoBehaviour {
5 | const float BoxWidth = 300.0f,
6 | BoxHeight = 140.0f,
7 |
8 | // Button 'New Game'
9 | ButtonWidth = 160.0f,
10 | ButtonHeight= 30.0f;
11 | public bool NewHighScore = false;
12 |
13 | void Start() {
14 | NewHighScore = HighScore.TryAddHighScore(MatchCamera.Scores);
15 | }
16 |
17 | void OnGUI() {
18 | GUI.Box(CreateCenteredRect(BoxWidth, BoxHeight), "Game Over");
19 | GUI.Label(CreateCenteredRect(100.0f, BoxHeight, 20), MatchCamera.Scores.ToString(), new GUIStyle() {
20 | fontSize = 36,
21 | alignment = TextAnchor.UpperCenter,
22 | normal = new GUIStyleState() {
23 | textColor = NewHighScore ? Color.green : Color.gray
24 | }
25 | });
26 | GUI.Label(CreateCenteredRect(100.0f, BoxHeight, 60.0f), "Scores", new GUIStyle() {
27 | fontSize = 10,
28 | alignment = TextAnchor.UpperCenter,
29 | normal = new GUIStyleState() {
30 | textColor = Color.white
31 | }
32 | });
33 |
34 | if (GUI.Button(CreateCenteredRect(ButtonWidth, ButtonHeight, BoxHeight/2 - ButtonHeight - 5), "Back to Main Menu")) {
35 | Application.LoadLevel("MainMenu");
36 | }
37 | }
38 |
39 | private static Rect CreateCenteredRect(float width, float height, float y_offset =0) {
40 | return new Rect((Screen.width - width) / 2, (Screen.height - height) / 2 + y_offset, width, height);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Assembly-CSharp-vs.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 10.0.20506
7 | 2.0
8 | {4B1219B7-556C-71C6-14F5-4BD473BDE852}
9 | Library
10 | Properties
11 |
12 | Assembly-CSharp
13 | v3.5
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | Temp\bin\Debug\
21 | DEBUG;TRACE;UNITY_WEBPLAYER;WEBPLUG;ENABLE_MICROPHONE;ENABLE_IMAGEEFFECTS;ENABLE_WEBCAM;ENABLE_AUDIO_FMOD;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PHYSICS;ENABLE_TERRAIN;ENABLE_CACHING;ENABLE_SUBSTANCE;ENABLE_GENERICS;ENABLE_CLOTH;ENABLE_MOVIES;ENABLE_AUDIO;ENABLE_WWW;ENABLE_SHADOWS;ENABLE_DUCK_TYPING;UNITY_4_1_5;UNITY_4_1;ENABLE_PROFILER;UNITY_EDITOR
22 | prompt
23 | 4
24 | 0169
25 |
26 |
27 | pdbonly
28 | true
29 | Temp\bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 | 0169
34 |
35 |
36 |
37 |
38 |
39 |
40 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEngine.dll
41 |
42 |
43 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEditor.dll
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/Assembly-CSharp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 10.0.20506
7 | 2.0
8 | {4B1219B7-556C-71C6-14F5-4BD473BDE852}
9 | Library
10 | Properties
11 |
12 | Assembly-CSharp
13 | v3.5
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | Temp\bin\Debug\
21 | DEBUG;TRACE;UNITY_WEBPLAYER;WEBPLUG;ENABLE_MICROPHONE;ENABLE_IMAGEEFFECTS;ENABLE_WEBCAM;ENABLE_AUDIO_FMOD;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PHYSICS;ENABLE_TERRAIN;ENABLE_CACHING;ENABLE_SUBSTANCE;ENABLE_GENERICS;ENABLE_CLOTH;ENABLE_MOVIES;ENABLE_AUDIO;ENABLE_WWW;ENABLE_SHADOWS;ENABLE_DUCK_TYPING;UNITY_4_1_5;UNITY_4_1;ENABLE_PROFILER;UNITY_EDITOR
22 | prompt
23 | 4
24 | 0169
25 |
26 |
27 | pdbonly
28 | true
29 | Temp\bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 | 0169
34 |
35 |
36 |
37 |
38 |
39 |
40 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEngine.dll
41 |
42 |
43 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEditor.dll
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/Assets/Scripts/MainMenuCamera.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System.Collections;
3 |
4 | public class MainMenuCamera : MonoBehaviour {
5 | public Texture2D Background;
6 | public Texture2D TetrisTitel;
7 | public Font HighScoreFont;
8 |
9 | bool ShowHighScore = false;
10 |
11 | void OnGUI() {
12 | int ButtonWidth = Mathf.CeilToInt(Screen.width * 0.25f),
13 | ButtonHeight = Mathf.CeilToInt(ButtonWidth * 0.15f),
14 | ButtonSpace = Mathf.CeilToInt(ButtonHeight * 0.10f),
15 | ButtonBoxWidth = Mathf.CeilToInt(ButtonWidth + 40),
16 | ButtonBoxHeight = Mathf.CeilToInt(ButtonHeight * 3 + ButtonSpace * 2 + 40);
17 | int HighScoreBoxWidth = Mathf.CeilToInt(Screen.width * 0.4f),
18 | HighScoreBoxHeight = Mathf.CeilToInt(Screen.height * 0.4f);
19 | int FontSize = Mathf.CeilToInt(HighScoreBoxHeight / 5);
20 |
21 | GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), Background);
22 | GUI.DrawTexture(new Rect((Screen.width - TetrisTitel.width) / 2, 10, TetrisTitel.width, TetrisTitel.height), TetrisTitel);
23 |
24 | if (!ShowHighScore) {
25 | Rect box = new Rect(5, (Screen.height - ButtonBoxHeight) / 2, ButtonBoxWidth, ButtonBoxHeight);
26 |
27 | GUI.Box(box, "");
28 | GUILayout.BeginArea(box);
29 | GUILayout.FlexibleSpace();
30 | GUILayout.BeginHorizontal();
31 | GUILayout.FlexibleSpace();
32 | GUILayout.BeginVertical();
33 | if (GUILayout.Button("New Game", GUILayout.Height(ButtonHeight), GUILayout.Width(ButtonWidth))) {
34 | Application.LoadLevel("Match");
35 | }
36 | GUILayout.Space(ButtonSpace);
37 | if (GUILayout.Button("Highscores", GUILayout.Height(ButtonHeight), GUILayout.Width(ButtonWidth))) {
38 | ShowHighScore = true;
39 | }
40 | GUILayout.Space(ButtonSpace);
41 | if (GUILayout.Button("Visit Draphony Games online", GUILayout.Height(ButtonHeight), GUILayout.Width(ButtonWidth))) {
42 | Application.OpenURL("http://www.draphony.de");
43 | }
44 | GUILayout.EndVertical();
45 | GUILayout.FlexibleSpace();
46 | GUILayout.EndHorizontal();
47 | GUILayout.FlexibleSpace();
48 | GUILayout.EndArea();
49 | }
50 | else {
51 | GUIStyle highScoreStyle = new GUIStyle() {
52 | alignment = TextAnchor.MiddleCenter,
53 | fontSize = FontSize,
54 | font = HighScoreFont,
55 | fontStyle= FontStyle.Bold,
56 | normal = new GUIStyleState() {
57 | textColor = Color.white
58 | }
59 | };
60 |
61 | Rect HighScoreBox = new Rect((Screen.width - HighScoreBoxWidth) / 2, (Screen.height - HighScoreBoxHeight) / 2, HighScoreBoxWidth, HighScoreBoxHeight);
62 | GUI.Box(HighScoreBox,"");
63 | GUILayout.BeginArea(HighScoreBox);
64 | for (int i = 2; i >= 0; i--) {
65 | GUILayout.Label(HighScore.get(i).ToString("D10"), highScoreStyle);
66 | GUILayout.Space(5);
67 | }
68 | if (GUILayout.Button("Close", GUILayout.MinHeight(ButtonHeight), GUILayout.MinWidth(ButtonWidth))) {
69 | Application.LoadLevel("MainMenu");
70 | }
71 | GUILayout.EndArea();
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/Assets/Scripts/Tetrimo.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 |
5 | // Don't use "System.Collections.Generic" if you want to export your app to flash
6 |
7 | public class Tetrimo : MonoBehaviour {
8 | #region Shapes and Colors
9 | static Vector2[, ,] Shapes = new Vector2[7,4,4] {
10 | // #
11 | // ###
12 | {
13 | {new Vector2(0, 1), new Vector2(0, 0), new Vector2(1, 0), new Vector2(2, 0) },
14 | {new Vector2(0, 1), new Vector2(1, 1), new Vector2(0, 0), new Vector2(0,-1) },
15 | {new Vector2(0, 1), new Vector2(1, 1), new Vector2(2, 1), new Vector2(2, 0) },
16 | {new Vector2(1, 1), new Vector2(1, 0), new Vector2(1,-1), new Vector2(0,-1) },
17 | },
18 | // #
19 | // ###
20 | {
21 | {new Vector2(2, 1), new Vector2(0, 0), new Vector2(1, 0), new Vector2(2, 0)},
22 | {new Vector2(0, 1), new Vector2(0, 0), new Vector2(0,-1), new Vector2(1,-1)},
23 | {new Vector2(0, 1), new Vector2(1, 1), new Vector2(2, 1), new Vector2(0, 0)},
24 | {new Vector2(0, 1), new Vector2(1, 1), new Vector2(1, 0), new Vector2(1,-1)}
25 | },
26 | // #
27 | // ###
28 | {
29 | {new Vector2(1, 1), new Vector2(0, 0), new Vector2(1, 0), new Vector2(2, 0)},
30 | {new Vector2(0, 1), new Vector2(0, 0), new Vector2(0,-1), new Vector2(1, 0)},
31 | {new Vector2(0, 1), new Vector2(1, 1), new Vector2(2, 1), new Vector2(1, 0)},
32 | {new Vector2(0, 0), new Vector2(1, 1), new Vector2(1, 0), new Vector2(1,-1)}
33 | },
34 | // ##
35 | // ##
36 | {
37 | {new Vector2(0, 1), new Vector2(1, 1), new Vector2(0, 0), new Vector2(1, 0)},
38 | {new Vector2(0, 1), new Vector2(1, 1), new Vector2(0, 0), new Vector2(1, 0)},
39 | {new Vector2(0, 1), new Vector2(1, 1), new Vector2(0, 0), new Vector2(1, 0)},
40 | {new Vector2(0, 1), new Vector2(1, 1), new Vector2(0, 0), new Vector2(1, 0)}
41 | },
42 | //
43 | // ####
44 | {
45 | {new Vector2(0, 0), new Vector2(1, 0), new Vector2(2, 0), new Vector2(3, 0)},
46 | {new Vector2(0, 1), new Vector2(0, 0), new Vector2(0,-1), new Vector2(0,-2)},
47 | {new Vector2(0, 0), new Vector2(1, 0), new Vector2(2, 0), new Vector2(3, 0)},
48 | {new Vector2(0, 1), new Vector2(0, 0), new Vector2(0,-1), new Vector2(0,-2)}
49 | },
50 | // ##
51 | // ##
52 | {
53 | {new Vector2(0, 0), new Vector2(1, 0), new Vector2(1, 1), new Vector2(2, 1)},
54 | {new Vector2(0, 1), new Vector2(0, 0), new Vector2(1, 0), new Vector2(1,-1)},
55 | {new Vector2(0, 0), new Vector2(1, 0), new Vector2(1, 1), new Vector2(2, 1)},
56 | {new Vector2(0, 1), new Vector2(0, 0), new Vector2(1, 0), new Vector2(1,-1)}
57 | },
58 | // ##
59 | // ##
60 | {
61 | {new Vector2(0, 1), new Vector2(1, 1), new Vector2(1, 0), new Vector2(2, 0)},
62 | {new Vector2(1, 1), new Vector2(0, 0), new Vector2(1, 0), new Vector2(0,-1)},
63 | {new Vector2(0, 1), new Vector2(1, 1), new Vector2(1, 0), new Vector2(2, 0)},
64 | {new Vector2(1, 1), new Vector2(0, 0), new Vector2(1, 0), new Vector2(0,-1)}
65 | }
66 | };
67 | static Color[] Colors = new Color[7] {
68 | Color.red,
69 | Color.green,
70 | Color.blue,
71 | Color.white,
72 | Color.yellow,
73 | Color.magenta,
74 | Color.cyan
75 | };
76 | #endregion
77 | #region NestedTypes
78 | public struct CFieldSize {
79 | public int Left, Right, Bottom, Top;
80 | }
81 | ///
82 | ///
83 | /// - Falling
84 | /// - Landed
85 | /// - Fixed< /item>
86 | ///
87 | ///
88 | public enum TetrimoState {
89 | Spawning, // Tetrimo is about to become "Falling"
90 | Falling,
91 | Landed,
92 | Fixed,
93 | Preview
94 | }
95 | #endregion
96 |
97 | #region Class instances data members
98 | /// All tetrimos in Preview State
99 | public static Tetrimo NextTetrimo;
100 | public static uint TetrimoCount = 1;
101 | /// border position of the game field (inclusive values)
102 | static CFieldSize FieldSize = new CFieldSize() {
103 | Left = 0,
104 | Right = 10,
105 | Top = 18, // always start at top-1, cause the center of each tetrimo is the second element on the lower row
106 | Bottom = 0
107 | };
108 | /// Start position of new Tetrimos in 'Preview' state
109 | static Vector2 PreviewHUD = new Vector2() {
110 | x = 16,
111 | y = 16
112 | };
113 | ///
114 | ///
115 | /// - null, if position is free
116 | /// - gameObject, if position is occupied
117 | ///
118 | ///
119 | static GameObject[,] FieldMatrix = new GameObject[19, 11];
120 | #endregion
121 |
122 | #region Fields (Set in Unity Editor)
123 | /// Pointer to itselfs => create new Tetrimos
124 | public GameObject TetrimoPrefab;
125 | public GameObject TetrimoPartPrefab;
126 | public GameObject TetrimoExplosionPrefab;
127 | public GameObject FourLinesLabelPrefab;
128 |
129 | public TetrimoState State;
130 | /// Swap action cooldown
131 | public float SwapCooldown;
132 | /// Horizontal movement speed
133 | public float HorizontalSpeed;
134 | public float FallingCooldown;
135 | public float FallingSpeed;
136 | #endregion
137 |
138 | #region Private Fields
139 | /// Countdown for next swap
140 | float NextSwap = 0.0f;
141 | /// Countdown for next fall
142 | float NextFall;
143 | int ShapeIndex, RotationIndex;
144 | bool IsMovingHorizontal = false;
145 | #endregion
146 |
147 | #region Properties
148 | bool CanMoveDown {
149 | get {
150 | if(IsMovingHorizontal)
151 | return false;
152 |
153 | foreach (Transform child in transform) {
154 | if (Mathf.RoundToInt(child.position.y - 1) < 0 || FieldMatrix[Mathf.RoundToInt(child.position.y - 1), Mathf.RoundToInt(child.position.x)] != null)
155 | return false;
156 | }
157 | return true;
158 | }
159 | }
160 | bool CanMoveRight {
161 | get {
162 | bool canMoveRight = true;
163 | foreach (Transform child in transform) {
164 | canMoveRight &= Mathf.RoundToInt(child.position.x + 1) <= Tetrimo.FieldSize.Right && FieldMatrix[Mathf.RoundToInt(child.position.y), Mathf.RoundToInt(child.position.x + 1)] == null;
165 | }
166 | return canMoveRight;
167 | }
168 | }
169 | bool CanMoveLeft {
170 | get {
171 | bool canMoveLeft = true;
172 | foreach (Transform child in transform) {
173 | canMoveLeft &= Mathf.RoundToInt(child.position.x - 1) >= Tetrimo.FieldSize.Left && FieldMatrix[Mathf.RoundToInt(child.position.y), Mathf.RoundToInt(child.position.x - 1)] == null;
174 | }
175 | return canMoveLeft;
176 | }
177 | }
178 | bool CanRotate {
179 | get {
180 | // Iterate through each TetrimoParts
181 | for (int index = 0; index < Shapes.GetLength(2); index++) {
182 | Vector2 tmp = new Vector2(transform.position.x, transform.position.y) + Shapes[ShapeIndex, (RotationIndex + 1) % Shapes.GetLength(2), index];
183 |
184 | if (tmp.x < FieldSize.Left || tmp.x > FieldSize.Right || tmp.y < FieldSize.Bottom || tmp.y > FieldSize.Top)
185 | return false;
186 |
187 | if (FieldMatrix[Mathf.RoundToInt(tmp.y), Mathf.RoundToInt(tmp.x)] != null)
188 | return false;
189 | }
190 | return true;
191 | }
192 | }
193 | #endregion
194 |
195 | #region Event Handler
196 | void Start () {
197 | switch (State) {
198 | case TetrimoState.Spawning:
199 | NextFall = FallingCooldown;
200 |
201 | // Create shape and translate it at the center top of the game field.
202 | // REMARK: Do not use translate here! Instantiate create a copy of the current object.
203 | CreateShape();
204 | transform.position = new Vector3((int)(FieldSize.Right / 2), FieldSize.Top - 1, 0);
205 |
206 | // Check if the player has lost the game
207 | foreach (Transform child in transform) {
208 | if (FieldMatrix[(int)child.position.y, (int)child.position.x] != null) {
209 | Application.LoadLevel("GameOver");
210 | }
211 | }
212 | name = "Tetrimo#" + (TetrimoCount-1);
213 | State = TetrimoState.Falling;
214 | break;
215 |
216 | case TetrimoState.Preview:
217 | RotationIndex = Random.Range(0, Shapes.GetLength(1));
218 | ShapeIndex = Random.Range(0, Shapes.GetLength(0));
219 | CreateShape();
220 | transform.position = new Vector3(PreviewHUD.x, PreviewHUD.y);
221 |
222 | NextTetrimo = this;
223 |
224 | TetrimoCount++;
225 | name = "Tetrimo#" + TetrimoCount;
226 | break;
227 | }
228 | }
229 | void Update() {
230 | if (State != TetrimoState.Fixed && State != TetrimoState.Preview && State != TetrimoState.Spawning) {
231 | if (State != TetrimoState.Landed && Input.GetAxis("Vertical") < 0)
232 | StartCoroutine(FallingDown());
233 |
234 | if (Input.GetButtonDown("Horizontal"))
235 | StartCoroutine(MoveHorizontal());
236 |
237 | // Set "up" as alternative button for Jump (Project => Input)
238 | if ((Input.GetButton("Jump")) && Time.time > NextSwap) {
239 | if (this.CanRotate) {
240 | StartCoroutine(RotateTetrimo());
241 | NextSwap = Time.time + SwapCooldown;
242 | }
243 | }
244 |
245 | // Automatic falling down
246 | if (NextFall < 0) {
247 | StartCoroutine(FallingDown());
248 | NextFall = FallingCooldown;
249 | }
250 | NextFall -= FallingSpeed * Time.deltaTime;
251 | }
252 |
253 | if (State == TetrimoState.Preview) {
254 | transform.Rotate(0, 1f, 0, Space.World);
255 | }
256 |
257 | // Debugging Feature
258 | if (Input.GetKeyDown(KeyCode.F2)) {
259 | KillAndReload();
260 | }
261 | }
262 | #endregion
263 |
264 | #region Coroutines: http://unitygems.com/coroutines/
265 | ///
266 | /// Active the Tetrimo in the preview hub
267 | ///
268 | ///
269 | IEnumerator ActivateTetrimoInPreview() {
270 | yield return 0;
271 | }
272 | ///
273 | /// Create a new Tetrimo and place it in the preview hub.
274 | ///
275 | ///
276 | IEnumerator CreatePreviewStateTetrimo() {
277 | yield return 0;
278 | }
279 | IEnumerator MoveHorizontal() {
280 | IsMovingHorizontal = true;
281 |
282 | float moved = 0.0f;
283 | float direction = Input.GetAxis("Horizontal");
284 |
285 | if ((this.CanMoveRight && direction > 0) || (this.CanMoveLeft && direction < 0)) {
286 | while (moved <= 1.0f) {
287 | float moveStep = Mathf.Min(HorizontalSpeed * Time.deltaTime, 1.1f - moved); // 1.1f since float has some rounding problems!
288 |
289 | if (direction > 0)
290 | transform.Translate(Vector3.right * moveStep, Space.World);
291 | else if (direction < 0)
292 | transform.Translate(Vector3.left * moveStep, Space.World);
293 |
294 | moved += moveStep;
295 | yield return 0;
296 | }
297 |
298 | // We will correct the actual position of each stone when it landed
299 | transform.position = new Vector2(Mathf.RoundToInt(transform.position.x), Mathf.RoundToInt(transform.position.y));
300 | }
301 |
302 | IsMovingHorizontal = false;
303 | }
304 | IEnumerator FallingDown() {
305 | if (this.CanMoveDown) {
306 | transform.Translate(Vector3.down, Space.World);
307 | }
308 | else {
309 | if (State == TetrimoState.Falling) {
310 | // After the Tetrimo has landed, the player can move it in the first 400ms.
311 | this.audio.Play();
312 | State = TetrimoState.Landed;
313 | yield return new WaitForSeconds(0.4f);
314 | while (IsMovingHorizontal) // Wait for end of possible MoveHorizontal - calls
315 | yield return new WaitForEndOfFrame();
316 |
317 | if (this.CanMoveDown) {
318 | State = TetrimoState.Falling;
319 | }
320 | else {
321 | State = TetrimoState.Fixed;
322 | foreach (Transform child in transform) {
323 | Tetrimo.FieldMatrix[Mathf.RoundToInt(child.position.y), Mathf.RoundToInt(child.position.x)] = child.gameObject;
324 | }
325 | ArrayList lines = FindLines();
326 |
327 | if (lines.Count > 0) {
328 | int FourLineBonus = 0;
329 |
330 | // Destruction animation
331 | foreach (int line in lines) {
332 | int y = Mathf.CeilToInt(line);
333 |
334 | for (int i = FieldSize.Left; i <= FieldSize.Right; i++) {
335 | Instantiate(TetrimoExplosionPrefab, FieldMatrix[y, i].transform.position, Quaternion.identity);
336 | Destroy(FieldMatrix[y, i]);
337 | FieldMatrix[y, i] = null;
338 | }
339 | }
340 | if (lines.Count == 4) {
341 | FourLineBonus = FieldMatrix.GetLength(1);
342 | Instantiate(FourLinesLabelPrefab, new Vector3(transform.position.x, transform.position.y + 1.0f), Quaternion.identity);
343 | }
344 |
345 | // update logic
346 | yield return new WaitForEndOfFrame();
347 | lines.Sort();
348 | lines.Reverse();
349 | foreach (int line in lines) {
350 | if (line >= FieldSize.Top)
351 | continue;
352 | LetLinesAboveFalling(line + 1);
353 | }
354 |
355 | // adding scores
356 | MatchCamera.Scores += FieldMatrix.GetLength(1) * lines.Count + MatchCamera.Continuous + FourLineBonus;
357 | MatchCamera.Continuous++;
358 |
359 | // check if next level has been reached
360 | if (MatchCamera.Scores >= MatchCamera.Level * MatchCamera.ScoresForNextLevel) {
361 | MatchCamera.Level = 1 + Mathf.FloorToInt(((float)MatchCamera.Scores) / MatchCamera.ScoresForNextLevel);
362 | FallingSpeed++;
363 | }
364 | }
365 | else {
366 | MatchCamera.Continuous = 0;
367 | }
368 |
369 | // Create the new Tetrimo as previewed by destroying the previewed Tetrimo, and place a new created Tetrimo
370 | // yield return new WaitForSeconds(0.5f);
371 | ActivateAndCreateNewPreview();
372 |
373 | // Extract children (TetrimoParts) from Tetrimo. We will delete the Tetrimo itself.
374 | Transform[] children = GetComponentsInChildren();
375 | for (int i = 0; i < children.Length; i++)
376 | children[i].parent = null;
377 | Destroy(gameObject);
378 | }
379 | }
380 | }
381 | }
382 |
383 | void ActivateAndCreateNewPreview() {
384 | GameObject newGameObject = (GameObject)Instantiate(TetrimoPrefab, Vector3.zero, Quaternion.identity);
385 | Tetrimo newFallingTetrimo = newGameObject.GetComponent();
386 | newFallingTetrimo.RotationIndex = NextTetrimo.RotationIndex;
387 | newFallingTetrimo.ShapeIndex = NextTetrimo.ShapeIndex;
388 | newFallingTetrimo.State = TetrimoState.Spawning;
389 |
390 | foreach (Transform child in newFallingTetrimo.transform) {
391 | Destroy(child.gameObject);
392 | }
393 | Destroy(NextTetrimo.gameObject);
394 |
395 | newGameObject = (GameObject)Instantiate(TetrimoPrefab, Vector3.zero, Quaternion.identity);
396 | Tetrimo newPreviewTetrimo = newGameObject.GetComponent();
397 | newPreviewTetrimo.State = TetrimoState.Preview;
398 | }
399 | IEnumerator RotateTetrimo() {
400 | this.audio.Play();
401 |
402 | foreach (Transform child in transform) {
403 | Destroy(child.gameObject);
404 | }
405 |
406 | RotationIndex = (RotationIndex + 1) % Shapes.GetLength(2);
407 | CreateShape();
408 | yield return 0;
409 | }
410 | void LetLinesAboveFalling(float lineToBegin) {
411 | int bottom = Mathf.RoundToInt(lineToBegin);
412 |
413 | for (int y = bottom; y <= FieldSize.Top; y++) {
414 | for (int x = FieldSize.Left; x <= FieldSize.Right; x++) {
415 | FieldMatrix[y-1, x] = FieldMatrix[y, x];
416 | if (FieldMatrix[y-1, x] != null)
417 | FieldMatrix[y-1, x].transform.Translate(Vector3.down);
418 |
419 | FieldMatrix[y, x] = null;
420 | }
421 | }
422 | }
423 | #endregion
424 |
425 | #region Helper functions
426 | void CreateShape() {
427 | foreach (Transform child in transform) {
428 | Destroy(child.gameObject);
429 | }
430 |
431 | for (int index = 0; index < Shapes.GetLength(2); index++) {
432 | GameObject tmp = (GameObject)Instantiate(TetrimoPartPrefab, Shapes[ShapeIndex, RotationIndex, index], Quaternion.identity);
433 |
434 | tmp.transform.Translate(transform.position);
435 | tmp.transform.parent = gameObject.transform;
436 | tmp.renderer.material.color = Colors[ShapeIndex];
437 | }
438 | }
439 | ///
440 | /// Check matrix for full filled lines, where the current Tetrimo is part of it.
441 | ///
442 | /// y-indices of type int
443 | ArrayList FindLines() {
444 | ArrayList lines = new ArrayList();
445 | Hashtable open = new Hashtable(); // Never use classes or methods, that aren't listened in the Unity reference, if you aim for cross-plattform-support.
446 |
447 | foreach (Transform child in transform) {
448 | int line = Mathf.CeilToInt(child.position.y);
449 | if(!open.ContainsKey(line))
450 | open.Add(line, line);
451 | }
452 |
453 | foreach (int y in open.Keys) {
454 | bool fullline = true;
455 | for (int i = FieldSize.Left; i <= FieldSize.Right; i++)
456 | fullline &= FieldMatrix[Mathf.RoundToInt(y), i] != null;
457 | if (fullline)
458 | lines.Add((int) y);
459 | }
460 | return lines;
461 | }
462 | #endregion
463 |
464 | #region Debugging helper function
465 | private void KillAndReload() {
466 | for (int c = FieldSize.Left; c <= FieldSize.Right; c++) {
467 | for (int r = FieldSize.Bottom; r <= FieldSize.Top; r++) {
468 | if (FieldMatrix[r, c] != null) {
469 | Destroy(FieldMatrix[r, c]);
470 | }
471 | }
472 | }
473 | Tetrimo[] gameObjects = GetComponents();
474 | foreach (Tetrimo go in gameObjects) {
475 | if (go.State == TetrimoState.Falling)
476 | continue;
477 |
478 | Destroy(go.gameObject);
479 | }
480 |
481 | for (int c = FieldSize.Left; c <= FieldSize.Right; c++) {
482 | for (int r = FieldSize.Bottom; r <= FieldSize.Top; r++) {
483 | if (FieldMatrix[r, c] != null) {
484 | FieldMatrix[r, c] = (GameObject) Instantiate(TetrimoPartPrefab, new Vector2(c,r), Quaternion.identity);
485 | FieldMatrix[r, c].renderer.material.color = Color.white;
486 | }
487 | }
488 | }
489 | }
490 | #endregion
491 | }
492 |
--------------------------------------------------------------------------------