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
O
Overbrewed
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
Overbrewed
Commits
3645e7a5
Commit
3645e7a5
authored
Sep 22, 2019
by
Sebastian
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
1abbc354
48263014
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
556 additions
and
401 deletions
+556
-401
Assets/_Game/Scenes/Level_0_Overbrewed.unity
Assets/_Game/Scenes/Level_0_Overbrewed.unity
+544
-399
Assets/_Game/Scripts/Customer/CustomerBehaviour.cs
Assets/_Game/Scripts/Customer/CustomerBehaviour.cs
+8
-1
Assets/_Game/Scripts/Customer/CustomerSpawner.cs
Assets/_Game/Scripts/Customer/CustomerSpawner.cs
+4
-1
No files found.
Assets/_Game/Scenes/Level_0_Overbrewed.unity
View file @
3645e7a5
This diff is collapsed.
Click to expand it.
Assets/_Game/Scripts/Customer/CustomerBehaviour.cs
View file @
3645e7a5
...
...
@@ -19,6 +19,7 @@ public class CustomerBehaviour : MonoBehaviour
private
bool
_percTwo
=
false
;
private
bool
_percThree
=
false
;
private
Transform
_despawnPoint
;
private
GameObject
_cameraObject
;
private
NavMeshAgent
_agent
;
private
Order
_customerOrder
;
...
...
@@ -53,6 +54,12 @@ public class CustomerBehaviour : MonoBehaviour
public
NavMeshAgent
Agent
=>
_agent
;
public
Transform
DespawnPoint
{
get
=>
_despawnPoint
;
set
=>
_despawnPoint
=
value
;
}
// Start is called before the first frame update
void
Start
()
{
...
...
@@ -98,7 +105,7 @@ public class CustomerBehaviour : MonoBehaviour
print
(
"I waited too long!!!11!elf"
);
_playerActor
.
AudioSource
.
PlayOneShot
(
_customerSounds
.
GetAngryClip
(),
0.2f
);
_agent
.
SetDestination
(
transform
.
parent
.
position
);
_agent
.
SetDestination
(
_despawnPoint
.
transform
.
position
);
_customerBar
.
gameObject
.
SetActive
(
false
);
_state
=
CustomerState
.
Leaving
;
}
...
...
Assets/_Game/Scripts/Customer/CustomerSpawner.cs
View file @
3645e7a5
...
...
@@ -9,6 +9,7 @@ public class CustomerSpawner : MonoBehaviour
{
[
SerializeField
]
private
List
<
CustomerData
>
possibleCustomers
;
[
SerializeField
]
private
List
<
Transform
>
waitingSpots
;
[
SerializeField
]
private
List
<
Transform
>
despawnSpots
;
[
SerializeField
]
private
float
maxTimeTillNextCustomer
;
[
SerializeField
]
private
float
timeTillFullDifficulty
;
[
SerializeField
]
private
AnimationCurve
timeCurve
;
...
...
@@ -35,11 +36,13 @@ public class CustomerSpawner : MonoBehaviour
// Spawn Customer
int
randomValue
=
Random
.
Range
(
0
,
possibleCustomers
.
Count
-
1
);
GameObject
customerObject
=
Instantiate
(
possibleCustomers
[
randomValue
].
Prefab
,
this
.
transform
);
Instantiate
(
possibleCustomers
[
randomValue
].
Prefab
,
despawnSpots
[
freeSpot
]
);
NavMeshAgent
agent
=
customerObject
.
GetComponent
<
NavMeshAgent
>();
if
(
agent
!=
null
)
{
agent
.
SetDestination
(
waitingSpots
[
freeSpot
].
position
);
customerObject
.
GetComponent
<
CustomerBehaviour
>().
DespawnPoint
=
despawnSpots
[
freeSpot
];
}
customerObject
.
GetComponent
<
CustomerBehaviour
>().
CustomerData
=
possibleCustomers
[
randomValue
].
Order
;
...
...
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