Commit c09466d0 authored by 18류지석's avatar 18류지석

공격 조작감 수정

parent c153d52d
......@@ -564,7 +564,7 @@ AnimatorState:
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 1
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
......
......@@ -22,7 +22,7 @@ GameObject:
- component: {fileID: 212265122276445044}
- component: {fileID: 61140323485140024}
- component: {fileID: 114959886973885082}
m_Layer: 0
m_Layer: 18
m_Name: Portal
m_TagString: Untagged
m_Icon: {fileID: 0}
......
......@@ -22,7 +22,7 @@ GameObject:
- component: {fileID: 212036764786901468}
- component: {fileID: 61850414438817898}
- component: {fileID: 114406776515389056}
m_Layer: 13
m_Layer: 18
m_Name: Portal
m_TagString: Untagged
m_Icon: {fileID: 0}
......
......@@ -29,7 +29,7 @@ AnimationClip:
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.06666667
time: 0.13333334
value: 1
inSlope: Infinity
outSlope: Infinity
......@@ -38,7 +38,7 @@ AnimationClip:
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.083333336
time: 0.15
value: 0
inSlope: Infinity
outSlope: Infinity
......@@ -142,7 +142,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0
- serializedVersion: 3
time: 0.2
time: 0.4
value: 0
inSlope: 0
outSlope: 0
......@@ -161,15 +161,15 @@ AnimationClip:
- curve:
- time: 0
value: {fileID: 21300000, guid: adeeef9fb80a0144e89487106b6319eb, type: 3}
- time: 0.033333335
value: {fileID: 21300000, guid: a26ea4c487d60a6469d1449a8e7e3c59, type: 3}
- time: 0.06666667
value: {fileID: 21300000, guid: a26ea4c487d60a6469d1449a8e7e3c59, type: 3}
- time: 0.13333334
value: {fileID: 21300000, guid: f77cb1002f22f134f8058b70bde41e1f, type: 3}
- time: 0.11666667
- time: 0.23333333
value: {fileID: 21300000, guid: bded534b71964eb4c8405bbd9188c0ee, type: 3}
- time: 0.16666667
- time: 0.33333334
value: {fileID: 21300000, guid: 24231df7f90bbdc4b95bb192d9589e68, type: 3}
- time: 0.2
- time: 0.4
value: {fileID: 21300000, guid: 24231df7f90bbdc4b95bb192d9589e68, type: 3}
attribute: m_Sprite
path:
......@@ -243,7 +243,7 @@ AnimationClip:
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.21666667
m_StopTime: 0.4166667
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
......@@ -272,7 +272,7 @@ AnimationClip:
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.06666667
time: 0.13333334
value: 1
inSlope: Infinity
outSlope: Infinity
......@@ -281,7 +281,7 @@ AnimationClip:
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.083333336
time: 0.15
value: 0
inSlope: Infinity
outSlope: Infinity
......@@ -385,7 +385,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0
- serializedVersion: 3
time: 0.2
time: 0.4
value: 0
inSlope: 0
outSlope: 0
......
......@@ -6,6 +6,7 @@ public class PlayerAttack : MonoBehaviour {
public bool[] attack = new bool[3];
public bool cancel;
public bool playingSkill;
private bool comboEndDelay = true;
public float comboTime;
public Text time, combo;
public string comboArray;
......@@ -41,11 +42,13 @@ public class PlayerAttack : MonoBehaviour {
comboTimeOn = false;
}
if (!playingSkill)
if (!playingSkill && playerController.airAttack && comboEndDelay)
{
for (int i = 0; i < 3; i++)
if (attack[i])
{
if (playerController.playerState == PlayerState.GoingUp || playerController.playerState == PlayerState.GoingDown)
playerController.airAttack = false;
comboArray += (char)('A' + i);
CheckCombo();
SetComboText();
......@@ -88,13 +91,19 @@ public class PlayerAttack : MonoBehaviour {
time.text = "";
}
}
IEnumerator ComboEndDelay()
{
comboEndDelay = false;
yield return new WaitForSeconds(0.3f);
comboEndDelay = true;
}
public void SkillEnd()
{
if (CheckLongerCombo()) StartCoroutine(SkillEndCoroutine());
else
{
comboArray = "";
StartCoroutine(ComboEndDelay());
StartCoroutine(ComboTextReset());
}
}
......@@ -114,6 +123,7 @@ public class PlayerAttack : MonoBehaviour {
if (!playingSkill)
{
comboArray = "";
StartCoroutine(ComboEndDelay());
SetComboText();
}
comboTimeOn = false;
......@@ -133,7 +143,7 @@ public class PlayerAttack : MonoBehaviour {
anim.SetTrigger("attack");
item.ComboAction(i);
playingSkill = true;
GetComponent<Rigidbody2D>().velocity = new Vector2(Mathf.Clamp(GetComponent<Rigidbody2D>().velocity.x,-3f,3f), 0);
GetComponent<Rigidbody2D>().velocity = new Vector2(Mathf.Clamp(GetComponent<Rigidbody2D>().velocity.x,-0.5f,0.5f), Mathf.Min(GetComponent<Rigidbody2D>().velocity.y,0));
return;
}
}
......@@ -143,8 +153,9 @@ public class PlayerAttack : MonoBehaviour {
aoc["PlayerAttackAnim"] = normalAttack[comboArray[comboArray.Length - 1] - 'A'];
anim.SetTrigger("attack");
playingSkill = true;
GetComponent<Rigidbody2D>().velocity = new Vector2(Mathf.Clamp(GetComponent<Rigidbody2D>().velocity.x, -3f, 3f), 0);
GetComponent<Rigidbody2D>().velocity = new Vector2(Mathf.Clamp(GetComponent<Rigidbody2D>().velocity.x, -0.5f, 0.5f), Mathf.Min(GetComponent<Rigidbody2D>().velocity.y, 0));
if (!CheckLongerCombo()) comboArray = comboArray[comboArray.Length - 1] + "";
}
bool CheckLongerCombo()
......
......@@ -35,6 +35,7 @@ public class PlayerController : MonoBehaviour
private bool isJumpable = true; // Can player jump or doublejump?
private bool isDownPlatform = false;
private bool ropeEnabled = true;
public bool airAttack = true;
// Inputs
private float horizontal = 0;
private float horizontalRaw = 0;
......@@ -116,8 +117,7 @@ public class PlayerController : MonoBehaviour
{
if (playerState == PlayerState.Attack)
{
rb.gravityScale = rbAttackGravityScale;
return;
rb.gravityScale = rb.velocity.y < 0 ? rbAttackGravityScale : rbGravityScale;
}
if (isGrounded)
......@@ -219,6 +219,8 @@ public class PlayerController : MonoBehaviour
rb.velocity = new Vector2(xVelocity, yVelocity);
}
}
if (playerState != PlayerState.GoingUp && playerState != PlayerState.GoingDown && playerState != PlayerState.Attack)
airAttack = true;
if (previousState != playerState)
switch (playerState)
{
......@@ -229,10 +231,8 @@ public class PlayerController : MonoBehaviour
case PlayerState.GoingDown: anim.SetTrigger("downTrigger"); break;
case PlayerState.Rope: anim.SetTrigger("rope"); break;
}
previousState = playerState;
}
previousState = playerState;
upKeyDown = false;
downKeyDown = false;
jump = false;
......
......@@ -21,9 +21,9 @@ public class SkillPlay : StateMachineBehaviour {
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state
override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
playercontroller.playerState = PlayerState.Idle;
playerattack.playingSkill = false;
playerattack.SkillEnd();
playercontroller.playerState = PlayerState.Idle;
}
// OnStateMove is called right after Animator.OnAnimatorMove(). Code that processes and affects root motion should be implemented here
......
......@@ -30,7 +30,7 @@ TagManager:
- PlayerAttack
- EnemyCollider
- EnemyTrigger
-
- Portal
-
-
-
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment