SFX fixed,AxiAxis统一

This commit is contained in:
sin365 2025-03-06 14:37:50 +08:00
parent 1e502e1777
commit 9221806669
9 changed files with 48 additions and 32 deletions

View File

@ -74,7 +74,7 @@ namespace Assets.Script.AppMain.AxiInput.Settings
return false; return false;
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
{ {
if (list[i].IsKey()) if (list[i].GetKey())
return true; return true;
} }
return false; return false;
@ -86,7 +86,7 @@ namespace Assets.Script.AppMain.AxiInput.Settings
return false; return false;
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
{ {
if (list[i].IsKeyUp()) if (list[i].GetKeyUp())
return true; return true;
} }
return false; return false;
@ -98,7 +98,7 @@ namespace Assets.Script.AppMain.AxiInput.Settings
return false; return false;
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
{ {
if (list[i].IsKeyDown()) if (list[i].GetKeyDown())
return true; return true;
} }
return false; return false;
@ -128,7 +128,7 @@ namespace Assets.Script.AppMain.AxiInput.Settings
for (int i = 0; i < AxiInputArr.Length; i++) for (int i = 0; i < AxiInputArr.Length; i++)
{ {
if (AxiInputArr[i].IsKey()) if (AxiInputArr[i].GetKey())
return true; return true;
} }
return false; return false;

View File

@ -130,7 +130,7 @@ namespace Assets.Script.AppMain.AxiInput.Settings
return false; return false;
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
{ {
if (list[i].IsKey()) if (list[i].GetKey())
return true; return true;
} }
return false; return false;
@ -142,7 +142,7 @@ namespace Assets.Script.AppMain.AxiInput.Settings
return false; return false;
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
{ {
if (list[i].IsKeyUp()) if (list[i].GetKeyUp())
return true; return true;
} }
return false; return false;
@ -155,7 +155,7 @@ namespace Assets.Script.AppMain.AxiInput.Settings
return false; return false;
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
{ {
if (list[i].IsKeyDown()) if (list[i].GetKeyDown())
return true; return true;
} }
return false; return false;
@ -199,7 +199,7 @@ namespace Assets.Script.AppMain.AxiInput.Settings
for (int i = 0; i < AxiInputArr.Length; i++) for (int i = 0; i < AxiInputArr.Length; i++)
{ {
if (AxiInputArr[i].IsKey()) if (AxiInputArr[i].GetKey())
return true; return true;
} }
return false; return false;

View File

@ -106,7 +106,7 @@ namespace Assets.Script.AppMain.AxiInput.Settings
return false; return false;
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
{ {
if (list[i].IsKey()) if (list[i].GetKey())
return true; return true;
} }
return false; return false;
@ -118,7 +118,7 @@ namespace Assets.Script.AppMain.AxiInput.Settings
return false; return false;
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
{ {
if (list[i].IsKeyUp()) if (list[i].GetKeyUp())
return true; return true;
} }
return false; return false;
@ -131,7 +131,7 @@ namespace Assets.Script.AppMain.AxiInput.Settings
return false; return false;
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
{ {
if (list[i].IsKeyDown()) if (list[i].GetKeyDown())
return true; return true;
} }
return false; return false;
@ -161,7 +161,7 @@ namespace Assets.Script.AppMain.AxiInput.Settings
for (int i = 0; i < AxiInputArr.Length; i++) for (int i = 0; i < AxiInputArr.Length; i++)
{ {
if (AxiInputArr[i].IsKey()) if (AxiInputArr[i].GetKey())
return true; return true;
} }
return false; return false;

View File

@ -29,7 +29,7 @@ namespace Assets.Script.AppMain.AxiInput
return data; return data;
} }
public static bool IsKeyDown(this AxiInput axiInput) public static bool GetKeyDown(this AxiInput axiInput)
{ {
switch (axiInput.type) switch (axiInput.type)
{ {
@ -44,7 +44,7 @@ namespace Assets.Script.AppMain.AxiInput
} }
} }
public static bool IsKeyUp(this AxiInput axiInput) public static bool GetKeyUp(this AxiInput axiInput)
{ {
switch (axiInput.type) switch (axiInput.type)
{ {
@ -59,7 +59,7 @@ namespace Assets.Script.AppMain.AxiInput
} }
} }
public static bool IsKey(this AxiInput axiInput) public static bool GetKey(this AxiInput axiInput)
{ {
switch (axiInput.type) switch (axiInput.type)
{ {

View File

@ -120,7 +120,6 @@ namespace AxibugEmuOnline.Client.UI
targetPosition, targetPosition,
HoriRollSpd) HoriRollSpd)
.SetSpeedBased(); .SetSpeedBased();
App.audioMgr.PlaySFX(AudioMgr.E_SFXTYPE.Option);
} }
else else
{ {
@ -131,11 +130,13 @@ namespace AxibugEmuOnline.Client.UI
protected override void OnCmdSelectItemLeft() protected override void OnCmdSelectItemLeft()
{ {
SelectIndex--; SelectIndex--;
App.audioMgr.PlaySFX(AudioMgr.E_SFXTYPE.Option);
} }
protected override void OnCmdSelectItemRight() protected override void OnCmdSelectItemRight()
{ {
SelectIndex++; SelectIndex++;
App.audioMgr.PlaySFX(AudioMgr.E_SFXTYPE.Option);
} }
#if UNITY_EDITOR #if UNITY_EDITOR

View File

@ -108,7 +108,6 @@ namespace AxibugEmuOnline.Client.UI
if (m_select) OnSelected(m_progress); if (m_select) OnSelected(m_progress);
}); });
App.audioMgr.PlaySFX(AudioMgr.E_SFXTYPE.Cursor);
} }
protected virtual void OnSelected(float progress) { } protected virtual void OnSelected(float progress) { }

