Skip to content

Commit

Permalink
feature: 파동게이지 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
kimmoonwoong committed Aug 15, 2022
1 parent 58258d2 commit b03b4a4
Show file tree
Hide file tree
Showing 8 changed files with 826 additions and 792 deletions.
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

0 comments on commit b03b4a4

Please sign in to comment.