Merge branch 'feature/录制模式' into 'develop'
feat(record): 增加录制模式,按ctrl+R See merge request aibis-dream/aibis-dream!737
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using AibisDream.Framework;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -5,9 +6,20 @@ namespace AibisDream.Kit
|
||||
{
|
||||
public class VerText : MonoBehaviour
|
||||
{
|
||||
void Start()
|
||||
private void Start()
|
||||
{
|
||||
GetComponent<TMP_Text>().text = $"Ver.{Application.version}";
|
||||
EnumEventSystem.Global.Register<UIEventEnum, bool>(UIEventEnum.RecordingModeChanged, OnRecordingModeChanged);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
EnumEventSystem.Global.UnRegister<UIEventEnum, bool>(UIEventEnum.RecordingModeChanged, OnRecordingModeChanged);
|
||||
}
|
||||
|
||||
private void OnRecordingModeChanged(bool isRecording)
|
||||
{
|
||||
gameObject.SetActive(!isRecording);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,4 +98,9 @@ namespace AibisDream
|
||||
PauseMenuAmbEnter,
|
||||
PauseMenuAmbExit,
|
||||
}
|
||||
|
||||
public enum UIEventEnum
|
||||
{
|
||||
RecordingModeChanged
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,29 @@ namespace AibisDream
|
||||
#else
|
||||
InitCursor();
|
||||
#endif
|
||||
EnumEventSystem.Global.Register<UIEventEnum, bool>(UIEventEnum.RecordingModeChanged, OnRecordingModeChanged);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
EnumEventSystem.Global.UnRegister<UIEventEnum, bool>(UIEventEnum.RecordingModeChanged, OnRecordingModeChanged);
|
||||
}
|
||||
|
||||
private void OnRecordingModeChanged(bool isRecording)
|
||||
{
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (_cursor != null)
|
||||
{
|
||||
_cursor.gameObject.SetActive(!isRecording);
|
||||
}
|
||||
|
||||
if (isRecording)
|
||||
{
|
||||
Cursor.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void InitCursor()
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace AibisDream
|
||||
public RectTransform DialogCanvas { get; private set; }
|
||||
|
||||
private GraphicRaycaster _raycaster;
|
||||
private bool _isRecordingMode;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -63,6 +64,13 @@ namespace AibisDream
|
||||
ShowPanel<MainPanel>();
|
||||
}
|
||||
}
|
||||
|
||||
if ((Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl))
|
||||
&& Input.GetKeyDown(KeyCode.R))
|
||||
{
|
||||
_isRecordingMode = !_isRecordingMode;
|
||||
EnumEventSystem.Global.Send(UIEventEnum.RecordingModeChanged, _isRecordingMode);
|
||||
}
|
||||
}
|
||||
|
||||
private void InitRefs()
|
||||
|
||||
Reference in New Issue
Block a user