Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GameDevWeek
Wintersemester 2018-2019
Unity
Suck It
Commits
5154e18a
Commit
5154e18a
authored
Mar 28, 2019
by
mthiele2
Browse files
Stoff und Schnaps
parent
16147cea
Changes
16
Hide whitespace changes
Inline
Side-by-side
Assets/_Game/Prefabs/Elemental Attacks/
Pre_Player
FireAttack.prefab
→
Assets/_Game/Prefabs/Elemental Attacks/FireAttack.prefab
View file @
5154e18a
File moved
Assets/_Game/Prefabs/Elemental Attacks/
Pre_Player
FireAttack.prefab.meta
→
Assets/_Game/Prefabs/Elemental Attacks/FireAttack.prefab.meta
View file @
5154e18a
File moved
Assets/_Game/Prefabs/Enemy Attacks/
Pre_
FireAttack.prefab
→
Assets/_Game/Prefabs/Enemy Attacks/
Enemy
FireAttack.prefab
View file @
5154e18a
File moved
Assets/_Game/Prefabs/Enemy Attacks/
Pre_
FireAttack.prefab.meta
→
Assets/_Game/Prefabs/Enemy Attacks/
Enemy
FireAttack.prefab.meta
View file @
5154e18a
File moved
Assets/_Game/Prefabs/Enemy Attacks/
Pre_
WindAttack
e
.prefab
→
Assets/_Game/Prefabs/Enemy Attacks/
Enemy
WindAttack.prefab
View file @
5154e18a
File moved
Assets/_Game/Prefabs/Enemy Attacks/
Pre_
WindAttack
e
.prefab.meta
→
Assets/_Game/Prefabs/Enemy Attacks/
Enemy
WindAttack.prefab.meta
View file @
5154e18a
File moved
Assets/_Game/Prefabs/Level_Elements/Destroyable_Thing.prefab
View file @
5154e18a
...
...
@@ -15,7 +15,7 @@ GameObject:
-
component
:
{
fileID
:
5372445436103654034
}
m_Layer
:
0
m_Name
:
Destroyable_Thing
m_TagString
:
Untagged
m_TagString
:
DestroyableByFire
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
...
...
@@ -68,8 +68,8 @@ SpriteRenderer:
m_AutoUVMaxDistance
:
0.5
m_AutoUVMaxAngle
:
89
m_LightmapParameters
:
{
fileID
:
0
}
m_SortingLayerID
:
0
m_SortingLayer
:
0
m_SortingLayerID
:
-614652393
m_SortingLayer
:
4
m_SortingOrder
:
0
m_Sprite
:
{
fileID
:
21300000
,
guid
:
d0cee4e8b659c5646ac1e205b88a3256
,
type
:
3
}
m_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
...
...
Assets/_Game/Scenes/MainLevel-Max.unity
View file @
5154e18a
...
...
@@ -278,12 +278,12 @@ PrefabInstance:
-
target
:
{
fileID
:
7340435369038607274
,
guid
:
938701439f7d9654da1b920d73ccf2cc
,
type
:
3
}
propertyPath
:
m_LocalPosition.x
value
:
8.68
value
:
1.33
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
7340435369038607274
,
guid
:
938701439f7d9654da1b920d73ccf2cc
,
type
:
3
}
propertyPath
:
m_LocalPosition.y
value
:
3.5
value
:
2.03
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
7340435369038607274
,
guid
:
938701439f7d9654da1b920d73ccf2cc
,
type
:
3
}
...
...
@@ -313,7 +313,7 @@ PrefabInstance:
-
target
:
{
fileID
:
7340435369038607274
,
guid
:
938701439f7d9654da1b920d73ccf2cc
,
type
:
3
}
propertyPath
:
m_RootOrder
value
:
4
value
:
5
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
7340435369038607274
,
guid
:
938701439f7d9654da1b920d73ccf2cc
,
type
:
3
}
...
...
@@ -666,7 +666,7 @@ PrefabInstance:
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4738352637052488
,
guid
:
6cd7f8e10f89642fd88661db0d3f3827
,
type
:
3
}
propertyPath
:
m_RootOrder
value
:
5
value
:
4
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4738352637052488
,
guid
:
6cd7f8e10f89642fd88661db0d3f3827
,
type
:
3
}
propertyPath
:
m_LocalEulerAnglesHint.x
...
...
@@ -1181,16 +1181,6 @@ PrefabInstance:
propertyPath
:
m_LocalEulerAnglesHint.z
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
3962879857309384165
,
guid
:
926b80f66a4f61b428fa10deff5f7842
,
type
:
3
}
propertyPath
:
m_SortingLayerID
value
:
-614652393
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
3962879857309384165
,
guid
:
926b80f66a4f61b428fa10deff5f7842
,
type
:
3
}
propertyPath
:
m_SortingLayer
value
:
4
objectReference
:
{
fileID
:
0
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
926b80f66a4f61b428fa10deff5f7842
,
type
:
3
}
---
!u!1
&1156108368
...
...
Assets/_Game/Scripts/Enemy AI/Air/AI_WindAttack.cs
View file @
5154e18a
...
...
@@ -14,6 +14,9 @@ public class AI_WindAttack : WeightedAction
public
float
Cooldown
;
public
float
attackRange
;
public
float
firePower
;
public
int
damage
;
public
float
destroyTime
;
public
float
thrust
;
// Use this for initialization
void
Start
()
...
...
@@ -33,10 +36,6 @@ public class AI_WindAttack : WeightedAction
return
;
}
Vector2
dir
=
Vector2
.
zero
;
direction
=
dir
;
myAI
.
desiredAction
.
Add
(
this
);
}
...
...
@@ -65,9 +64,4 @@ public class AI_WindAttack : WeightedAction
Vector3
rotatedVector
=
Quaternion
.
AngleAxis
(
0
,
Vector3
.
forward
)
*
attackdir
;
body
.
velocity
=
new
Vector2
(
rotatedVector
.
x
*
firePower
,
rotatedVector
.
y
*
firePower
);
}
private
void
OnDrawGizmosSelected
()
{
Gizmos
.
color
=
Color
.
red
;
}
}
Assets/_Game/Scripts/Enemy AI/Air/AI_WindProjectile.cs
View file @
5154e18a
...
...
@@ -3,10 +3,17 @@ using UnityEngine;
public
class
AI_WindProjectile
:
MonoBehaviour
{
public
float
destroyTime
=
1f
;
public
float
thrust
;
private
float
destroyTime
;
private
float
thrust
;
private
int
damage
;
private
void
Start
()
{
AI_WindAttack
windattack
=
GetComponentInParent
<
AI_WindAttack
>();
destroyTime
=
windattack
.
destroyTime
;
thrust
=
windattack
.
thrust
;
damage
=
windattack
.
damage
;
}
void
OnEnable
()
{
...
...
@@ -27,7 +34,7 @@ public class AI_WindProjectile : MonoBehaviour
dir
.
Normalize
();
dir
*=
thrust
;
other
.
attachedRigidbody
.
AddForce
(
dir
,
ForceMode2D
.
Impulse
);
//
other.
attachedRigidbody.AddForce(Vector2.right*thrust, ForceMode2D.Impuls
e);
other
.
GetComponentInParent
<
Life
>().
Damage
(
damag
e
);
}
Destroy
();
}
...
...
Assets/_Game/Scripts/Enemy AI/Fire/AI_FireAttack.cs
View file @
5154e18a
...
...
@@ -8,10 +8,11 @@ public class AI_FireAttack : WeightedAction
AI_Core
myAI
;
private
float
restCooldown
;
public
float
Cooldown
;
public
float
attackRange
;
public
float
destroyTime
;
public
int
damage
;
public
GameObject
shot
;
List
<
GameObject
>
shots
;
public
GameObject
fireBall
;
public
float
fireSpeed
=
2f
;
public
int
volleySize
;
public
int
pooledAmount
=
10
;
...
...
@@ -69,7 +70,7 @@ public class AI_FireAttack : WeightedAction
for
(
int
i
=
0
;
i
<
volleySize
;
i
++)
{
launchPower
+=
3
;
GameObject
projectile
=
Instantiate
(
shot
,
shotspawn
.
position
,
shotspawn
.
rotation
);
GameObject
projectile
=
Instantiate
(
fireBall
,
shotspawn
.
position
,
shotspawn
.
rotation
);
if
(
nearestPlayer
.
transform
.
position
.
x
>
this
.
transform
.
position
.
x
)
{
projectile
.
GetComponent
<
Rigidbody2D
>().
velocity
=
new
Vector2
(
launchPower
,
launchPower
);
...
...
Assets/_Game/Scripts/Enemy AI/Fire/AI_FireProjectile.cs
View file @
5154e18a
...
...
@@ -2,46 +2,31 @@ using UnityEngine;
public
class
AI_FireProjectile
:
MonoBehaviour
{
public
double
damage
;
public
GameObject
nearestPlayer
;
/// <summary>
/// Bisher werden die Shots nach einer Sekunde auf inactive gesetzt
/// hier muss noch was mit Collidern eingefügt werden um
/// auf Zusammenstöße reagieren zu können, damit der Shot dann
/// auf inactive gesetzt wird
/// </summary>
public
float
destroyTime
=
1f
;
/// <summary>
/// Wenn das Geschoss auf active gesetzt wird, wird nach 2 Sekunden
/// die Destroy Methode aufgerufen
/// </summary>
private
float
destroyTime
;
private
float
thrust
;
private
int
damage
;
private
void
Start
()
{
AI_FireAttack
fireAttack
=
GetComponentInParent
<
AI_FireAttack
>();
destroyTime
=
fireAttack
.
destroyTime
;
damage
=
fireAttack
.
damage
;
}
void
OnEnable
()
void
OnEnable
()
{
Invoke
(
"Destroy"
,
destroyTime
);
}
/// <summary>
/// Setzt das Geschoss auf 'inactive'
/// </summary>
void
Destroy
()
{
Destroy
(
gameObject
);
}
/// <summary>
/// Beim Zusammenstoß mit einem anderen GameObject
/// </summary>
/// <param name="collision"></param>
private
void
OnTriggerEnter2D
(
Collider2D
target
)
{
if
(
target
.
CompareTag
(
"Enemy"
))
private
void
OnTriggerEnter2D
(
Collider2D
other
)
{
if
(
other
.
CompareTag
(
"Player"
))
{
return
;
other
.
GetComponentInParent
<
Life
>().
Damage
(
damage
)
;
}
Destroy
();
}
...
...
Assets/_Game/Scripts/Enemy AI/Generell/AI_WandersV2.cs
View file @
5154e18a
...
...
@@ -50,7 +50,6 @@ public class AI_WandersV2 : WeightedAction
{
patrolSpot
=
new
Vector3
(
Random
.
Range
(
minX
,
maxX
),
Random
.
Range
(
minY
,
maxY
),
-
1
);
dist
=
transform
.
position
-
patrolSpot
;
Debug
.
Log
(
"penis"
);
}
while
(
dist
.
magnitude
<
4f
);
targetPos
.
position
=
patrolSpot
;
...
...
Assets/_Game/Scripts/Level Hazards/DestroyObject.cs
View file @
5154e18a
...
...
@@ -7,10 +7,8 @@ public class DestroyObject : MonoBehaviour {
void
OnCollisionEnter2D
(
Collision2D
other
)
{
Debug
.
Log
(
"pla"
);
if
(
other
.
gameObject
.
tag
==
"Fire"
)
{
Destroy
(
other
.
gameObject
);
Destroy
(
gameObject
);
}
}
...
...
Assets/_Game/Scripts/Player/PlayerAttacks/Player_FireProjectile.cs
View file @
5154e18a
...
...
@@ -24,6 +24,10 @@ public class Player_FireProjectile : MonoBehaviour
collision
.
gameObject
.
GetComponent
<
Life
>().
Damage
(
1
);
Destroy
();
}
else
if
(
collision
.
gameObject
.
CompareTag
(
"DestroyableByFire"
))
{
Destroy
();
}
}
}
ProjectSettings/TagManager.asset
View file @
5154e18a
...
...
@@ -12,6 +12,7 @@ TagManager:
-
Fire
-
Enemy
-
EnemyShot
-
DestroyableByFire
layers
:
-
Default
-
TransparentFX
...
...
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