View File

@ -1,4 +1,5 @@
using DG.Tweening; using AxibugEmuOnline.Client.ClientCore;
using DG.Tweening;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
@ -303,16 +304,21 @@ namespace AxibugEmuOnline.Client
protected override void OnCmdSelectItemDown() protected override void OnCmdSelectItemDown()
{ {
SelectIndex++; SelectIndex++;
//TODO 已经到底的情况下,不播放音效
App.audioMgr.PlaySFX(AudioMgr.E_SFXTYPE.Option);
} }
protected override void OnCmdSelectItemUp() protected override void OnCmdSelectItemUp()
{ {
SelectIndex--; SelectIndex--;
//TODO 已经到顶的情况下,不播放音效
App.audioMgr.PlaySFX(AudioMgr.E_SFXTYPE.Option);
} }
protected override void OnCmdBack() protected override void OnCmdBack()
{ {
Hide(); Hide();
App.audioMgr.PlaySFX(AudioMgr.E_SFXTYPE.Cancel);
} }
protected override void OnCmdSelectItemLeft() protected override void OnCmdSelectItemLeft()
@ -341,8 +347,8 @@ namespace AxibugEmuOnline.Client
var executer = m_runtimeMenuItems[SelectIndex]; var executer = m_runtimeMenuItems[SelectIndex];
bool cancelHide = false; bool cancelHide = false;
executer.OnExecute(this, ref cancelHide); executer.OnExecute(this, ref cancelHide);
if (!cancelHide) Hide(); if (!cancelHide) Hide();
App.audioMgr.PlaySFX(AudioMgr.E_SFXTYPE.Option);
return false; return false;
} }

View File

@ -1,4 +1,5 @@
using AxibugEmuOnline.Client.UI; using AxibugEmuOnline.Client.ClientCore;
using AxibugEmuOnline.Client.UI;
using DG.Tweening; using DG.Tweening;
using DG.Tweening.Core; using DG.Tweening.Core;
using DG.Tweening.Plugins.Options; using DG.Tweening.Plugins.Options;
@ -68,8 +69,8 @@ namespace AxibugEmuOnline.Client
LaunchUI.Instance.ToDetailMenuLayout(); LaunchUI.Instance.ToDetailMenuLayout();
var item = GetItemUIByIndex(SelectIndex); var item = GetItemUIByIndex(SelectIndex);
item.SetSelectState(false); item.SetSelectState(false);
App.audioMgr.PlaySFX(AudioMgr.E_SFXTYPE.Option);
return true; return true;
} }
@ -79,19 +80,29 @@ namespace AxibugEmuOnline.Client
LaunchUI.Instance.ToMainMenuLayout(); LaunchUI.Instance.ToMainMenuLayout();
var item = GetItemUIByIndex(SelectIndex); var item = GetItemUIByIndex(SelectIndex);
item.SetSelectState(true); item.SetSelectState(true);
//TODO 已经关闭三级菜单的情况下 不播放
App.audioMgr.PlaySFX(AudioMgr.E_SFXTYPE.Cancel);
} }
protected override void OnCmdSelectItemUp() protected override void OnCmdSelectItemUp()
{ {
if (m_enteredItem == null) if (m_enteredItem == null)
SelectIndex--; {
SelectIndex--;
//TODO 已经到底的情况下,不播放音效
App.audioMgr.PlaySFX(AudioMgr.E_SFXTYPE.Option);
}
} }
protected override void OnCmdSelectItemDown() protected override void OnCmdSelectItemDown()
{ {
if (m_enteredItem == null) if (m_enteredItem == null)
SelectIndex++; {
SelectIndex++;
//TODO 已经到顶的情况下,不播放音效
App.audioMgr.PlaySFX(AudioMgr.E_SFXTYPE.Option);
}
} }
public virtual void SetSelect(bool select) public virtual void SetSelect(bool select)
@ -119,9 +130,9 @@ namespace AxibugEmuOnline.Client
protected override void OnCmdSelectItemLeft() protected override void OnCmdSelectItemLeft()
{ {
base.OnCmdSelectItemLeft(); base.OnCmdSelectItemLeft();
OnCmdBack(); OnCmdBack();
App.audioMgr.PlaySFX(AudioMgr.E_SFXTYPE.Cancel);
} }
protected override void OnSelectMenuChanged() protected override void OnSelectMenuChanged()

View File

@ -39,8 +39,7 @@ namespace AxibugEmuOnline.Client
if (InfoNode != null) InfoNode.alpha = m_progress; if (InfoNode != null) InfoNode.alpha = m_progress;
Root.localScale = Vector3.one * Mathf.Lerp(UnSelectScale, SelectScale, m_progress); Root.localScale = Vector3.one * Mathf.Lerp(UnSelectScale, SelectScale, m_progress);
}); });
App.audioMgr.PlaySFX(AudioMgr.E_SFXTYPE.Cursor);
} }
public override bool OnEnterItem() public override bool OnEnterItem()