This commit is contained in:
SoulliesOfficial
2025-09-06 21:58:48 -04:00
parent 7a188f725d
commit 64c84ac685
21 changed files with 206 additions and 335 deletions

View File

@@ -213,7 +213,7 @@ Material:
- _Dst: 10
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EdgeValue: 0.49106154
- _EdgeValue: 0.9525006
- _EnvironmentReflections: 1
- _FNLfanxiangkaiguan: 0
- _Face: 1
@@ -258,7 +258,7 @@ Material:
- _Mask_scale: 1
- _Metallic: 0
- _OcclusionStrength: 1
- _Opacity: 0.50893843
- _Opacity: 0.04749942
- _Parallax: 0.005
- _Pass: 0
- _QueueOffset: 0

View File

@@ -3002,143 +3002,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 340068461}
m_CullTransparentMesh: 1
--- !u!1 &342052442
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 342052446}
- component: {fileID: 342052445}
- component: {fileID: 342052444}
- component: {fileID: 342052443}
m_Layer: 0
m_Name: Camera
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &342052443
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 342052442}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_RenderShadows: 1
m_RequiresDepthTextureOption: 2
m_RequiresOpaqueTextureOption: 2
m_CameraType: 0
m_Cameras: []
m_RendererIndex: -1
m_VolumeLayerMask:
serializedVersion: 2
m_Bits: 1
m_VolumeTrigger: {fileID: 0}
m_VolumeFrameworkUpdateModeOption: 2
m_RenderPostProcessing: 0
m_Antialiasing: 0
m_AntialiasingQuality: 2
m_StopNaN: 0
m_Dithering: 0
m_ClearDepth: 1
m_AllowXRRendering: 1
m_AllowHDROutput: 1
m_UseScreenCoordOverride: 0
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
m_RequiresDepthTexture: 0
m_RequiresColorTexture: 0
m_Version: 2
m_TaaSettings:
m_Quality: 3
m_FrameInfluence: 0.1
m_JitterScale: 1
m_MipBias: 0
m_VarianceClampScale: 0.9
m_ContrastAdaptiveSharpening: 0
--- !u!81 &342052444
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 342052442}
m_Enabled: 1
--- !u!20 &342052445
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 342052442}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &342052446
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 342052442}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -3.4338784, y: -0.18502262, z: 310.91315}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &354327107
GameObject:
m_ObjectHideFlags: 0
@@ -19924,4 +19787,3 @@ SceneRoots:
- {fileID: 1806683416}
- {fileID: 759709588}
- {fileID: 570979741}
- {fileID: 342052446}

View File

@@ -2517,7 +2517,7 @@ MonoBehaviour:
m_text: Back
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 87c1b020037c81841b3d98dd497cbdeb, type: 2}
m_sharedMaterial: {fileID: -5812992765432063453, guid: 19a92ec938f7b364dad1975875f9fe3a,
m_sharedMaterial: {fileID: -5812992765432063453, guid: 87c1b020037c81841b3d98dd497cbdeb,
type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
@@ -2581,7 +2581,7 @@ MonoBehaviour:
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 1
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!222 &272824273
@@ -12057,7 +12057,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1119493264
RectTransform:
m_ObjectHideFlags: 0
@@ -12977,6 +12977,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
isReturnedFromGame: 0
isReturnedFromTutorial: 0
chapter: {fileID: 0}
song:
songName:
@@ -13053,7 +13054,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1211674714
RectTransform:
m_ObjectHideFlags: 0
@@ -13185,7 +13186,7 @@ CanvasGroup:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1211674713}
m_Enabled: 1
m_Alpha: 1
m_Alpha: 0
m_Interactable: 1
m_BlocksRaycasts: 1
m_IgnoreParentGroups: 0

View File

@@ -119,7 +119,7 @@ namespace Ichni.RhythmGame
attachedGameElement.gameObject.SetActive(false);
disableAction?.Invoke();
}
});
}).AddTo(attachedGameElement);
}
}

