Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MI 455 Project 3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Show more breadcrumbs
startcat
MI 455 Project 3
Commits
444628bc
Commit
444628bc
authored
1 year ago
by
Henry
Browse files
Options
Downloads
Patches
Plain Diff
there can be only 1
parent
f439a2bf
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Assets/Scripts/PowerUps/Glider.cs
+0
-32
0 additions, 32 deletions
Assets/Scripts/PowerUps/Glider.cs
Assets/Scripts/PowerUps/Speed.cs
+0
-51
0 additions, 51 deletions
Assets/Scripts/PowerUps/Speed.cs
Assets/Scripts/PowerUps/Speed.cs.meta
+0
-11
0 additions, 11 deletions
Assets/Scripts/PowerUps/Speed.cs.meta
with
0 additions
and
94 deletions
Assets/Scripts/PowerUps/Glider.cs
deleted
100644 → 0
+
0
−
32
View file @
f439a2bf
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
Glider
:
MonoBehaviour
{
[
Range
(
0f
,
20f
)]
public
float
activeTime
=
10f
;
[
Range
(
0f
,
-
20f
)]
public
float
glideFallSpeed
=
-
1f
;
private
void
OnTriggerEnter
(
Collider
other
)
{
if
(
other
.
gameObject
.
CompareTag
(
"Player"
))
{
StartCoroutine
(
GliderActive
(
other
));
gameObject
.
transform
.
position
=
new
Vector3
(
0
,
-
10000
,
0
);
}
}
public
IEnumerator
GliderActive
(
Collider
collision
)
{
var
roller
=
collision
.
gameObject
.
GetComponent
<
Roll
>();
roller
.
glideFallSpeed
=
glideFallSpeed
;
roller
.
gliding
=
true
;
yield
return
new
WaitForSeconds
(
activeTime
);
roller
.
gliding
=
false
;
Destroy
(
gameObject
);
}
}
This diff is collapsed.
Click to expand it.
Assets/Scripts/PowerUps/Speed.cs
deleted
100644 → 0
+
0
−
51
View file @
f439a2bf
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
Speed
:
MonoBehaviour
{
[
Range
(
1f
,
10f
)]
public
float
speedMultiplier
=
1f
;
[
Range
(
0f
,
20f
)]
public
float
activeTime
=
3f
;
[
Range
(
0f
,
10f
)]
public
float
speedFallOffTime
=
1f
;
public
bool
refillStamina
=
false
;
public
bool
freezeStamina
=
false
;
public
bool
respawn
=
false
;
public
float
resawnTime
=
10f
;
private
void
OnTriggerEnter
(
Collider
other
)
{
if
(
other
.
gameObject
.
CompareTag
(
"Player"
))
{
var
roller
=
other
.
gameObject
.
GetComponent
<
Roll
>();
roller
.
powerUpDecay
=
speedFallOffTime
;
roller
.
powerUpDecayTime
=
speedFallOffTime
;
roller
.
powerUpActiveTime
=
activeTime
;
roller
.
powerUpSpeedMulti
=
speedMultiplier
;
if
(
refillStamina
)
{
roller
.
sprintTimeCurrent
=
roller
.
sprintTimeTotal
;
}
if
(
freezeStamina
)
{
StartCoroutine
(
LockStamina
(
roller
));
}
else
if
(
respawn
)
{
StartCoroutine
(
RespawnTimer
());
}
else
{
Destroy
(
gameObject
);
}
}
}
public
IEnumerator
LockStamina
(
Roll
roller
)
{
roller
.
staminaLocked
=
true
;
gameObject
.
transform
.
position
=
new
Vector3
(
0
,
-
10000
,
0
);
yield
return
new
WaitForSeconds
(
activeTime
);
roller
.
staminaLocked
=
false
;
Destroy
(
gameObject
);
}
public
IEnumerator
RespawnTimer
()
{
var
startPos
=
transform
.
position
;
gameObject
.
transform
.
position
=
new
Vector3
(
0
,
-
10000
,
0
);
yield
return
new
WaitForSeconds
(
resawnTime
);
gameObject
.
transform
.
position
=
startPos
;
}
}
This diff is collapsed.
Click to expand it.
Assets/Scripts/PowerUps/Speed.cs.meta
deleted
100644 → 0
+
0
−
11
View file @
f439a2bf
fileFormatVersion: 2
guid: ecf2472dc6cc0e24e8bf9aa0dc6ca890
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
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