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
S
Suck It
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
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
W
Wintersemester 2018-2019
Unity
Suck It
Commits
7cf6460a
Commit
7cf6460a
authored
Mar 28, 2019
by
Unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
som small stuff
parent
f116ba90
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
28 deletions
+30
-28
Assets/_Game/Scripts/Interaction.meta
Assets/_Game/Scripts/Interaction.meta
+0
-8
Assets/_Game/Scripts/Player/MovementController.cs
Assets/_Game/Scripts/Player/MovementController.cs
+30
-20
No files found.
Assets/_Game/Scripts/Interaction.meta
deleted
100644 → 0
View file @
f116ba90
fileFormatVersion: 2
guid: 5782222d4c9b9424ea96676650e643a8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/_Game/Scripts/Player/MovementController.cs
View file @
7cf6460a
...
...
@@ -7,6 +7,8 @@ using _Game.Scripts.Scriptable_Object;
[
RequireComponent
(
typeof
(
Rigidbody2D
),
typeof
(
CapsuleCollider2D
))]
public
class
MovementController
:
MonoBehaviour
{
[
SerializeField
]
private
PlayerState
r_State
;
[
Header
(
"Movement"
)]
[
SerializeField
]
private
float
m_Speed
=
10f
;
[
SerializeField
]
private
float
m_JumpForce
=
400f
;
// Amount of force added when the player jumps.
[
SerializeField
]
private
float
m_fallMultiplier
=
2.5f
;
...
...
@@ -59,26 +61,6 @@ public class MovementController : MonoBehaviour
m_Rigidbody2D
.
gravityScale
=
state
.
gravity
;
}
public
void
SetSwimming
(
bool
value
)
{
m_Swimming
=
value
;
if
(
value
)
{
OnSwimEvent
.
Invoke
();
m_TempJumpCount
=
m_MaxJumpCount
;
}
}
public
bool
Swimming
{
get
=>
m_Swimming
;
}
public
bool
Grounded
{
get
=>
m_Grounded
;
}
private
void
Awake
()
{
m_Rigidbody2D
=
GetComponent
<
Rigidbody2D
>();
...
...
@@ -106,6 +88,7 @@ public class MovementController : MonoBehaviour
OnLandEvent.Invoke ();
}
}*/
Vector3
pos
=
m_GroundCheck
.
position
+
new
Vector3
(
m_GroundedOffset
.
x
,
m_GroundedOffset
.
y
,
0
);
var
c
=
Physics2D
.
CircleCast
(
pos
,
m_GroundedRadius
,
Vector2
.
down
,
m_ContactFilter2D
,
m_RaycastHits2D
,
m_GroundCheckDistance
);
...
...
@@ -123,6 +106,8 @@ public class MovementController : MonoBehaviour
}
}
public
void
Move
(
Vector2
move
,
bool
jump
)
{
//Debug.Log(m_Swimming);
...
...
@@ -175,6 +160,31 @@ public class MovementController : MonoBehaviour
}
}
public
void
SetSwimming
(
bool
value
)
{
m_Swimming
=
value
;
if
(
value
)
{
OnSwimEvent
.
Invoke
();
m_TempJumpCount
=
m_MaxJumpCount
;
}
}
public
bool
Swimming
{
get
=>
m_Swimming
;
}
public
bool
Grounded
{
get
=>
m_Grounded
;
}
public
void
AddJumpCharge
(
int
amount
)
{
m_TempJumpCount
+=
amount
;
}
private
IEnumerator
Wait
(
float
s
)
{
m_Jumped
=
true
;
...
...
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