Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

파동게이지 구현 #135

Merged
merged 1 commit into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,574 changes: 793 additions & 781 deletions Project_Blind/Assets/Scenes/김문웅.unity

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public void OnDrawGizmos()

private void MeleeAttack()
{
PlayerCharacter _player = gameObject.GetComponent<PlayerCharacter>();
int facing = -1;
if (sprite.flipX)
{
Expand All @@ -97,7 +98,10 @@ private void MeleeAttack()
{
hitobj.GetComponent<EnemyCharacter>().HP.GetDamage(_damage);
hitobj.GetComponent<EnemyCharacter>().hitted(facing);
canDamage = false;
if (_player.currentWaveGauge + _player.attackWaveGauge < _player.maxWaveGauge)
_player.currentWaveGauge += _player.attackWaveGauge;
else _player.currentWaveGauge = _player.maxWaveGauge;
canDamage = false;
Debug.Log("맞음");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,21 @@ public void FixedUpdate()
{
if (_hitObj.GetComponent<BatMonster>().isAttack())
{
gameObject.GetComponent<PlayerCharacter>().PlayerInvincibility();
PlayerCharacter _player = gameObject.GetComponent<PlayerCharacter>();
_player.PlayerInvincibility();
if (_player.currentWaveGauge + _player.paringWaveGauge < _player.maxWaveGauge)
_player.currentWaveGauge += _player.paringWaveGauge;
else
_player.currentWaveGauge = _player.maxWaveGauge;
_isParing = false;
Debug.Log("패링 성공!");
}
}
else if (_hitObj.gameObject.layer == 10) //10: projectile
{
gameObject.GetComponent<PlayerCharacter>().PlayerInvincibility();
_hitObj.GetComponent<Projectile>().Paring();
_isParing = false;
Debug.Log("패링 성공!");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ public class PlayerCharacter : MonoBehaviour,IGameManagerObj
private GameObject _waveSense;
public bool _isInvincibility;

public int maxWaveGauge;
public float currentWaveGauge;

public float attackWaveGauge;
public float paringWaveGauge;

public bool isOnLava;
private void Awake()
{
Expand Down Expand Up @@ -155,11 +161,12 @@ public void Jump()

public void WaveSensePress()
{
if (InputController.Instance.Wave.Down)
if (InputController.Instance.Wave.Down && currentWaveGauge>=1)
{
if (WaveSense.IsUsing)
return;

currentWaveGauge -= 1f;
SoundManager.Instance.Play("WaveSound", Define.Sound.Effect);

var waveSense = ResourceManager.Instance.Instantiate("WaveSense").GetComponent<WaveSense>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public override void OnSLStateEnter(Animator animator, AnimatorStateInfo stateIn
}
public override void OnSLStatePostEnter(Animator animator,AnimatorStateInfo stateInfo,int layerIndex)
{
if (_monoBehaviour.CheckForPowerAttack()) animator.speed = 0.1f;
if (_monoBehaviour.CheckForPowerAttack() && _monoBehaviour.currentWaveGauge>1) animator.speed = 0.1f;
else
{
if(_monoBehaviour.isJump) _monoBehaviour.AttackableMove(_monoBehaviour._attackMove * _monoBehaviour.GetFacing());
Expand Down Expand Up @@ -46,12 +46,13 @@ public override void OnSLStateNoTransitionUpdate(Animator animator, AnimatorStat
if (_monoBehaviour._clickcount == 0)
_monoBehaviour.MeleeAttackComoEnd();

if (_monoBehaviour.CheckForUpKey())
if (_monoBehaviour.CheckForUpKey() && _monoBehaviour.currentWaveGauge>1)
{
animator.speed = 1.0f;
_monoBehaviour._attack.DamageReset(_monoBehaviour._powerAttackdamage);
_monoBehaviour.enableAttack();
_monoBehaviour.AttackableMove(_monoBehaviour._attackMove * _monoBehaviour.GetFacing());
_monoBehaviour.currentWaveGauge -= 1f;
}
}
public override void OnSLStateExit (Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public override void OnSLStateEnter(Animator animator,AnimatorStateInfo stateInf

public override void OnSLStatePostEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
if (_monoBehaviour.CheckForPowerAttack())
if (_monoBehaviour.CheckForPowerAttack() && _monoBehaviour.currentWaveGauge>1)
{
animator.speed = 0.1f;
}
Expand Down Expand Up @@ -54,12 +54,13 @@ public override void OnSLStateNoTransitionUpdate(Animator animator, AnimatorStat
if(_monoBehaviour._clickcount == 0)
_monoBehaviour.MeleeAttackComoEnd();

if (_monoBehaviour.CheckForUpKey())
if (_monoBehaviour.CheckForUpKey() && _monoBehaviour.currentWaveGauge>1)
{
animator.speed = 1.0f;
_monoBehaviour._attack.DamageReset(_monoBehaviour._powerAttackdamage);
_monoBehaviour.enableAttack();
_monoBehaviour.AttackableMove(_monoBehaviour._attackMove * _monoBehaviour.GetFacing());
_monoBehaviour.currentWaveGauge -= 1f;
}
}
public override void OnSLStateExit (Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public override void OnSLStateEnter(Animator animator,AnimatorStateInfo stateInf

public override void OnSLStatePostEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
if (_monoBehaviour.CheckForPowerAttack())
if (_monoBehaviour.CheckForPowerAttack() && _monoBehaviour.currentWaveGauge>1)
{
animator.speed = 0.1f;
}
Expand All @@ -39,12 +39,13 @@ public override void OnSLStateNoTransitionUpdate(Animator animator, AnimatorStat
}
else _monoBehaviour.GroundedHorizontalMovement(false);

if (_monoBehaviour.CheckForUpKey())
if (_monoBehaviour.CheckForUpKey() && _monoBehaviour.currentWaveGauge>1)
{
animator.speed = 1.0f;
_monoBehaviour._attack.DamageReset(_monoBehaviour._powerAttackdamage);
_monoBehaviour.enableAttack();
_monoBehaviour.AttackableMove(_monoBehaviour._attackMove * _monoBehaviour.GetFacing());
_monoBehaviour.currentWaveGauge -= 1f;
}
}
public override void OnSLStateExit (Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public override void OnSLStateEnter(Animator animator, AnimatorStateInfo stateIn
}

public override void OnSLStatePostEnter(Animator animator,AnimatorStateInfo stateInfo,int layerIndex) {
if (_monoBehaviour.CheckForPowerAttack())
if (_monoBehaviour.CheckForPowerAttack() && _monoBehaviour.currentWaveGauge>1)
{
animator.speed = 0.1f;
}
Expand Down Expand Up @@ -51,12 +51,13 @@ public override void OnSLStateNoTransitionUpdate(Animator animator, AnimatorStat
_monoBehaviour.MeleeAttackCombo1();


if (_monoBehaviour.CheckForUpKey())
if (_monoBehaviour.CheckForUpKey() && _monoBehaviour.currentWaveGauge>1)
{
animator.speed = 1.0f;
_monoBehaviour._attack.DamageReset(_monoBehaviour._powerAttackdamage);
_monoBehaviour.enableAttack();
_monoBehaviour.AttackableMove(_monoBehaviour._attackMove * _monoBehaviour.GetFacing());
_monoBehaviour.currentWaveGauge -= 1f;
}

}
Expand Down