View File

@@ -25,7 +25,7 @@ namespace Ichni.RhythmGame
flick.Initialize(elementName, id, tags, isFirstGenerated, parentElement);
flick.exactJudgeTime = exactJudgeTime;
flick.availableFlickDirections = new List<Vector2>() { Vector2.left, Vector2.right };
//flick.availableFlickDirections = new List<Vector2>() { Vector2.left, Vector2.right };
flick.judgeIntervals = new NoteJudgeIntervals(
new TimeInterval(-0.15f, -0.15f), new TimeInterval(-0.15f, -0.15f),
new TimeInterval(-0.15f, -0.15f), new TimeInterval(-0.15f, 0.15f),
@@ -85,11 +85,7 @@ namespace Ichni.RhythmGame
float timeDifference = triggerTime - exactJudgeTime;
NoteJudgeType startJudgeType = GetStartJudgeType(timeDifference);
if (startJudgeType != NoteJudgeType.Perfect)
{
return;
}
RemoveFromCheckingList();
preJudgeType = startJudgeType;
@@ -127,6 +123,42 @@ namespace Ichni.RhythmGame
isFinalJudged = true;
}
}
public void ExecuteTapJudge()
{
RemoveFromCheckingList();
float triggerTime = GameManager.instance.songTime;
float timeDifference = triggerTime - exactJudgeTime;
NoteJudgeType startJudgeType = GetStartJudgeType(timeDifference);
if (startJudgeType == NoteJudgeType.Perfect)
{
Perfect(triggerTime);
GameManager.instance.playingRecorder.resultData.Add(0);
}
else if (startJudgeType == NoteJudgeType.Good)
{
Good(triggerTime);
}
else if (startJudgeType == NoteJudgeType.Bad)
{
Bad(triggerTime);
}
else if (startJudgeType == NoteJudgeType.Miss)
{
Miss(triggerTime);
}
if (startJudgeType != NoteJudgeType.Miss)
{
noteAudioSubmodule.PlayGeneralJudgeAudios();
}
isFirstJudged = true;
isFinalJudged = true;
}
}
public partial class Flick

View File

@@ -127,10 +127,6 @@ public class GameInputManager : MonoBehaviour
GameManager.instance.noteJudgeManager.SetNewInputUnitSwipe(id, position, isGeneric, isFirst, direction);
}
// =====================================================================
// 核心处理逻辑 (Core Processing Logic)
// =====================================================================
#if UNITY_STANDALONE
/// <summary>
@@ -315,7 +311,7 @@ public class GameInputManager : MonoBehaviour
if (holdingSwipe0)
{
Vector2 inputPosition = new Vector2(Screen.width * 0.5f, 200f);
OnSwipe(0, inputPosition, true, Vector2.zero);
OnSwipe(0, inputPosition, true, false, Vector2.zero);
}
}
#endif
@@ -362,8 +358,7 @@ public class GameInputManager : MonoBehaviour
if (_activeTouches.TryGetValue(touchId, out TouchState movedState))
{
OnTouch(touchId, position);
DetectSwipe(movedState, _activeTouches[touchId].isFirstSwipe, position);
//_activeTouches[touchId].isFirstSwipe = false;
DetectSwipe(movedState, position);
}
break;
@@ -401,7 +396,7 @@ public class GameInputManager : MonoBehaviour
/// <summary>
/// 检测划动逻辑 (无需修改)
/// </summary>
private void DetectSwipe(TouchState state, bool isFirst, Vector2 currentPosition)
private void DetectSwipe(TouchState state, Vector2 currentPosition)
{
Vector2 swipeVector = currentPosition - state.StartPosition;
if (swipeVector.magnitude < minSwipeDistance) return;
@@ -411,10 +406,11 @@ public class GameInputManager : MonoBehaviour
// 检查是否是新的划动方向
if (Vector2.Dot(direction, state.LastSwipeDirection) <= swipeAngleThreshold)
{
OnSwipe(state.TouchId, state.StartPosition, false, isFirst, direction);
OnSwipe(state.TouchId, state.StartPosition, false, state.isFirstSwipe, direction);
state.LastSwipeDirection = direction;
state.StartPosition = currentPosition;
state.StartTime = Time.time;
state.isFirstSwipe = false;
}
}

