1.修复了一些错误\n2.导入了URP的Sample
This commit is contained in:
@@ -49,7 +49,7 @@ namespace Demo.Game
|
||||
|
||||
[Header("Judgement")]
|
||||
[Content, SerializeField] private float BestJudgementTimePoint = -1;
|
||||
[Content, SerializeField] public UnityEvent<int> JudgementEvent = new();
|
||||
[Content, SerializeField] public UnityEvent<JudgementLevel> JudgementEvent = new();
|
||||
|
||||
public float GetBestJudgementTimePoint()
|
||||
{
|
||||
@@ -90,24 +90,11 @@ namespace Demo.Game
|
||||
BestJudgementTimePoint = -1;
|
||||
}
|
||||
|
||||
public void InvokeJudgement()
|
||||
public void InvokeJudgement(JudgementLevel level)
|
||||
{
|
||||
int judgeStats = JudgementLevelCount;
|
||||
if (InteractiveDurationStats == DurationStats.BeforeEnd)
|
||||
{
|
||||
judgeStats--;
|
||||
if (InteractableScoreIntervalStats == DurationStats.BeforeEnd)
|
||||
{
|
||||
judgeStats--;
|
||||
if (InteractableIntervalThatCanScoreBestStats == DurationStats.BeforeEnd)
|
||||
{
|
||||
judgeStats--;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (judgeStats == JudgementLevelCount)
|
||||
if (level == JudgementLevel.None)
|
||||
return;
|
||||
JudgementEvent.Invoke(judgeStats);
|
||||
JudgementEvent.Invoke(level);
|
||||
VisibleDurationStats = DurationStats.Judgement;
|
||||
VisibleDurationEndEvent.Invoke();
|
||||
InteractiveDurationStats = DurationStats.Judgement;
|
||||
@@ -162,8 +149,7 @@ namespace Demo.Game
|
||||
if (VisibleDurationStats == DurationStats.Judgement)
|
||||
return;
|
||||
//检定
|
||||
if (JudgementBehaviour(currentTime))
|
||||
InvokeJudgement();
|
||||
InvokeJudgement(JudgementBehaviour(currentTime));
|
||||
if (tickType == TickType.Update)
|
||||
{
|
||||
// 可见区间
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Demo.Game
|
||||
|
||||
[Content, SerializeField] private IInteraction MyInteractionModule;
|
||||
|
||||
public abstract void OnJudgement(int level);
|
||||
public abstract void OnJudgement(IInteraction.JudgementLevel level);
|
||||
|
||||
public override IEnumerator LoadScript(string script)
|
||||
{
|
||||
|
||||
@@ -13,9 +13,9 @@ namespace Demo.Game
|
||||
}
|
||||
|
||||
private List<IEnumerator> AssetBundleLoadings = new();
|
||||
[Content, SerializeField] private Dictionary<int, string> AssetBundles = new();
|
||||
[Content, SerializeField] private Dictionary<int, GameObject> Prefabs = new();
|
||||
[Content, SerializeField] private Dictionary<int, float> Durations = new();
|
||||
[Content, SerializeField] private Dictionary<IInteraction.JudgementLevel, string> AssetBundles = new();
|
||||
[Content, SerializeField] private Dictionary<IInteraction.JudgementLevel, GameObject> Prefabs = new();
|
||||
[Content, SerializeField] private Dictionary<IInteraction.JudgementLevel, float> Durations = new();
|
||||
|
||||
public override IEnumerator LoadScript(string script)
|
||||
{
|
||||
@@ -34,22 +34,22 @@ namespace Demo.Game
|
||||
/// <summary>
|
||||
/// 加载预制体作为子物体
|
||||
/// </summary>
|
||||
/// <param name="level">判定等级对应会出现的粒子效果,若没有对应的则向更低的值寻找</param>
|
||||
/// <param name="level">正整数, 0级判定为最佳判定, 判定等级对应会出现的粒子效果</param>
|
||||
/// <param name="ab"></param>
|
||||
/// <param name="prefab"></param>
|
||||
/// <param name="duration">判定效果的持续时间</param>
|
||||
/// <param name="duration">判定效果会现形的持续时间</param>
|
||||
[ScriptableCall(@"
|
||||
<summary>
|
||||
加载预制体作为子物体
|
||||
</summary>
|
||||
<param name=""level"">判定等级对应会出现的粒子效果,若没有对应的则向更低的值寻找</param>
|
||||
<param name=""level"">正整数, 0级判定为最佳判定, 判定等级对应会出现的粒子效果</param>
|
||||
<param name=""ab""></param>
|
||||
<param name=""prefab""></param>
|
||||
<param name=""duration"">判定效果的持续时间</param>
|
||||
<param name=""duration"">判定效果会现形的持续时间</param>
|
||||
")]
|
||||
public void Load(string level, string ab, string prefab, string duration)
|
||||
{
|
||||
int levelId = int.Parse(level);
|
||||
var levelId = (IInteraction.JudgementLevel)int.Parse(level);
|
||||
|
||||
IEnumerator Foo()
|
||||
{
|
||||
@@ -79,17 +79,14 @@ namespace Demo.Game
|
||||
prefab.SetActive(false);
|
||||
}
|
||||
|
||||
public override void OnJudgement(int level)
|
||||
public override void OnJudgement(IInteraction.JudgementLevel level)
|
||||
{
|
||||
for (int i = level; i >= 0; i--)
|
||||
if (Prefabs.TryGetValue(level, out var effect))
|
||||
{
|
||||
if (Prefabs.TryGetValue(i, out var effect))
|
||||
{
|
||||
ConventionUtility.CreateSteps()
|
||||
.Next(() => CreateParticle(effect))
|
||||
.Wait(Durations[i], () => DestroyParticle(effect))
|
||||
.Invoke();
|
||||
}
|
||||
ConventionUtility.CreateSteps()
|
||||
.Next(() => CreateParticle(effect))
|
||||
.Wait(Durations[level], () => DestroyParticle(effect))
|
||||
.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user