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

공격 조작감 수정

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