Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Game_jam19
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Maintenance moved to Monday 17.3. at 13:00. ETA 60 - 90 minutes.
Show more breadcrumbs
Leevi Grönlund
Game_jam19
Commits
23aef899
Commit
23aef899
authored
6 years ago
by
Petteri
Browse files
Options
Downloads
Patches
Plain Diff
outcrop changes
parent
e40f5f08
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Assets/Scripts/Resources/Outcrop.cs
+6
-7
6 additions, 7 deletions
Assets/Scripts/Resources/Outcrop.cs
with
6 additions
and
7 deletions
Assets/Scripts/Resources/Outcrop.cs
+
6
−
7
View file @
23aef899
...
...
@@ -8,13 +8,13 @@ public class Outcrop : MonoBehaviour
[
SerializeField
]
private
int
wood
;
private
int
woodNeeded
=
100
;
private
readonly
int
woodNeeded
=
100
;
[
SerializeField
]
private
GameObject
quarry
;
private
GameObject
quarry
=
null
;
[
SerializeField
]
private
Resource
neededResource
;
private
Resource
neededResource
=
null
;
public
Resource
getNeededResource
()
{
...
...
@@ -28,12 +28,12 @@ public class Outcrop : MonoBehaviour
public
void
setAmount
(
int
amount
)
{
wood
+
=
amount
;
wood
=
amount
;
}
public
void
checkExistence
()
{
if
(
getAmount
()
>=
100
)
if
(
getAmount
()
>=
woodNeeded
)
{
GameObject
go
=
Instantiate
<
GameObject
>(
quarry
);
go
.
transform
.
position
=
this
.
transform
.
position
;
...
...
@@ -45,12 +45,11 @@ public class Outcrop : MonoBehaviour
{
setAmount
(
getAmount
()
+
amount
);
checkExistence
();
woodNeeded
-=
getAmount
();
}
public
int
stillNeeded
()
{
return
woodNeeded
;
return
woodNeeded
-
wood
;
}
// Start is called before the first frame update
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment