Note判定自定义模块
This commit is contained in:
@@ -14,7 +14,6 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
refId:
|
||||
_Keys:
|
||||
- {fileID: 2800000, guid: 188dfe7e559f13248ba2c41eb5a59328, type: 3}
|
||||
- {fileID: 1919712600670392048, guid: 1eef181acaca89841a32060c68923043, type: 3}
|
||||
- {fileID: 2800000, guid: a7ec9e7ad8b847b7ae4510af83c5d868, type: 3}
|
||||
- {fileID: 6297248396536211320, guid: 1eef181acaca89841a32060c68923043, type: 3}
|
||||
@@ -29,7 +28,6 @@ MonoBehaviour:
|
||||
- {fileID: 2810288035678671647, guid: d00706ed05d0c4a55943214fad99b6cd, type: 3}
|
||||
- {fileID: 8147460192610872400, guid: 7440905e187024cd9ad8923844776f82, type: 3}
|
||||
- {fileID: 2800000, guid: 3028dc075ba8c584d9bc7d1e0255e038, type: 3}
|
||||
- {fileID: 2800000, guid: f20112bdeec2e8d4d9f80e8390e37263, type: 3}
|
||||
- {fileID: 2800000, guid: b0f85f7da5042c0448a526d5ecacbfa9, type: 3}
|
||||
- {fileID: 1956055908472055274, guid: c6a552686f72142bb8708e162c31d3ff, type: 3}
|
||||
- {fileID: 7531565761125080649, guid: c6a552686f72142bb8708e162c31d3ff, type: 3}
|
||||
@@ -43,4 +41,16 @@ MonoBehaviour:
|
||||
- {fileID: 2800000, guid: 80694812942b91b42bc4aad99071ba7e, type: 3}
|
||||
- {fileID: 2800000, guid: 0b9510d2790829140953392aae2b6679, type: 3}
|
||||
- {fileID: 21300000, guid: 0b9510d2790829140953392aae2b6679, type: 3}
|
||||
_Values: f2730aff09f37c37febc7fe765b0407bac90167906740a2a8c8e90345544ac394753b1a281922a4e7e358b9883b18c46114589015196ee4776dac15926adab1e4620c9a232d1ed566ec628c1efb3c0693a954d39e3d36066f7d0f7b20b638d2be0a95163e7ea141dcc1f6b7591d3a73ee5a8df6ea08ec51a2f7b5ab115bf731b799b52d05b53bb1a949134651819880de72e3b2ecf0dbc66f70629b01243766dcd4f9bcf7dee1e4185b3b64b611e3b6ddb9f15d3e773b400f9c3036d9fa280501bc798c97db9902b9e9549f346d5832eb56db8a23f89a7640733ce3e6d52283bf75ba0ec3738db26
|
||||
- {fileID: 2800000, guid: ee148e281f3c41c5b4ff5f8a5afe5a6c, type: 3}
|
||||
- {fileID: 2800000, guid: 3ee40aa79cd242a5b53b0b0ca4f13f0f, type: 3}
|
||||
- {fileID: 2800000, guid: 2fd6421f253b4ef1a19526541f9ffc0c, type: 3}
|
||||
- {fileID: 2800000, guid: f66c4aa44c09b6a42a2b5b9f9334d824, type: 3}
|
||||
- {fileID: 2800000, guid: 93f09189124b21e479fc891dbc1b93bf, type: 3}
|
||||
- {fileID: 2800000, guid: dcc0ed9263c0d524aabeb5f4bd75ecee, type: 3}
|
||||
- {fileID: 2800000, guid: 188dfe7e559f13248ba2c41eb5a59328, type: 3}
|
||||
- {fileID: 2800000, guid: f20112bdeec2e8d4d9f80e8390e37263, type: 3}
|
||||
- {fileID: 7671065637303904002, guid: f4b4e87edddc74e4e8d6b9d4cc0e31fc, type: 3}
|
||||
- {fileID: 7768496905287876572, guid: f4b4e87edddc74e4e8d6b9d4cc0e31fc, type: 3}
|
||||
- {fileID: 2890788359140629188, guid: f4b4e87edddc74e4e8d6b9d4cc0e31fc, type: 3}
|
||||
- {fileID: 5502985463212138770, guid: f4b4e87edddc74e4e8d6b9d4cc0e31fc, type: 3}
|
||||
_Values: febc7fe765b0407bac90167906740a2a8c8e90345544ac394753b1a281922a4e7e358b9883b18c46114589015196ee4776dac15926adab1e4620c9a232d1ed566ec628c1efb3c0693a954d39e3d36066f7d0f7b20b638d2be0a95163e7ea141dcc1f6b7591d3a73ee5a8df6ea08ec51a799b52d05b53bb1a949134651819880de72e3b2ecf0dbc66f70629b01243766dcd4f9bcf7dee1e4185b3b64b611e3b6ddb9f15d3e773b400f9c3036d9fa280501bc798c97db9902b9e9549f346d5832eb56db8a23f89a7640733ce3e6d52283bf75ba0ec3738db26a8b1d7bde9c42f2998b1c6e5674f4d76eecb0c63a687616ba5f85375dbfd6b7da1d121924bab6f35b201cfe2da41f91439554f449eca2a0e0ae957f27d5ee2668ac131e2db057329631d4d0b8c6d0e3ae43753f6ee4b353bd2e2253bebcd1860
|
||||
|
||||
@@ -48,6 +48,10 @@ MonoBehaviour:
|
||||
holdNoteLoopSound: {fileID: 0}
|
||||
holdNoteEndSound: {fileID: 0}
|
||||
flickNoteSound: {fileID: 0}
|
||||
fullscreenNearTimeHint: {fileID: 7671065637303904002, guid: df4a22c0fc7634babaac85c473d4b9fc,
|
||||
type: 3}
|
||||
areaHint: {fileID: 7671065637303904002, guid: f4b4e87edddc74e4e8d6b9d4cc0e31fc,
|
||||
type: 3}
|
||||
bloomEffect: {fileID: 845605030242152257, guid: 1ea739ef6f1bf4e87835b0f554587451,
|
||||
type: 3}
|
||||
cameraShakeEffect: {fileID: 5030288017655597913, guid: 46175bea33f87445bbec1389a53da172,
|
||||
|
||||
8
Assets/Prefabs/GameElements/NoteJudgeHint.meta
Normal file
8
Assets/Prefabs/GameElements/NoteJudgeHint.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 98a5ea1e5a32445ac962a51c720fc4ef
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,77 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &7671065637303904002
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5502985463212138770}
|
||||
- component: {fileID: 2890788359140629188}
|
||||
- component: {fileID: 7768496905287876572}
|
||||
m_Layer: 5
|
||||
m_Name: AreaJudgeHInt
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5502985463212138770
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7671065637303904002}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
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}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2890788359140629188
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7671065637303904002}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &7768496905287876572
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7671065637303904002}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0.2509804}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 0b9510d2790829140953392aae2b6679, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f4b4e87edddc74e4e8d6b9d4cc0e31fc
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,77 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &7671065637303904002
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5502985463212138770}
|
||||
- component: {fileID: 2890788359140629188}
|
||||
- component: {fileID: 7768496905287876572}
|
||||
m_Layer: 5
|
||||
m_Name: FullscreenNearTimeHint
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5502985463212138770
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7671065637303904002}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
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}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2890788359140629188
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7671065637303904002}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &7768496905287876572
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7671065637303904002}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 0, b: 0, a: 0.2509804}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: c7353b93c0ea87c46af8eba38a20a636, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: df4a22c0fc7634babaac85c473d4b9fc
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because one or more lines are too long
@@ -79,7 +79,7 @@ namespace Ichni.RhythmGame
|
||||
var effectNameInputField = inspector.GenerateInputField(container, "Effect Name");
|
||||
var addEffectButton = inspector.GenerateButton(this, container, "Add Effect", () =>
|
||||
{
|
||||
if (IHaveEffectSubmodule.EffectCollection.TryGetValue(effectNameInputField.GetValue<string>(), out var newEffect))
|
||||
if (EffectSubmodule.EffectCollection.TryGetValue(effectNameInputField.GetValue<string>(), out var newEffect))
|
||||
{
|
||||
effectCollection[effect.Key].Add(newEffect);
|
||||
inspectorMain.SetInspector(attachedGameElement);
|
||||
@@ -100,13 +100,8 @@ namespace Ichni.RhythmGame
|
||||
Default,
|
||||
Note,
|
||||
}
|
||||
}
|
||||
|
||||
public interface IHaveEffectSubmodule
|
||||
{
|
||||
public EffectSubmodule effectSubmodule { get; set; }
|
||||
|
||||
public static Dictionary<string, EffectBase> EffectCollection { get; } =
|
||||
private static Dictionary<string, EffectBase> EffectCollection { get; } =
|
||||
new Dictionary<string, EffectBase>()
|
||||
{
|
||||
{ "Bloom", new BloomEffect(1, 2) },
|
||||
@@ -116,6 +111,11 @@ namespace Ichni.RhythmGame
|
||||
};
|
||||
}
|
||||
|
||||
public interface IHaveEffectSubmodule
|
||||
{
|
||||
public EffectSubmodule effectSubmodule { get; set; }
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class EffectSubmodule_BM : Submodule_BM
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
@@ -7,6 +8,18 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public class FullScreenBalancedJudgeUnit : NoteJudgeUnit
|
||||
{
|
||||
|
||||
protected override GameObject GetHintImagePrefab()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public FullScreenBalancedJudgeUnit(NoteBase note) : base(note)
|
||||
{
|
||||
}
|
||||
|
||||
public override NoteJudgeUnit_BM ConvertToBM()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,68 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public class FullScreenNearTimeJudgeUnit : NoteJudgeUnit
|
||||
{
|
||||
protected override GameObject GetHintImagePrefab() => EditorManager.instance.basePrefabs.fullscreenNearTimeHint;
|
||||
|
||||
public FullScreenNearTimeJudgeUnit(NoteBase note) : base(note)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void UpdateJudge()
|
||||
{
|
||||
if(note.isJudged) return;
|
||||
Vector2 noteScreenPosition = note.noteScreenPosition;
|
||||
RectTransform canvasRect = EditorManager.instance.judgeHintCanvas.GetComponent<RectTransform>();
|
||||
if (RectTransformUtility.ScreenPointToLocalPointInRectangle(canvasRect, noteScreenPosition, null, out Vector2 uiPosition))
|
||||
{
|
||||
judgeHintImage.anchoredPosition = uiPosition;
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
Inspector inspectorMain = EditorManager.instance.uiManager.inspector;
|
||||
|
||||
var container = inspector.GenerateContainer("Full Screen Near Time Judge Unit");
|
||||
|
||||
var isShowingJudgeField = inspector.GenerateToggle(this, container, "Is Showing Judge", nameof(isShowingJudge));
|
||||
isShowingJudgeField.AddListenerFunction((isOn) => SetShowingJudge(isShowingJudge));
|
||||
|
||||
var removeButton = inspector.GenerateButton(this, container, "Remove", () =>
|
||||
{
|
||||
SetShowingJudge(false);
|
||||
note.noteJudgeSubmodule.judgeUnitList.Remove(this);
|
||||
inspectorMain.SetInspector(note);
|
||||
});
|
||||
}
|
||||
|
||||
public override NoteJudgeUnit_BM ConvertToBM()
|
||||
{
|
||||
return new FullScreenNearTimeJudgeUnit_BM();
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class FullScreenNearTimeJudgeUnit_BM : NoteJudgeUnit_BM
|
||||
{
|
||||
public FullScreenNearTimeJudgeUnit_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override NoteJudgeUnit ConvertToGameType(NoteBase attachedNote)
|
||||
{
|
||||
return new FullScreenNearTimeJudgeUnit(attachedNote);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,57 +1,119 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public class NoteJudgeSubmodule : SubmoduleBase
|
||||
public partial class NoteJudgeSubmodule : SubmoduleBase
|
||||
{
|
||||
public List<NoteJudgeUnit> judgeUnitList;
|
||||
private NoteBase note => attachedGameElement as NoteBase;
|
||||
|
||||
public NoteJudgeSubmodule(NoteBase attachedGameElement) : base(attachedGameElement)
|
||||
{
|
||||
judgeUnitList = new List<NoteJudgeUnit>();
|
||||
|
||||
this.note.noteJudgeSubmodule = this;
|
||||
}
|
||||
|
||||
public override void SaveBM()
|
||||
public NoteJudgeSubmodule(NoteBase attachedGameElement, List<NoteJudgeUnit_BM> judgeUnitList_BM) : base(attachedGameElement)
|
||||
{
|
||||
matchedBM = new NoteJudgeSubmodule_BM(attachedGameElement);
|
||||
judgeUnitList = new List<NoteJudgeUnit>();
|
||||
|
||||
foreach (NoteJudgeUnit_BM judgeUnitBM in judgeUnitList_BM)
|
||||
{
|
||||
judgeUnitList.Add(judgeUnitBM.ConvertToGameType(attachedGameElement));
|
||||
}
|
||||
|
||||
this.note.noteJudgeSubmodule = this;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class NoteJudgeSubmodule
|
||||
{
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new NoteJudgeSubmodule_BM(attachedGameElement, this);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
Inspector inspectorMain = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("Judge Submodule");
|
||||
|
||||
foreach (var judgeUnit in judgeUnitList)
|
||||
{
|
||||
judgeUnit.SetUpInspector();
|
||||
}
|
||||
|
||||
var effectNameInputField = inspector.GenerateInputField(container, "Judge Unit Name");
|
||||
var addJudgeUnitButton = inspector.GenerateButton(this, container, "Add Judge Unit",
|
||||
() =>
|
||||
{
|
||||
AddJudgeUnit(effectNameInputField.GetValue<string>());
|
||||
inspectorMain.SetInspector(note);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public partial class NoteJudgeSubmodule
|
||||
{
|
||||
private static Dictionary<string, NoteJudgeUnit> JudgeUnitCollection(NoteBase note) =>
|
||||
new Dictionary<string, NoteJudgeUnit>()
|
||||
{
|
||||
{ "TouchArea", new TouchAreaJudgeUnit(note, 1000) },
|
||||
{ "FullScreenNearTime", new FullScreenNearTimeJudgeUnit(note) },
|
||||
};
|
||||
|
||||
public NoteJudgeUnit AddJudgeUnit(string judgeUnitName)
|
||||
{
|
||||
if (JudgeUnitCollection(note).TryGetValue(judgeUnitName, out var newJudgeUnit))
|
||||
{
|
||||
judgeUnitList.Add(newJudgeUnit);
|
||||
return newJudgeUnit;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogWindow.Log("Judge Unit Type not found.", Color.red);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class NoteJudgeSubmodule_BM : Submodule_BM
|
||||
{
|
||||
public List<NoteJudgeUnit> judgeUnitList;
|
||||
public List<NoteJudgeUnit_BM> judgeUnitList;
|
||||
|
||||
public NoteJudgeSubmodule_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public NoteJudgeSubmodule_BM(GameElement attachedElement) : base(attachedElement)
|
||||
public NoteJudgeSubmodule_BM(GameElement attachedElement, NoteJudgeSubmodule noteJudgeSubmodule) : base(attachedElement)
|
||||
{
|
||||
judgeUnitList = new List<NoteJudgeUnit>();
|
||||
judgeUnitList = new List<NoteJudgeUnit_BM>();
|
||||
|
||||
foreach (var judgeUnit in noteJudgeSubmodule.judgeUnitList)
|
||||
{
|
||||
judgeUnitList.Add(judgeUnit.ConvertToBM());
|
||||
}
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
attachedElement = GameElement_BM.GetElement(attachedElementGuid);
|
||||
(attachedElement as NoteBase).noteJudgeSubmodule = new NoteJudgeSubmodule(attachedElement as NoteBase);
|
||||
(attachedElement as NoteBase).noteJudgeSubmodule = new NoteJudgeSubmodule(attachedElement as NoteBase, judgeUnitList);
|
||||
}
|
||||
|
||||
public override void DuplicateBM(GameElement attached)
|
||||
{
|
||||
(attached as NoteBase).noteJudgeSubmodule = new NoteJudgeSubmodule(attached as NoteBase);
|
||||
(attached as NoteBase).noteJudgeSubmodule = new NoteJudgeSubmodule(attached as NoteBase, judgeUnitList);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class NoteJudgeUnit
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public abstract class NoteJudgeUnit : IBaseElement
|
||||
{
|
||||
public NoteBase note;
|
||||
public bool isShowingJudge;
|
||||
|
||||
public RectTransform judgeHintImage;
|
||||
protected abstract GameObject GetHintImagePrefab();
|
||||
|
||||
public BaseElement_BM matchedBM { get; set; }
|
||||
|
||||
protected NoteJudgeUnit(NoteBase note)
|
||||
{
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
protected void SetShowingJudge(bool isShowing)
|
||||
{
|
||||
if (isShowing)
|
||||
{
|
||||
judgeHintImage = Object.Instantiate(GetHintImagePrefab(),
|
||||
EditorManager.instance.judgeHintCanvas.transform).GetComponent<RectTransform>();
|
||||
}
|
||||
else if (judgeHintImage != null)
|
||||
{
|
||||
Object.Destroy(judgeHintImage.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void UpdateJudge()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual void SetUpInspector()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 转换为存档类
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public abstract NoteJudgeUnit_BM ConvertToBM();
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public abstract class NoteJudgeUnit_BM
|
||||
{
|
||||
public NoteJudgeUnit_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 转换为游戏类
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public abstract NoteJudgeUnit ConvertToGameType(NoteBase attachedGameElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dcf3d31716c4a4dcb8328530303a381f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,11 +1,82 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public class TouchAreaJudgeUnit : NoteJudgeUnit
|
||||
{
|
||||
public float areaRadius;
|
||||
protected override GameObject GetHintImagePrefab() => EditorManager.instance.basePrefabs.areaHint;
|
||||
|
||||
private float CurrentScreenRatio() => Screen.width / 1920f;
|
||||
|
||||
public TouchAreaJudgeUnit(NoteBase note, float areaRadius) : base(note)
|
||||
{
|
||||
this.areaRadius = areaRadius;
|
||||
}
|
||||
|
||||
public override void UpdateJudge()
|
||||
{
|
||||
if(note.isJudged) return;
|
||||
Vector2 noteScreenPosition = note.noteScreenPosition;
|
||||
RectTransform canvasRect = EditorManager.instance.judgeHintCanvas.GetComponent<RectTransform>();
|
||||
if (RectTransformUtility.ScreenPointToLocalPointInRectangle(canvasRect, noteScreenPosition, null, out Vector2 uiPosition))
|
||||
{
|
||||
judgeHintImage.anchoredPosition = uiPosition;
|
||||
judgeHintImage.sizeDelta = new Vector2(areaRadius * 2, areaRadius * 2) * CurrentScreenRatio();
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
Inspector inspectorMain = EditorManager.instance.uiManager.inspector;
|
||||
|
||||
var container = inspector.GenerateContainer("Touch Area Judge Unit");
|
||||
|
||||
var isShowingJudgeField = inspector.GenerateToggle(this, container, "Is Showing Judge", nameof(isShowingJudge));
|
||||
isShowingJudgeField.AddListenerFunction((isOn) => SetShowingJudge(isShowingJudge));
|
||||
|
||||
var effectTimeField = inspector.GenerateInputField(this, container, "Area Radius", nameof(areaRadius));
|
||||
|
||||
var removeButton = inspector.GenerateButton(this, container, "Remove", () =>
|
||||
{
|
||||
SetShowingJudge(false);
|
||||
note.noteJudgeSubmodule.judgeUnitList.Remove(this);
|
||||
inspectorMain.SetInspector(note);
|
||||
});
|
||||
}
|
||||
|
||||
public override NoteJudgeUnit_BM ConvertToBM()
|
||||
{
|
||||
return new TouchAreaJudgeUnit_BM(areaRadius);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class TouchAreaJudgeUnit_BM : NoteJudgeUnit_BM
|
||||
{
|
||||
public float areaRadius;
|
||||
|
||||
public TouchAreaJudgeUnit_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public TouchAreaJudgeUnit_BM(float areaRadius)
|
||||
{
|
||||
this.areaRadius = areaRadius;
|
||||
}
|
||||
|
||||
public override NoteJudgeUnit ConvertToGameType(NoteBase attachedNote)
|
||||
{
|
||||
return new TouchAreaJudgeUnit(attachedNote, areaRadius);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
@@ -7,6 +8,19 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public class TriggerConnectJudgeUnit : NoteJudgeUnit
|
||||
{
|
||||
|
||||
protected override GameObject GetHintImagePrefab()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public TriggerConnectJudgeUnit(NoteBase note) : base(note)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override NoteJudgeUnit_BM ConvertToBM()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Dreamteck.Splines;
|
||||
using Ichni.Editor;
|
||||
using Sirenix.OdinInspector;
|
||||
@@ -86,6 +87,14 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
}
|
||||
|
||||
if (noteJudgeSubmodule != null && !EditorManager.instance.cameraManager.isSceneCameraActive)
|
||||
{
|
||||
foreach (NoteJudgeUnit unit in noteJudgeSubmodule.judgeUnitList.Where(unit => unit.isShowingJudge))
|
||||
{
|
||||
unit.UpdateJudge();
|
||||
}
|
||||
}
|
||||
|
||||
if (noteVisual != null)
|
||||
{
|
||||
noteVisual.effectSubmodule.effectCollection["Generate"].ForEach(e => e.UpdateEffect(exactJudgeTime));
|
||||
|
||||
@@ -29,6 +29,9 @@ public class BasePrefabsCollection : SerializedScriptableObject
|
||||
public AudioClip holdNoteLoopSound;
|
||||
public AudioClip holdNoteEndSound;
|
||||
public AudioClip flickNoteSound;
|
||||
[Title("Note 判定UI")] public GameObject fullscreenNearTimeHint;
|
||||
public GameObject areaHint;
|
||||
|
||||
|
||||
[Title("Effect相关")]
|
||||
public GameObject bloomEffect;
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace Ichni
|
||||
public BackgroundController backgroundController;
|
||||
public CameraManager cameraManager;
|
||||
public PostProcessingManager postProcessingManager;
|
||||
public Canvas judgeHintCanvas;
|
||||
|
||||
public Timeline timeline;
|
||||
|
||||
|
||||
@@ -428,9 +428,9 @@
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.TransformSubmodule_BM,Assembly-CSharp",
|
||||
"originalPosition" : {
|
||||
"x" : 0,
|
||||
"y" : 0,
|
||||
"z" : 0
|
||||
"x" : 5,
|
||||
"y" : 5,
|
||||
"z" : -10
|
||||
},
|
||||
"originalEulerAngles" : {
|
||||
"x" : 0,
|
||||
@@ -494,7 +494,7 @@
|
||||
|
||||
],
|
||||
"elementGuid" : {
|
||||
"value" : "aeced779-ecfe-49ff-9198-32c84c8fb6a1"
|
||||
"value" : "b0e23990-677e-43ce-a161-fcdb41886e16"
|
||||
},
|
||||
"attachedElementGuid" : {
|
||||
"value" : "55a0ed60-d741-4072-86a3-7d7af286c2bb"
|
||||
@@ -505,15 +505,18 @@
|
||||
"startTime" : -32767,
|
||||
"endTime" : 32767,
|
||||
"attachedElementGuid" : {
|
||||
"value" : "aeced779-ecfe-49ff-9198-32c84c8fb6a1"
|
||||
"value" : "b0e23990-677e-43ce-a161-fcdb41886e16"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.NoteJudgeSubmodule_BM,Assembly-CSharp",
|
||||
"judgeUnitList" : [
|
||||
|
||||
{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.TouchAreaJudgeUnit_BM,Assembly-CSharp",
|
||||
"areaRadius" : 1000
|
||||
}
|
||||
],
|
||||
"attachedElementGuid" : {
|
||||
"value" : "aeced779-ecfe-49ff-9198-32c84c8fb6a1"
|
||||
"value" : "b0e23990-677e-43ce-a161-fcdb41886e16"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteVisual_BM,Assembly-CSharp",
|
||||
@@ -524,10 +527,10 @@
|
||||
|
||||
],
|
||||
"elementGuid" : {
|
||||
"value" : "65e40f0c-820f-48e8-9e70-9315b6a8fa43"
|
||||
"value" : "32b6b82d-06cf-466e-b83b-d2199242300e"
|
||||
},
|
||||
"attachedElementGuid" : {
|
||||
"value" : "aeced779-ecfe-49ff-9198-32c84c8fb6a1"
|
||||
"value" : "b0e23990-677e-43ce-a161-fcdb41886e16"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.TransformSubmodule_BM,Assembly-CSharp",
|
||||
@@ -547,7 +550,7 @@
|
||||
"z" : 1
|
||||
},
|
||||
"attachedElementGuid" : {
|
||||
"value" : "65e40f0c-820f-48e8-9e70-9315b6a8fa43"
|
||||
"value" : "32b6b82d-06cf-466e-b83b-d2199242300e"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.TimeDurationSubmodule_BM,Assembly-CSharp",
|
||||
@@ -555,7 +558,7 @@
|
||||
"startTime" : -32767,
|
||||
"endTime" : 32767,
|
||||
"attachedElementGuid" : {
|
||||
"value" : "65e40f0c-820f-48e8-9e70-9315b6a8fa43"
|
||||
"value" : "32b6b82d-06cf-466e-b83b-d2199242300e"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.ColorSubmodule_BM,Assembly-CSharp",
|
||||
@@ -574,7 +577,7 @@
|
||||
},
|
||||
"originalEmissionIntensity" : 0,
|
||||
"attachedElementGuid" : {
|
||||
"value" : "65e40f0c-820f-48e8-9e70-9315b6a8fa43"
|
||||
"value" : "32b6b82d-06cf-466e-b83b-d2199242300e"
|
||||
}
|
||||
},{
|
||||
"__type" : "Ichni.RhythmGame.Beatmap.EffectSubmodule_BM,Assembly-CSharp",
|
||||
@@ -604,7 +607,7 @@
|
||||
]
|
||||
},
|
||||
"attachedElementGuid" : {
|
||||
"value" : "65e40f0c-820f-48e8-9e70-9315b6a8fa43"
|
||||
"value" : "32b6b82d-06cf-466e-b83b-d2199242300e"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
|
||||
if (isFirstGenerated)
|
||||
{
|
||||
note.noteJudgeSubmodule.AddJudgeUnit("TouchArea");
|
||||
//effectSubmodule.effectCollection["Generate"].Add(new BasicNoteGenerateExpand(this));
|
||||
effectSubmodule.effectCollection["Perfect"].Add(new DTMNotePerfectBurst(this));
|
||||
effectSubmodule.effectCollection["Good"].Add(new DTMNoteGoodBurst(this));
|
||||
|
||||
Reference in New Issue
Block a user