Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Supergame Box
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GameDevWeek
S
Sommersemester 2019
Unity
Supergame Box
Commits
3107c04d
Commit
3107c04d
authored
Sep 21, 2019
by
Markus Schlösser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned up code
parent
1f34bea3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
18 deletions
+24
-18
Assets/_Game/MainMenu/Editor/ScenePathAttributeDrawer.cs
Assets/_Game/MainMenu/Editor/ScenePathAttributeDrawer.cs
+3
-3
Assets/_Game/MainMenu/Scripts/GameSelectButton.cs
Assets/_Game/MainMenu/Scripts/GameSelectButton.cs
+2
-3
Assets/_Game/SpaceAttacker/Scripts/Attacker.cs
Assets/_Game/SpaceAttacker/Scripts/Attacker.cs
+1
-2
Assets/_Game/SpaceAttacker/Scripts/Cannon.cs
Assets/_Game/SpaceAttacker/Scripts/Cannon.cs
+1
-2
Assets/_Game/SpaceAttacker/Scripts/Spawner.cs
Assets/_Game/SpaceAttacker/Scripts/Spawner.cs
+7
-8
Assets/_Game/Tertis/Scripts/Supergame.Tertis.asmdef
Assets/_Game/Tertis/Scripts/Supergame.Tertis.asmdef
+3
-0
Assets/_Game/Tertis/Scripts/Supergame.Tertis.asmdef.meta
Assets/_Game/Tertis/Scripts/Supergame.Tertis.asmdef.meta
+7
-0
No files found.
Assets/_Game/MainMenu/Editor/ScenePathAttributeDrawer.cs
View file @
3107c04d
...
...
@@ -5,7 +5,7 @@ using UnityEngine;
namespace
Utilities
{
[
CustomPropertyDrawer
(
typeof
(
ScenePathAttribute
))]
public
class
ScenePathAttributeDrawer
:
PropertyDrawer
{
private
const
float
F
IX_BUTTON_WIDTH
=
70.0f
;
private
const
float
F
ixButtonWidth
=
70.0f
;
private
static
SceneAsset
GetSceneAsset
(
SerializedProperty
property
)
{
return
AssetDatabase
.
LoadAssetAtPath
<
SceneAsset
>(
property
.
stringValue
);
...
...
@@ -61,8 +61,8 @@ namespace Utilities {
float
singleLineHeight
=
EditorGUIUtility
.
singleLineHeight
;
Rect
helpBox
=
new
Rect
(
position
.
x
,
position
.
yMax
-
singleLineHeight
,
position
.
width
-
F
IX_BUTTON_WIDTH
,
singleLineHeight
);
Rect
buttonRect
=
new
Rect
(
position
.
xMax
-
F
IX_BUTTON_WIDTH
,
position
.
yMax
-
singleLineHeight
,
FIX_BUTTON_WIDTH
,
singleLineHeight
);
Rect
helpBox
=
new
Rect
(
position
.
x
,
position
.
yMax
-
singleLineHeight
,
position
.
width
-
F
ixButtonWidth
,
singleLineHeight
);
Rect
buttonRect
=
new
Rect
(
position
.
xMax
-
F
ixButtonWidth
,
position
.
yMax
-
singleLineHeight
,
FixButtonWidth
,
singleLineHeight
);
EditorGUI
.
HelpBox
(
helpBox
,
"Scene is not added to build settings"
,
MessageType
.
Warning
);
...
...
Assets/_Game/MainMenu/Scripts/GameSelectButton.cs
View file @
3107c04d
using
System
;
using
UnityEngine
;
using
UnityEngine
;
using
UnityEngine.UI
;
public
class
GameSelectButton
:
MonoBehaviour
{
...
...
@@ -14,7 +13,7 @@ public class GameSelectButton : MonoBehaviour {
}
public
void
Initialize
(
Game
g
)
{
this
.
game
=
g
;
game
=
g
;
GetComponent
<
Image
>().
sprite
=
game
.
Sprite
;
}
...
...
Assets/_Game/SpaceAttacker/Scripts/Attacker.cs
View file @
3107c04d
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
UnityEngine
;
...
...
Assets/_Game/SpaceAttacker/Scripts/Cannon.cs
View file @
3107c04d
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
Cannon
:
MonoBehaviour
{
...
...
Assets/_Game/SpaceAttacker/Scripts/Spawner.cs
View file @
3107c04d
...
...
@@ -2,16 +2,11 @@
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Linq
;
using
TMPro
;
using
UnityEngine
;
using
Random
=
UnityEngine
.
Random
;
public
class
Spawner
:
MonoBehaviour
{
[
Serializable
]
private
struct
Enemy
{
[
SerializeField
]
public
GameObject
prefab
;
[
SerializeField
]
public
AnimationCurve
spawnRate
;
}
private
readonly
Queue
<
Transform
>
waves
=
new
Queue
<
Transform
>();
[
SerializeField
]
private
Vector2
cellSize
;
[
SerializeField
]
private
int
rowSize
;
...
...
@@ -25,8 +20,6 @@ public class Spawner : MonoBehaviour {
private
float
halfRowSize
;
private
readonly
Queue
<
Transform
>
waves
=
new
Queue
<
Transform
>();
private
int
CurrentRow
=>
Mathf
.
FloorToInt
((
startHeight
-
transform
.
position
.
y
)
/
cellSize
.
y
);
private
void
Awake
()
{
...
...
@@ -101,4 +94,10 @@ public class Spawner : MonoBehaviour {
rb
.
AddExplosionForce
(
Random
.
value
*
50
,
origin
,
100
,
10
,
ForceMode
.
Impulse
);
}
}
[
Serializable
]
private
struct
Enemy
{
[
SerializeField
]
public
GameObject
prefab
;
[
SerializeField
]
public
AnimationCurve
spawnRate
;
}
}
Assets/_Game/Tertis/Scripts/Supergame.Tertis.asmdef
0 → 100644
View file @
3107c04d
{
"name": "Supergame.Tertis"
}
Assets/_Game/Tertis/Scripts/Supergame.Tertis.asmdef.meta
0 → 100644
View file @
3107c04d
fileFormatVersion: 2
guid: 9c1c935516563ed43aeb68261503ac8b
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment