Skip to content
GitLab
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
3885ea5f
Commit
3885ea5f
authored
Mar 28, 2019
by
mthiele2
Browse files
Die Adresse für Singles und Akademiker mit Niveau.
parent
72d47e84
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Assets/_Game/Data/Player Data/Movement Data/Movement States.asset
View file @
3885ea5f
...
...
@@ -22,13 +22,13 @@ MonoBehaviour:
mass
:
0.1
gravity
:
0.5
earthMoveState
:
jumpForce
:
10
jumpForce
:
10
0
smoothing
:
0.03
airControl
:
1
canSwim
:
0
moveSpeed
:
15
maxJumpCount
:
1
mass
:
2
0
mass
:
6
0
gravity
:
3
fireMoveState
:
jumpForce
:
15
...
...
Assets/_Game/Prefabs/Enemies/Erd-Gegner.prefab
View file @
3885ea5f
...
...
@@ -10,11 +10,11 @@ GameObject:
m_Component
:
-
component
:
{
fileID
:
4738352637052488
}
-
component
:
{
fileID
:
50191559781069916
}
-
component
:
{
fileID
:
61920140733709488
}
-
component
:
{
fileID
:
212219553255752332
}
-
component
:
{
fileID
:
114326583413855364
}
-
component
:
{
fileID
:
114716552753954768
}
m_Layer
:
0
-
component
:
{
fileID
:
7710007422906786959
}
m_Layer
:
13
m_Name
:
Erd-Gegner
m_TagString
:
Enemy
m_Icon
:
{
fileID
:
0
}
...
...
@@ -57,32 +57,6 @@ Rigidbody2D:
m_SleepingMode
:
1
m_CollisionDetection
:
0
m_Constraints
:
4
---
!u!61
&61920140733709488
BoxCollider2D
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1634356314439590
}
m_Enabled
:
1
m_Density
:
1
m_Material
:
{
fileID
:
0
}
m_IsTrigger
:
0
m_UsedByEffector
:
0
m_UsedByComposite
:
0
m_Offset
:
{
x
:
-0.012068242
,
y
:
0.0043426454
}
m_SpriteTilingProperty
:
border
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
0
}
pivot
:
{
x
:
0.5
,
y
:
0.5
}
oldSize
:
{
x
:
0.35
,
y
:
0.32
}
newSize
:
{
x
:
0.4
,
y
:
0.41
}
adaptiveTilingThreshold
:
0.5
drawMode
:
0
adaptiveTiling
:
0
m_AutoTiling
:
0
serializedVersion
:
2
m_Size
:
{
x
:
0.36456764
,
y
:
0.33278835
}
m_EdgeRadius
:
0
---
!u!212
&212219553255752332
SpriteRenderer
:
m_ObjectHideFlags
:
0
...
...
@@ -143,10 +117,6 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
f478e74f0ce26d74e9ef7a03777a0e06
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
aggroDist
:
6
attackDist
:
5
detectionRange
:
50
isInCombat
:
0
desiredAction
:
[]
---
!u!114
&114716552753954768
MonoBehaviour
:
...
...
@@ -160,9 +130,27 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
57d175ecd2f7e53468c6c7467bdb8980
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
weight
:
0
weight
:
1
isPerformingAction
:
0
movementSpeed
:
5
aggroRange
:
0
dropAggroRange
:
0
---
!u!58
&7710007422906786959
CircleCollider2D
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1634356314439590
}
m_Enabled
:
1
m_Density
:
1
m_Material
:
{
fileID
:
0
}
m_IsTrigger
:
0
m_UsedByEffector
:
0
m_UsedByComposite
:
0
m_Offset
:
{
x
:
0
,
y
:
0
}
serializedVersion
:
2
m_Radius
:
0.175
---
!u!1
&7480494801806484534
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -174,7 +162,7 @@ GameObject:
-
component
:
{
fileID
:
5151316259711694663
}
-
component
:
{
fileID
:
7574451920411087056
}
-
component
:
{
fileID
:
5069815732207941033
}
m_Layer
:
0
m_Layer
:
13
m_Name
:
Erdangriff
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
...
...
Assets/_Game/Prefabs/Enemies/Feuer-Gegner.prefab
View file @
3885ea5f
...
...
@@ -14,9 +14,9 @@ GameObject:
-
component
:
{
fileID
:
212219553255752332
}
-
component
:
{
fileID
:
114326583413855364
}
-
component
:
{
fileID
:
5627041003248903908
}
m_Layer
:
0
m_Layer
:
13
m_Name
:
Feuer-Gegner
m_TagString
:
Enemy
m_TagString
:
Fire
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
...
...
@@ -28,7 +28,7 @@ Transform:
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1634356314439590
}
m_LocalRotation
:
{
x
:
-
0
,
y
:
-
0
,
z
:
-
0
,
w
:
1
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
-823.3
,
y
:
-198.56
,
z
:
0
}
m_LocalScale
:
{
x
:
4
,
y
:
4
,
z
:
4
}
m_Children
:
...
...
@@ -143,10 +143,6 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
f478e74f0ce26d74e9ef7a03777a0e06
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
aggroDist
:
15
attackDist
:
20
detectionRange
:
50
isInCombat
:
0
desiredAction
:
[]
---
!u!114
&5627041003248903908
MonoBehaviour
:
...
...
@@ -160,20 +156,17 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
8e4c71447eda4674fae6842ae29f3b31
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
weight
:
0
weight
:
3
isPerformingAction
:
0
Cooldown
:
2
attackRange
:
8
d
amag
e
:
0
shot
:
{
fileID
:
1870586037468468
,
guid
:
61411254df3161c4e81f6c0a4f2cd33c
,
typ
e
:
3
}
fire
Speed
:
2
d
estroyTim
e
:
1
damag
e
:
1
fire
Ball
:
{
fileID
:
1870586037468468
,
guid
:
61411254df3161c4e81f6c0a4f2cd33c
,
type
:
3
}
volleySize
:
3
pooledAmount
:
10
launchPower
:
10
attackSpeed
:
0.5
shotspawn
:
{
fileID
:
2944414297440889058
}
cluster
:
0
ricochet
:
0
---
!u!1
&8738143122139646636
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -183,7 +176,7 @@ GameObject:
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
2944414297440889058
}
m_Layer
:
0
m_Layer
:
13
m_Name
:
ShotSpawn
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
...
...
Assets/_Game/Prefabs/Enemies/Wasser-Gegner.prefab
View file @
3885ea5f
...
...
@@ -10,13 +10,13 @@ GameObject:
m_Component
:
-
component
:
{
fileID
:
4738352637052488
}
-
component
:
{
fileID
:
50191559781069916
}
-
component
:
{
fileID
:
61920140733709488
}
-
component
:
{
fileID
:
212219553255752332
}
-
component
:
{
fileID
:
114326583413855364
}
-
component
:
{
fileID
:
95191711148098072
}
-
component
:
{
fileID
:
7642390674257080637
}
-
component
:
{
fileID
:
2887302863579586647
}
m_Layer
:
0
-
component
:
{
fileID
:
380768153646748734
}
m_Layer
:
13
m_Name
:
Wasser-Gegner
m_TagString
:
Water
m_Icon
:
{
fileID
:
0
}
...
...
@@ -59,32 +59,6 @@ Rigidbody2D:
m_SleepingMode
:
1
m_CollisionDetection
:
0
m_Constraints
:
4
---
!u!61
&61920140733709488
BoxCollider2D
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1634356314439590
}
m_Enabled
:
1
m_Density
:
1
m_Material
:
{
fileID
:
0
}
m_IsTrigger
:
0
m_UsedByEffector
:
0
m_UsedByComposite
:
0
m_Offset
:
{
x
:
0.0041066036
,
y
:
-0.01091028
}
m_SpriteTilingProperty
:
border
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
0
}
pivot
:
{
x
:
0.5
,
y
:
0.5
}
oldSize
:
{
x
:
0.35
,
y
:
0.32
}
newSize
:
{
x
:
0.4
,
y
:
0.41
}
adaptiveTilingThreshold
:
0.5
drawMode
:
0
adaptiveTiling
:
0
m_AutoTiling
:
0
serializedVersion
:
2
m_Size
:
{
x
:
0.2950111
,
y
:
0.2057061
}
m_EdgeRadius
:
0
---
!u!212
&212219553255752332
SpriteRenderer
:
m_ObjectHideFlags
:
0
...
...
@@ -145,9 +119,6 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
f478e74f0ce26d74e9ef7a03777a0e06
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
aggroDist
:
15
detectionRange
:
50
isInCombat
:
0
desiredAction
:
[]
---
!u!95
&95191711148098072
Animator
:
...
...
@@ -198,6 +169,27 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
m_MaxLife
:
1
LostLife
:
m_PersistentCalls
:
m_Calls
:
[]
m_TypeName
:
UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
---
!u!58
&380768153646748734
CircleCollider2D
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1634356314439590
}
m_Enabled
:
1
m_Density
:
1
m_Material
:
{
fileID
:
0
}
m_IsTrigger
:
0
m_UsedByEffector
:
0
m_UsedByComposite
:
0
m_Offset
:
{
x
:
0.008957936
,
y
:
-0.019715749
}
serializedVersion
:
2
m_Radius
:
0.11049381
---
!u!1
&8757578769013443562
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -209,7 +201,7 @@ GameObject:
-
component
:
{
fileID
:
4632333845714261479
}
-
component
:
{
fileID
:
630870635
}
-
component
:
{
fileID
:
630870634
}
m_Layer
:
0
m_Layer
:
13
m_Name
:
GroundCheck
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
...
...
Assets/_Game/Prefabs/Enemies/Wind-Gegner.prefab
View file @
3885ea5f
...
...
@@ -16,7 +16,7 @@ GameObject:
-
component
:
{
fileID
:
114716552753954768
}
-
component
:
{
fileID
:
8582909611794385439
}
-
component
:
{
fileID
:
879798643589630551
}
m_Layer
:
0
m_Layer
:
13
m_Name
:
Wind-Gegner
m_TagString
:
Enemy
m_Icon
:
{
fileID
:
0
}
...
...
@@ -33,7 +33,8 @@ Transform:
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
-822.9
,
y
:
-198.59
,
z
:
0
}
m_LocalScale
:
{
x
:
2.6
,
y
:
2.6
,
z
:
2.6
}
m_Children
:
[]
m_Children
:
-
{
fileID
:
1344694553418298308
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
...
...
@@ -144,9 +145,6 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
f478e74f0ce26d74e9ef7a03777a0e06
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
aggroDist
:
6
detectionRange
:
10
isInCombat
:
0
desiredAction
:
[]
---
!u!114
&114716552753954768
MonoBehaviour
:
...
...
@@ -163,6 +161,8 @@ MonoBehaviour:
weight
:
2
isPerformingAction
:
0
movementSpeed
:
3
aggroRange
:
5
dropAggroRange
:
7
---
!u!114
&8582909611794385439
MonoBehaviour
:
m_ObjectHideFlags
:
0
...
...
@@ -175,7 +175,7 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
dc36894bc57123a46b6aff239612cfda
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
weight
:
6
weight
:
1
isPerformingAction
:
0
patrolRange
:
5
targetPos
:
{
fileID
:
0
}
...
...
@@ -193,9 +193,42 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
7f52887a9ca8e98419e0fa123a56c1f0
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
weight
:
4
weight
:
3
isPerformingAction
:
0
windAttack
:
{
fileID
:
1870586037468468
,
guid
:
933b1befd6720dd4da76308e96bf977c
,
type
:
3
}
Cooldown
:
0.5
attackRange
:
3
firePower
:
5
damage
:
1
destroyTime
:
1
thrust
:
20
---
!u!1
&3664861546676776734
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
1344694553418298308
}
m_Layer
:
13
m_Name
:
Patrolspot
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&1344694553418298308
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
3664861546676776734
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
4738352637052488
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
Assets/_Game/Prefabs/Enemy Attacks/EnemyFireAttack.prefab
View file @
3885ea5f
...
...
@@ -14,7 +14,7 @@ GameObject:
-
component
:
{
fileID
:
212152556601460820
}
-
component
:
{
fileID
:
1090173842203658878
}
m_Layer
:
0
m_Name
:
Pre_
FireAttack
m_Name
:
Enemy
FireAttack
m_TagString
:
EnemyShot
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
...
...
@@ -46,7 +46,7 @@ Rigidbody2D:
m_Simulated
:
1
m_UseFullKinematicContacts
:
0
m_UseAutoMass
:
0
m_Mass
:
1
m_Mass
:
0.000
1
m_LinearDrag
:
0
m_AngularDrag
:
0.05
m_GravityScale
:
5
...
...
@@ -131,6 +131,5 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
ee14ca5ce55a64141aba6d8091d3ecb7
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
destroyTime
:
0
damage
:
0
nearestPlayer
:
{
fileID
:
0
}
destroyTime
:
1
Assets/_Game/Scenes/Max-Level.unity
View file @
3885ea5f
This diff is collapsed.
Click to expand it.
Assets/_Game/Scripts/Enemy AI/Earth/RockAttack.cs
View file @
3885ea5f
...
...
@@ -39,10 +39,6 @@ public class RockAttack : WeightedAction {
return
;
}
Vector2
dir
=
Vector2
.
zero
;
direction
=
dir
;
weight
=
10f
;
myAI
.
desiredAction
.
Add
(
this
);
...
...
Assets/_Game/Scripts/Enemy AI/Fire/AI_FireAttack.cs
View file @
3885ea5f
...
...
@@ -10,20 +10,13 @@ public class AI_FireAttack : WeightedAction
public
float
Cooldown
;
public
float
attackRange
;
public
float
destroyTime
;
public
int
damage
;
public
GameObject
fireBall
;
public
float
fireSpeed
=
2f
;
public
int
volleySize
;
public
int
pooledAmount
=
10
;
public
float
launchPower
=
20
;
public
float
launchPower
;
public
float
attackSpeed
;
public
Transform
shotspawn
;
public
bool
cluster
;
public
bool
ricochet
;
private
Rigidbody2D
body
;
// Use this for initialization
...
...
@@ -44,10 +37,6 @@ public class AI_FireAttack : WeightedAction
return
;
}
Vector2
dir
=
Vector2
.
zero
;
direction
=
dir
;
myAI
.
desiredAction
.
Add
(
this
);
}
...
...
@@ -71,6 +60,7 @@ public class AI_FireAttack : WeightedAction
{
launchPower
+=
3
;
GameObject
projectile
=
Instantiate
(
fireBall
,
shotspawn
.
position
,
shotspawn
.
rotation
);
projectile
.
GetComponent
<
AI_FireProjectile
>().
damage
=
damage
;
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 @
3885ea5f
...
...
@@ -2,33 +2,19 @@ using UnityEngine;
public
class
AI_FireProjectile
:
MonoBehaviour
{
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
()
{
Invoke
(
"Destroy"
,
destroyTime
);
}
void
Destroy
()
{
Destroy
(
gameObject
);
}
public
int
damage
;
private
void
OnTriggerEnter2D
(
Collider2D
other
)
{
if
(
other
.
CompareTag
(
"Player"
))
if
(
other
.
CompareTag
(
"Fire"
))
{
return
;
}
if
(
other
.
CompareTag
(
"Player"
))
{
other
.
GetComponentInParent
<
Life
>().
Damage
(
damage
);
}
Destroy
();
Destroy
(
gameObject
);
}
}
Assets/_Game/Scripts/Enemy AI/Generell/AI_Core.cs
View file @
3885ea5f
...
...
@@ -3,11 +3,6 @@ using System;
using
System.Collections.Generic
;
public
class
AI_Core
:
MonoBehaviour
{
public
float
aggroDist
=
15
;
public
float
detectionRange
=
50
;
public
bool
isInCombat
;
public
List
<
WeightedAction
>
desiredAction
;
...
...
Assets/_Game/Scripts/Enemy AI/Generell/AI_DashAttack.cs
View file @
3885ea5f
...
...
@@ -40,10 +40,6 @@ public class AI_DashAttack : WeightedAction
}
}
Vector2
dir
=
Vector2
.
zero
;
direction
=
dir
;
myAI
.
desiredAction
.
Add
(
this
);
}
...
...
Assets/_Game/Scripts/Enemy AI/Generell/AI_Follows.cs
View file @
3885ea5f
...
...
@@ -12,6 +12,12 @@ public class AI_Follows : WeightedAction
private
Animator
animator
;
private
bool
isFollowing
;
public
float
aggroRange
;
public
float
dropAggroRange
;
private
void
Awake
()
{
animator
=
gameObject
.
GetComponent
<
Animator
>();
...
...
@@ -21,38 +27,28 @@ public class AI_Follows : WeightedAction
void
Start
()
{
myAI
=
GetComponent
<
AI_Core
>();
myAI
.
isInCombat
=
false
;
}
void
CheckConditions
()
{
// print("Name: " + gameObject.name + " is in Combat: " + myAI.isInCombat);
{
nearestPlayer
=
myAI
.
findNearestPlayer
();
float
dist
=
Vector3
.
Distance
(
transform
.
position
,
nearestPlayer
.
transform
.
position
);
if
(
dist
>
myAI
.
detection
Range
)
if
(
dist
>
dropAggro
Range
)
{
myAI
.
isInCombat
=
false
;
isFollowing
=
false
;
}
if
(!
myAI
.
isInCombat
)
if
(!
isFollowing
)
{
if
(
dist
>
myAI
.
aggroDist
)
if
(
dist
>
aggroRange
)
{
return
;
}
myAI
.
isInCombat
=
true
;
return
;
}
isFollowing
=
true
;
}
Vector2
dir
=
nearestPlayer
.
transform
.
position
-
this
.
transform
.
position
;
dir
.
Normalize
();
direction
=
dir
;
myAI
.
desiredAction
.
Add
(
this
);
}
...
...
Assets/_Game/Scripts/Enemy AI/Generell/AI_Staggers.cs
View file @
3885ea5f
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
...
...
@@ -36,7 +36,6 @@ public class AI_Staggers : WeightedAction {
public
override
void
performAction
()
{
Debug
.
Log
(
"test"
);
if
(
remainingStaggerTime
>
0f
)
{
remainingStaggerTime
-=
Time
.
deltaTime
;
...
...
Assets/_Game/Scripts/Enemy AI/Generell/AI_Wanders.cs
View file @
3885ea5f
...
...
@@ -51,18 +51,6 @@ public class AI_Wanders : WeightedAction
{
transform
.
position
=
Vector2
.
MoveTowards
(
transform
.
position
,
patrolSpot
,
speed
*
Time
.
deltaTime
);
Vector2
dir
=
patrolSpot
-
this
.
transform
.
position
;
dir
.
Normalize
();
direction
=
dir
;
// Fraction of journey completed = current distance divided by total distance.
//float fracJourney = ((Time.time - startTime) * speed) / journeyLength;
// Set our position as a fraction of the distance between the markers.
//transform.position = Vector3.Lerp(transform.position, patrolSpot, fracJourney);