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
f67cf105
Commit
f67cf105
authored
Jan 23, 2019
by
abpo11
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
적폐 청산함. 이전 프로그래머가 남긴 isGrounded 오류 고침.
parent
4031879c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
5 deletions
+38
-5
Player animator.controller
Assets/Animation/Player animator.controller
+28
-0
Player.cs
Assets/Scripts/Characters/Player.cs
+1
-0
PlayerController.cs
Assets/Scripts/Characters/PlayerController.cs
+9
-5
No files found.
Assets/Animation/Player animator.controller
View file @
f67cf105
...
...
@@ -257,6 +257,31 @@ AnimatorState:
m_MirrorParameter
:
m_CycleOffsetParameter
:
m_TimeParameter
:
---
!u!1102
&1102466624416092410
AnimatorState
:
serializedVersion
:
5
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
0
}
m_Name
:
attack
m_Speed
:
1
m_CycleOffset
:
0
m_Transitions
:
[]
m_StateMachineBehaviours
:
[]
m_Position
:
{
x
:
50
,
y
:
50
,
z
:
0
}
m_IKOnFeet
:
0
m_WriteDefaultValues
:
1
m_Mirror
:
0
m_SpeedParameterActive
:
0
m_MirrorParameterActive
:
0
m_CycleOffsetParameterActive
:
0
m_TimeParameterActive
:
0
m_Motion
:
{
fileID
:
7400000
,
guid
:
04c5cf6d7a7e42e429178ba00bd59688
,
type
:
2
}
m_Tag
:
m_SpeedParameter
:
m_MirrorParameter
:
m_CycleOffsetParameter
:
m_TimeParameter
:
---
!u!1102
&1102579710918655568
AnimatorState
:
serializedVersion
:
5
...
...
@@ -383,6 +408,9 @@ AnimatorStateMachine:
-
serializedVersion
:
1
m_State
:
{
fileID
:
1102728463836494206
}
m_Position
:
{
x
:
168
,
y
:
120
,
z
:
0
}
-
serializedVersion
:
1
m_State
:
{
fileID
:
1102466624416092410
}
m_Position
:
{
x
:
203
,
y
:
185
,
z
:
0
}
m_ChildStateMachines
:
[]
m_AnyStateTransitions
:
-
{
fileID
:
1101150420884930214
}
...
...
Assets/Scripts/Characters/Player.cs
View file @
f67cf105
...
...
@@ -5,6 +5,7 @@ using UnityEngine;
public
class
Player
:
MonoBehaviour
{
public
LifeStoneManager
LCUI
;
public
static
int
tx
,
ty
;
public
static
float
X
=
0.7f
,
Y
=
1.6f
;
public
int
ttx
;
public
int
tty
;
Coroutine
roomEnterFadeIn
;
...
...
Assets/Scripts/Characters/PlayerController.cs
View file @
f67cf105
...
...
@@ -231,11 +231,15 @@ public class PlayerController : MonoBehaviour
}
bool
IsGrounded
()
// Is player grounded?
{
RaycastHit2D
hit1
=
Physics2D
.
Raycast
(
transform
.
position
,
Vector2
.
down
,
rayDistance
,
groundLayer
);
RaycastHit2D
hit2
=
Physics2D
.
Raycast
(
transform
.
position
,
Vector2
.
down
,
rayDistance
,
platformLayer
);
RaycastHit2D
hit3
=
Physics2D
.
Raycast
(
transform
.
position
,
Vector2
.
down
,
rayDistance
,
outerwallLayer
);
Debug
.
DrawRay
(
transform
.
position
,
rayDistance
*
Vector2
.
down
,
Color
.
white
);
return
(
hit1
.
collider
!=
null
||
hit2
.
collider
!=
null
||
hit3
.
collider
!=
null
)
&&
rb
.
velocity
.
y
==
0
;
//플랫폼 점프 버그 방지
RaycastHit2D
hit1
=
Physics2D
.
Raycast
(
transform
.
position
+
new
Vector3
(
Player
.
X
/
2f
,
0
,
0
),
Vector2
.
down
,
rayDistance
,
groundLayer
);
RaycastHit2D
hit2
=
Physics2D
.
Raycast
(
transform
.
position
+
new
Vector3
(
Player
.
X
/
2f
,
0
,
0
),
Vector2
.
down
,
rayDistance
,
platformLayer
);
RaycastHit2D
hit3
=
Physics2D
.
Raycast
(
transform
.
position
+
new
Vector3
(
Player
.
X
/
2f
,
0
,
0
),
Vector2
.
down
,
rayDistance
,
outerwallLayer
);
RaycastHit2D
hit4
=
Physics2D
.
Raycast
(
transform
.
position
-
new
Vector3
(
Player
.
X
/
2f
,
0
,
0
),
Vector2
.
down
,
rayDistance
,
groundLayer
);
RaycastHit2D
hit5
=
Physics2D
.
Raycast
(
transform
.
position
-
new
Vector3
(
Player
.
X
/
2f
,
0
,
0
),
Vector2
.
down
,
rayDistance
,
platformLayer
);
RaycastHit2D
hit6
=
Physics2D
.
Raycast
(
transform
.
position
-
new
Vector3
(
Player
.
X
/
2f
,
0
,
0
),
Vector2
.
down
,
rayDistance
,
outerwallLayer
);
Debug
.
DrawRay
(
transform
.
position
+
new
Vector3
(
Player
.
X
/
2f
,
0
,
0
),
rayDistance
*
Vector2
.
down
,
Color
.
white
);
return
(
hit1
.
collider
!=
null
||
hit2
.
collider
!=
null
||
hit3
.
collider
!=
null
||
hit4
.
collider
!=
null
||
hit5
.
collider
!=
null
||
hit6
.
collider
!=
null
)
&&
rb
.
velocity
.
y
==
0
;
//플랫폼 점프 버그 방지
}
bool
IsInRope
()
// Is player in rope?
{
...
...
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