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
E
Explosive Temper
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
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
W
Wintersemester 2018-2019
Unity
Explosive Temper
Commits
ed0f382b
Commit
ed0f382b
authored
Mar 31, 2019
by
Rene
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
heart explosion
parent
83e63986
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
7 deletions
+33
-7
Assets/_Game/Prefabs/Bombs/Firebomb_.prefab
Assets/_Game/Prefabs/Bombs/Firebomb_.prefab
+6
-0
Assets/_Game/Prefabs/Bombs/StandardBomb.prefab
Assets/_Game/Prefabs/Bombs/StandardBomb.prefab
+2
-0
Assets/_Game/Scripts/Explosion.cs
Assets/_Game/Scripts/Explosion.cs
+23
-7
Assets/_Game/Scripts/Explosion.cs.meta
Assets/_Game/Scripts/Explosion.cs.meta
+2
-0
No files found.
Assets/_Game/Prefabs/Bombs/Firebomb_.prefab
View file @
ed0f382b
...
...
@@ -77,6 +77,12 @@ PrefabInstance:
propertyPath
:
bombType
value
:
5
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
6031096278621627649
,
guid
:
19b57e3b0f03e9647a086dba76b26a94
,
type
:
3
}
propertyPath
:
winParticle
value
:
objectReference
:
{
fileID
:
6886124997041062844
,
guid
:
e59fea3f96b8f490f951d3b7f7de21e0
,
type
:
3
}
-
target
:
{
fileID
:
5492802657688666183
,
guid
:
19b57e3b0f03e9647a086dba76b26a94
,
type
:
3
}
propertyPath
:
m_Materials.Array.size
...
...
Assets/_Game/Prefabs/Bombs/StandardBomb.prefab
View file @
ed0f382b
...
...
@@ -103,6 +103,8 @@ MonoBehaviour:
BlocksToDestroy
:
010000000200000004000000
explosionParticlesPrefab
:
{
fileID
:
2947187129184063510
,
guid
:
cfd312151975c4765aa0ee9072de5d94
,
type
:
3
}
winParticle
:
{
fileID
:
6886124997041062844
,
guid
:
e59fea3f96b8f490f951d3b7f7de21e0
,
type
:
3
}
---
!u!95
&6538770151698867305
Animator
:
serializedVersion
:
3
...
...
Assets/_Game/Scripts/Explosion.cs
View file @
ed0f382b
...
...
@@ -9,6 +9,7 @@ public class Explosion : MonoBehaviour
[
SerializeField
]
List
<
Globals
.
BoxType
>
BlocksToDestroy
;
public
GameObject
explosionParticlesPrefab
;
public
GameObject
winParticle
;
private
LayerMask
explodableMask
;
private
LayerMask
obstacleMask
;
private
float
strength
;
...
...
@@ -42,13 +43,7 @@ public class Explosion : MonoBehaviour
public
void
Explode
()
{
GameObject
explosionPartices
=
Instantiate
(
explosionParticlesPrefab
,
transform
.
position
,
Quaternion
.
Euler
(
0f
,
0f
,
0f
));
Destroy
(
explosionPartices
,
5f
);
SoundPlayer
player
=
explosionPartices
.
GetComponent
<
SoundPlayer
>();
if
(
player
!=
null
)
{
player
.
PlayExplosionSound
(
bombType
);
}
Collider
[]
hits
=
Physics
.
OverlapSphere
(
transform
.
position
,
strength
,
explodableMask
);
for
(
int
i
=
0
;
i
<
hits
.
Length
;
i
++)
{
...
...
@@ -66,6 +61,27 @@ public class Explosion : MonoBehaviour
destructable
.
ExplosionDestroy
();
}
}
if
(
GameManager
.
Instance
.
GotThePrincess
)
{
GameObject
explosionPartices
=
Instantiate
(
winParticle
,
transform
.
position
,
Quaternion
.
Euler
(
0f
,
0f
,
0f
));
Destroy
(
explosionPartices
,
5f
);
SoundPlayer
player
=
explosionPartices
.
GetComponent
<
SoundPlayer
>();
if
(
player
!=
null
)
{
player
.
PlayExplosionSound
(
bombType
);
}
}
else
{
GameObject
explosionPartices
=
Instantiate
(
explosionParticlesPrefab
,
transform
.
position
,
Quaternion
.
Euler
(
0f
,
0f
,
0f
));
Destroy
(
explosionPartices
,
5f
);
SoundPlayer
player
=
explosionPartices
.
GetComponent
<
SoundPlayer
>();
if
(
player
!=
null
)
{
player
.
PlayExplosionSound
(
bombType
);
}
}
Destroy
(
gameObject
);
}
...
...
Assets/_Game/Scripts/Explosion.cs.meta
View file @
ed0f382b
...
...
@@ -6,6 +6,8 @@ MonoImporter:
defaultReferences:
- explosionParticlesPrefab: {fileID: 2947187129184063510, guid: cfd312151975c4765aa0ee9072de5d94,
type: 3}
- winParticle: {fileID: 6886124997041062844, guid: e59fea3f96b8f490f951d3b7f7de21e0,
type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
...
...
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