View File

@@ -74,7 +74,7 @@ namespace Ichni
public static void ReturnToMenu()
{
InformationTransistor.instance.isReturnedFromGame = true;
//InformationTransistor.instance.isReturnedFromGame = true;
SceneManager.LoadScene("MenuScene");
Time.timeScale = 1f; // 确保返回时时间缩放恢复正常
}

View File

@@ -36,6 +36,9 @@ namespace Ichni
return;
}
List<InputUnitSwipe> tapSwipeList = inputUnitSwipeList.Where(x => x.isFirst).ToList();
List<InputUnitSwipe> holdSwipeList = inputUnitSwipeList.Where(x => !x.isFirst).ToList();
foreach (InputUnitTap inputUnitTap in inputUnitTapList)
{
List<Tap> availableTaps = new List<Tap>();
@@ -61,8 +64,8 @@ namespace Ichni
if (haveHold && haveTap)
{
List<Hold> minHolds = GetAllMinHolds(availableHolds);
List<Tap> minTaps = GetAllMinTaps(availableTaps);
List<Hold> minHolds = GetAllMinNotes(availableHolds);
List<Tap> minTaps = GetAllMinNotes(availableTaps);
Hold closestHold = minHolds[0];
Tap closestTap = minTaps[0];
if (closestHold.exactJudgeTime < closestTap.exactJudgeTime)
@@ -73,7 +76,7 @@ namespace Ichni
}
else
{
GetNearestHold(minHolds, inputUnitTap.inputPosition).ExecuteStartJudge();
GetNearestNote(minHolds, inputUnitTap.inputPosition).ExecuteStartJudge();
}
}
else
@@ -84,40 +87,64 @@ namespace Ichni
}
else
{
GetNearestTap(minTaps, inputUnitTap.inputPosition).ExecuteStartJudge();
GetNearestNote(minTaps, inputUnitTap.inputPosition).ExecuteStartJudge();
}
}
}
else if (haveHold)
{
List<Hold> minHolds = GetAllMinHolds(availableHolds);
List<Hold> minHolds = GetAllMinNotes(availableHolds);
if (minHolds.Count == 1)
{
minHolds[0].ExecuteStartJudge();
}
else
{
GetNearestHold(minHolds, inputUnitTap.inputPosition).ExecuteStartJudge();
GetNearestNote(minHolds, inputUnitTap.inputPosition).ExecuteStartJudge();
}
}
else if (haveTap)
{
List<Tap> minTaps = GetAllMinTaps(availableTaps);
List<Tap> minTaps = GetAllMinNotes(availableTaps);
if (minTaps.Count == 1)
{
minTaps[0].ExecuteStartJudge();
}
else
{
GetNearestTap(minTaps, inputUnitTap.inputPosition).ExecuteStartJudge();
GetNearestNote(minTaps, inputUnitTap.inputPosition).ExecuteStartJudge();
}
}
}
foreach (InputUnitSwipe inputUnitSwipe in inputUnitSwipeList)
foreach (InputUnitSwipe tapSwipe in tapSwipeList)
{
List<Flick> availableFlicks = new List<Flick>();
foreach (Flick flick in checkingFlickList)
{
if (flick.CheckJudgeAvailability(tapSwipe))
{
availableFlicks.Add(flick);
}
}
List<Flick> minFlicks = GetAllMinNotes(availableFlicks);
if (minFlicks.Count == 1)
{
minFlicks[0].ExecuteStartJudge();
}
else if (minFlicks.Count > 1)
{
GetNearestNote(minFlicks, tapSwipe.inputPosition).ExecuteTapJudge();
}
}
foreach (InputUnitSwipe inputUnitSwipe in holdSwipeList)
{
List<Flick> availableFlicks = new List<Flick>();
foreach (Flick flick in checkingFlickList)
{
if (flick.CheckJudgeAvailability(inputUnitSwipe))
@@ -200,69 +227,31 @@ namespace Ichni
public partial class NoteJudgeManager
{
private List<Tap> GetAllMinTaps(List<Tap> availableTaps)
private List<T> GetAllMinNotes<T>(List<T> availableFlicks) where T : NoteBase
{
List<Tap> minTaps = new List<Tap>();
List<T> minFlicks = new List<T>();
float minTime = float.MaxValue;
foreach (Tap tap in availableTaps)
foreach (T flick in availableFlicks)
{
if (tap.exactJudgeTime < minTime)
if (flick.exactJudgeTime < minTime)
{
minTime = tap.exactJudgeTime;
minTaps.Clear();
minTaps.Add(tap);
minTime = flick.exactJudgeTime;
minFlicks.Clear();
minFlicks.Add(flick);
}
else if (Mathf.Approximately(tap.exactJudgeTime, minTime))
else if (Mathf.Approximately(flick.exactJudgeTime, minTime))
{
minTaps.Add(tap);
minFlicks.Add(flick);
}
}
return minTaps;
return minFlicks;
}
private List<Hold> GetAllMinHolds(List<Hold> availableHolds)
{
List<Hold> minHolds = new List<Hold>();
float minTime = float.MaxValue;
foreach (Hold hold in availableHolds)
{
if (hold.exactJudgeTime < minTime)
{
minTime = hold.exactJudgeTime;
minHolds.Clear();
minHolds.Add(hold);
}
else if (Mathf.Approximately(hold.exactJudgeTime, minTime))
{
minHolds.Add(hold);
}
}
return minHolds;
}
private Tap GetNearestTap(List<Tap> notes, Vector2 inputPosition)
private T GetNearestNote<T>(List<T> notes, Vector2 inputPosition) where T : NoteBase
{
float minDistance = float.MaxValue;
Tap closestNote = null;
foreach (Tap note in notes)
{
float distance = Vector2.Distance(inputPosition, note.noteScreenPosition);
if (distance < minDistance)
{
minDistance = distance;
closestNote = note;
}
}
return closestNote;
}
private Hold GetNearestHold(List<Hold> notes, Vector2 inputPosition)
{
float minDistance = float.MaxValue;
Hold closestNote = null;
foreach (Hold note in notes)
T closestNote = null;
foreach (T note in notes)
{
float distance = Vector2.Distance(inputPosition, note.noteScreenPosition);
if (distance < minDistance)

View File

@@ -12,6 +12,7 @@ namespace Ichni
public static InformationTransistor instance;
public bool isReturnedFromGame;
public bool isReturnedFromTutorial;
public ChapterSelectionUnit chapter;
public SongItemData song;
@@ -30,6 +31,7 @@ namespace Ichni
instance = this;
DontDestroyOnLoad(gameObject);
isReturnedFromGame = false;
isReturnedFromTutorial = false;
}
else
{

View File

@@ -54,6 +54,13 @@ namespace Ichni
new SongSelectionRecord(InformationTransistor.instance.song, InformationTransistor.instance.difficulty));
songSelectionUIPage.FadeIn();
}
else if (InformationTransistor.instance.isReturnedFromTutorial)
{
startUIPage.mainCanvasGroup.gameObject.SetActive(false);
ChapterSelectionManager.instance.currentChapter = InformationTransistor.instance.chapter;
MenuAudioManager.instance.audioContainer.SetSwitch(ChapterSelectionManager.instance.currentChapter.chapterSwitch);
storyUIPage.FadeIn();
}
Application.targetFrameRate = SettingsManager.instance.gameSettings.targetFrame;
asyncOperation = SceneManager.LoadSceneAsync("GameScene");
@@ -63,7 +70,14 @@ namespace Ichni
public partial class MenuManager
{
public void TestEnterGame()
public void EnterGame()
{
InformationTransistor.instance.isReturnedFromTutorial = false;
InformationTransistor.instance.isReturnedFromGame = true;
EnterGameScene();
}
public void EnterGameScene()
{
MenuInputManager.instance.gameInput.Menu.Disable();
asyncOperation.allowSceneActivation = true;

View File

@@ -1,8 +1,10 @@
using System;
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using Ichni.Menu;
using TMPro;
using UniRx;
using UnityEngine;
using UnityEngine.UI;
@@ -36,13 +38,14 @@ namespace Ichni.Story.UI
SongItemData song = ChapterSelectionManager.instance.tutorialCollection.songs[chapter.chapterIndex];
DifficultyData difficulty = song.difficultyDataList[0];
InformationTransistor.instance.SetInformation(chapter, song, difficulty);
InformationTransistor.instance.isReturnedFromTutorial = true;
InformationTransistor.instance.isReturnedFromGame = false;
MenuAudioManager.instance.audioContainer.PlaySoundFX("EnterToGame");
MenuAudioManager.instance.audioContainer.StopEvent("PlayPreview");
DOTween.KillAll();
MenuManager.instance.TestEnterGame();
Observable.Timer(TimeSpan.FromSeconds(0.6f)).Subscribe(_ => { MenuManager.instance.EnterGameScene(); });
}
}
}

View File

@@ -53,7 +53,7 @@ namespace Ichni.Menu
MenuManager.instance.transitionUIPage.FadeIn();
Observable.Timer(TimeSpan.FromSeconds(0.6f)).Subscribe(_ =>
{
MenuManager.instance.TestEnterGame();
MenuManager.instance.EnterGame();
});
});

