[Feat] 키보드로 대시, 어택 시 화면 터치처럼 보이는 기능
This commit is contained in:
parent
b0ca516778
commit
ffb5cec6b4
@ -62,6 +62,9 @@ public class PlayerController : CharacterBase, IObserver<GameObject>
|
|||||||
public bool IsBattle => _isBattle;
|
public bool IsBattle => _isBattle;
|
||||||
public Transform DashEffectAnchor => dashEffectAnchor;
|
public Transform DashEffectAnchor => dashEffectAnchor;
|
||||||
|
|
||||||
|
[Header("대시, 어택 터치 연출용")]
|
||||||
|
[SerializeField] private DungeonPanelController dungeonPanelController;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
if (Joystick == null)
|
if (Joystick == null)
|
||||||
@ -114,6 +117,7 @@ public class PlayerController : CharacterBase, IObserver<GameObject>
|
|||||||
// 대시 우선 입력 처리
|
// 대시 우선 입력 처리
|
||||||
if (Input.GetKeyDown(KeyCode.Space))
|
if (Input.GetKeyDown(KeyCode.Space))
|
||||||
{
|
{
|
||||||
|
dungeonPanelController.DashTouchMotion();
|
||||||
StartDashAction();
|
StartDashAction();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -122,6 +126,7 @@ public class PlayerController : CharacterBase, IObserver<GameObject>
|
|||||||
if (Input.GetKeyDown(KeyCode.X) && (_currentAction == null || !_currentAction.IsActive)
|
if (Input.GetKeyDown(KeyCode.X) && (_currentAction == null || !_currentAction.IsActive)
|
||||||
&& (CurrentState != PlayerState.Win && CurrentState != PlayerState.Dead))
|
&& (CurrentState != PlayerState.Win && CurrentState != PlayerState.Dead))
|
||||||
{
|
{
|
||||||
|
dungeonPanelController.AttackTouchMotion();
|
||||||
GameManager.Instance.PlayPlayerAttackSound();
|
GameManager.Instance.PlayPlayerAttackSound();
|
||||||
StartAttackAction();
|
StartAttackAction();
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,11 @@ public class DungeonPanelController : MonoBehaviour
|
|||||||
private int _countHealth = 0;
|
private int _countHealth = 0;
|
||||||
private int visibleHeartCount = 3; // 강화 레벨로 설정됨
|
private int visibleHeartCount = 3; // 강화 레벨로 설정됨
|
||||||
|
|
||||||
|
//PC 키보드 입력 시 버튼 색상 변경
|
||||||
|
[SerializeField] private GameObject dashPressedImage;
|
||||||
|
[SerializeField] private GameObject attackPressedImage;
|
||||||
|
private float pressedTime = .1f;
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
int level = UpgradeManager.Instance.upgradeStat.CurrentUpgradeLevel(StatType.Heart); // 1~3
|
int level = UpgradeManager.Instance.upgradeStat.CurrentUpgradeLevel(StatType.Heart); // 1~3
|
||||||
@ -50,4 +55,36 @@ public class DungeonPanelController : MonoBehaviour
|
|||||||
{
|
{
|
||||||
yield return new WaitForSeconds(1.0f);
|
yield return new WaitForSeconds(1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region PC입력 동안 버튼 색상 변경
|
||||||
|
|
||||||
|
public void DashTouchMotion()
|
||||||
|
{
|
||||||
|
StopCoroutine(DashButtonColorChange());
|
||||||
|
StartCoroutine(DashButtonColorChange());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AttackTouchMotion()
|
||||||
|
{
|
||||||
|
StopCoroutine(AttackButtonColorChange());
|
||||||
|
StartCoroutine(AttackButtonColorChange());
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerator DashButtonColorChange()
|
||||||
|
{
|
||||||
|
dashPressedImage.SetActive(true);
|
||||||
|
yield return new WaitForSeconds(pressedTime);
|
||||||
|
dashPressedImage.SetActive(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
private IEnumerator AttackButtonColorChange()
|
||||||
|
{
|
||||||
|
attackPressedImage.SetActive(true);
|
||||||
|
yield return new WaitForSeconds(pressedTime);
|
||||||
|
attackPressedImage.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
BIN
Assets/KSH/ReDungeon.unity
(Stored with Git LFS)
BIN
Assets/KSH/ReDungeon.unity
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/LIN/Prefabs/Attack Button Image.prefab
(Stored with Git LFS)
Normal file
BIN
Assets/LIN/Prefabs/Attack Button Image.prefab
(Stored with Git LFS)
Normal file
Binary file not shown.
7
Assets/LIN/Prefabs/Attack Button Image.prefab.meta
Normal file
7
Assets/LIN/Prefabs/Attack Button Image.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8822dc0c2e8b5bc498036a19194f8827
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/LIN/Prefabs/Dash Button Image.prefab
(Stored with Git LFS)
Normal file
BIN
Assets/LIN/Prefabs/Dash Button Image.prefab
(Stored with Git LFS)
Normal file
Binary file not shown.
7
Assets/LIN/Prefabs/Dash Button Image.prefab.meta
Normal file
7
Assets/LIN/Prefabs/Dash Button Image.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 76f779210ea250641b4559dfc6d379b5
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/LIN/ReDungeon UI Copy.unity
(Stored with Git LFS)
Normal file
BIN
Assets/LIN/ReDungeon UI Copy.unity
(Stored with Git LFS)
Normal file
Binary file not shown.
7
Assets/LIN/ReDungeon UI Copy.unity.meta
Normal file
7
Assets/LIN/ReDungeon UI Copy.unity.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ce2ba637dd19c434fa2eb509c2ad4270
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/LIN/ReHousing Loding Anim.unity
(Stored with Git LFS)
BIN
Assets/LIN/ReHousing Loding Anim.unity
(Stored with Git LFS)
Binary file not shown.
@ -16,6 +16,7 @@ public class InteractionController : MonoBehaviour
|
|||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
|
PlayerStats.Instance.OnWorked -= SuddenAfterWorkEventHappen;
|
||||||
PlayerStats.Instance.OnWorked += SuddenAfterWorkEventHappen;
|
PlayerStats.Instance.OnWorked += SuddenAfterWorkEventHappen;
|
||||||
PlayerStats.Instance.SetInteractionPanelController(interactionAnimationPanelController);
|
PlayerStats.Instance.SetInteractionPanelController(interactionAnimationPanelController);
|
||||||
}
|
}
|
||||||
@ -116,6 +117,7 @@ public class InteractionController : MonoBehaviour
|
|||||||
// Interaction Controller와 같은 방식으로 작동됩니다.
|
// Interaction Controller와 같은 방식으로 작동됩니다.
|
||||||
private void SuddenAfterWorkEventHappen()
|
private void SuddenAfterWorkEventHappen()
|
||||||
{
|
{
|
||||||
|
PlayerStats.Instance.OnWorked -= SuddenAfterWorkEventHappen;
|
||||||
AfterWorkEventType afterWorkEventType = SuddenEventCalculator();
|
AfterWorkEventType afterWorkEventType = SuddenEventCalculator();
|
||||||
if (afterWorkEventType == AfterWorkEventType.None) return;
|
if (afterWorkEventType == AfterWorkEventType.None) return;
|
||||||
|
|
||||||
|
BIN
Assets/Prefabs/ReDungeon/Canvas.prefab
(Stored with Git LFS)
BIN
Assets/Prefabs/ReDungeon/Canvas.prefab
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/Prefabs/ReHousing/Canvas.prefab
(Stored with Git LFS)
BIN
Assets/Prefabs/ReHousing/Canvas.prefab
(Stored with Git LFS)
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user