Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
tetra-tower
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Oenos
tetra-tower
Commits
b9b7972e
Commit
b9b7972e
authored
Jan 14, 2019
by
abpo11
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
idle , 걷기, 뛰기, 로프, 점프 상태 구현함. 공격은 애니메이션 틀만 만듬
parent
0cc78875
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
542 additions
and
1 deletion
+542
-1
Player animator.controller
Assets/Animation/Player animator.controller
+501
-0
Player animator.controller.meta
Assets/Animation/Player animator.controller.meta
+8
-0
PlayScene.unity
Assets/Scenes/PlayScene.unity
+19
-0
PlayerController.cs
Assets/Scripts/Characters/PlayerController.cs
+14
-1
No files found.
Assets/Animation/Player animator.controller
0 → 100644
View file @
b9b7972e
This diff is collapsed.
Click to expand it.
Assets/Animation/Player animator.controller.meta
0 → 100644
View file @
b9b7972e
fileFormatVersion: 2
guid: f296ed247a14fdc47aaf4e337d976d96
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:
Assets/Scenes/PlayScene.unity
View file @
b9b7972e
...
...
@@ -215,6 +215,7 @@ GameObject:
-
component
:
{
fileID
:
489222434
}
-
component
:
{
fileID
:
489222438
}
-
component
:
{
fileID
:
489222439
}
-
component
:
{
fileID
:
489222440
}
m_Layer
:
0
m_Name
:
Player
m_TagString
:
Untagged
...
...
@@ -379,6 +380,24 @@ MonoBehaviour:
LCUI
:
{
fileID
:
0
}
ttx
:
0
tty
:
0
---
!u!95
&489222440
Animator
:
serializedVersion
:
3
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
489222433
}
m_Enabled
:
1
m_Avatar
:
{
fileID
:
0
}
m_Controller
:
{
fileID
:
9100000
,
guid
:
f296ed247a14fdc47aaf4e337d976d96
,
type
:
2
}
m_CullingMode
:
0
m_UpdateMode
:
0
m_ApplyRootMotion
:
0
m_LinearVelocityBlending
:
0
m_WarningMessage
:
m_HasTransformHierarchy
:
1
m_AllowConstantClipSamplingOptimization
:
1
m_KeepAnimatorControllerStateOnDisable
:
0
---
!u!1001
&695959412
Prefab
:
m_ObjectHideFlags
:
0
...
...
Assets/Scripts/Characters/PlayerController.cs
View file @
b9b7972e
...
...
@@ -6,7 +6,7 @@ using UnityEngine.Tilemaps;
public
class
PlayerController
:
MonoBehaviour
{
private
Rigidbody2D
rb
;
// RigidBody2D of this game object
private
Animator
anim
;
// Speeds of player
[
SerializeField
]
private
float
maxSpeed
;
...
...
@@ -59,6 +59,7 @@ public class PlayerController : MonoBehaviour
void
Start
()
{
rb
=
gameObject
.
GetComponent
<
Rigidbody2D
>();
anim
=
GetComponent
<
Animator
>();
}
// Update is called once per frame
...
...
@@ -80,6 +81,16 @@ public class PlayerController : MonoBehaviour
if
(
GameManager
.
gameState
==
GameManager
.
GameState
.
Ingame
)
{
anim
.
SetBool
(
"rope"
,
isInRope
);
anim
.
SetBool
(
"run"
,
isDashing
);
anim
.
SetBool
(
"ground"
,
isGrounded
);
anim
.
SetFloat
(
"vspeed"
,
rb
.
velocity
.
y
);
anim
.
SetFloat
(
"speed"
,
Mathf
.
Abs
(
rb
.
velocity
.
x
));
if
(
isGrounded
||
isInRope
)
{
anim
.
SetBool
(
"jump"
,
false
);
}
if
(
isGrounded
)
isJumpable
=
true
;
...
...
@@ -137,10 +148,12 @@ public class PlayerController : MonoBehaviour
if
(
isGrounded
)
{
vertical
=
jumpSpeed
;
anim
.
SetBool
(
"jump"
,
true
);
}
else
if
(
isJumpable
)
{
vertical
=
doubleJumpSpeed
;
anim
.
SetBool
(
"jump"
,
true
);
isJumpable
=
false
;
}
}
...
...
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