View File

@@ -62,7 +62,7 @@ namespace Ichni.Menu
Observable.Timer(TimeSpan.FromSeconds(0.6f)).Subscribe(_ =>
{
MenuManager.instance.TestEnterGame();
MenuManager.instance.EnterGame();
});
}
else

View File

@@ -88,19 +88,19 @@ MonoBehaviour:
m_PrefilterXRKeywords: 1
m_PrefilteringModeForwardPlus: 2
m_PrefilteringModeDeferredRendering: 0
m_PrefilteringModeScreenSpaceOcclusion: 2
m_PrefilteringModeScreenSpaceOcclusion: 0
m_PrefilterDebugKeywords: 1
m_PrefilterWriteRenderingLayers: 1
m_PrefilterHDROutput: 1
m_PrefilterSSAODepthNormals: 0
m_PrefilterSSAODepthNormals: 1
m_PrefilterSSAOSourceDepthLow: 1
m_PrefilterSSAOSourceDepthMedium: 1
m_PrefilterSSAOSourceDepthHigh: 1
m_PrefilterSSAOInterleaved: 0
m_PrefilterSSAOInterleaved: 1
m_PrefilterSSAOBlueNoise: 1
m_PrefilterSSAOSampleCountLow: 1
m_PrefilterSSAOSampleCountMedium: 1
m_PrefilterSSAOSampleCountHigh: 0
m_PrefilterSSAOSampleCountHigh: 1
m_PrefilterDBufferMRT1: 1
m_PrefilterDBufferMRT2: 1
m_PrefilterDBufferMRT3: 1

View File

@@ -27,6 +27,11 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
if (note == null) throw new System.Exception("NoteVisual只能生成在Note下。");
this.note = note;
note.noteVisual = this;
if (note is Flick flick)
{
flick.availableFlickDirections = new List<Vector2>() { Vector2.left, Vector2.right };
}
}
public override void AfterInitialize()