基础内容-6
技术性调整; Note效果;
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Dreamteck.Splines;
|
||||
using Lean.Pool;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
@@ -10,9 +12,12 @@ namespace Ichni.RhythmGame
|
||||
public List<Vector2> availableFlickDirections;
|
||||
public static Flick GenerateElement(string elementName, float exactJudgeTime, BaseElement attach, List<Vector2> directions)
|
||||
{
|
||||
Flick flick = LeanPool.Spawn(EditorManager.instance.basePrefabs.tapNote, attach.transform).GetComponent<Flick>();
|
||||
flick.NewInitialize(elementName, exactJudgeTime);
|
||||
Flick flick = Instantiate(EditorManager.instance.basePrefabs.tapNote, attach.transform).GetComponent<Flick>();
|
||||
flick.Initialize(elementName);
|
||||
flick.exactJudgeTime = exactJudgeTime;
|
||||
flick.availableFlickDirections = directions;
|
||||
flick.transformSubmodule = new TransformSubmodule(flick);
|
||||
flick.timeDurationSubmodule = new TimeDurationSubmodule(flick);
|
||||
flick.SetParent(attach);
|
||||
|
||||
if (attach.TryGetComponent(out Track track))
|
||||
@@ -20,6 +25,7 @@ namespace Ichni.RhythmGame
|
||||
if (track.trackTimeSubmodule != null)
|
||||
{
|
||||
flick.track = track;
|
||||
flick.trackPositioner = flick.AddComponent<SplinePositioner>();
|
||||
flick.trackPositioner.spline = track.trackPathSubmodule.path;
|
||||
flick.isOnTrack = true;
|
||||
flick.UpdateNoteInTrack();
|
||||
@@ -31,18 +37,11 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
flick.track = null;
|
||||
flick.isOnTrack = false;
|
||||
}
|
||||
|
||||
return flick;
|
||||
}
|
||||
|
||||
public void NewInitialize(string elementName, float exactJudgeTime)
|
||||
{
|
||||
base.NewInitialize(elementName);
|
||||
this.exactJudgeTime = exactJudgeTime;
|
||||
this.track = null;
|
||||
this.isOnTrack = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,10 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public class NoteJudgeSubmodule : SubmoduleBase
|
||||
{
|
||||
|
||||
public NoteJudgeSubmodule(BaseElement attachedElement) : base(attachedElement)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class NoteJudgeUnit
|
||||
|
||||
@@ -40,7 +40,19 @@ namespace Ichni.RhythmGame
|
||||
[Title("In-Game Info")]
|
||||
public Vector2 noteScreenPosition;
|
||||
public bool isJudged;
|
||||
|
||||
|
||||
public override void Initialize(string name)
|
||||
{
|
||||
base.Initialize(name);
|
||||
generateEffects = new EffectSubmodule(this);
|
||||
generalJudgeEffects = new EffectSubmodule(this);
|
||||
perfectJudgeEffects = new EffectSubmodule(this);
|
||||
goodJudgeEffects = new EffectSubmodule(this);
|
||||
badJudgeEffects = new EffectSubmodule(this);
|
||||
missJudgeEffects = new EffectSubmodule(this);
|
||||
noteJudgeSubmodule = new NoteJudgeSubmodule(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 在MovableTrack上更新Note的位置,注意HoldNote需要重写这个方法
|
||||
/// </summary>
|
||||
@@ -97,7 +109,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
if (!isJudged)
|
||||
{
|
||||
AudioSource.PlayClipAtPoint(EditorManager.instance.basePrefabs.tapNoteSound, Camera.main.transform.position, 1f);
|
||||
//AudioSource.PlayClipAtPoint(EditorManager.instance.basePrefabs.tapNoteSound, Camera.main.transform.position, 1f);
|
||||
isJudged = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public void NewInitialize(NoteBase note)
|
||||
{
|
||||
base.NewInitialize(note.elementName + " Note Visual");
|
||||
base.Initialize(note.elementName + " Note Visual");
|
||||
this.note = note;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Dreamteck.Splines;
|
||||
using Lean.Pool;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
@@ -9,8 +11,11 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public static Stay GenerateElement(string elementName, float exactJudgeTime, BaseElement attach)
|
||||
{
|
||||
Stay stay = LeanPool.Spawn(EditorManager.instance.basePrefabs.tapNote, attach.transform).GetComponent<Stay>();
|
||||
stay.NewInitialize(elementName, exactJudgeTime);
|
||||
Stay stay = Instantiate(EditorManager.instance.basePrefabs.tapNote, attach.transform).GetComponent<Stay>();
|
||||
stay.Initialize(elementName);
|
||||
stay.exactJudgeTime = exactJudgeTime;
|
||||
stay.transformSubmodule = new TransformSubmodule(stay);
|
||||
stay.timeDurationSubmodule = new TimeDurationSubmodule(stay);
|
||||
stay.SetParent(attach);
|
||||
|
||||
if (attach.TryGetComponent(out Track track))
|
||||
@@ -18,6 +23,7 @@ namespace Ichni.RhythmGame
|
||||
if (track.trackTimeSubmodule != null)
|
||||
{
|
||||
stay.track = track;
|
||||
stay.trackPositioner = stay.AddComponent<SplinePositioner>();
|
||||
stay.trackPositioner.spline = track.trackPathSubmodule.path;
|
||||
stay.isOnTrack = true;
|
||||
stay.UpdateNoteInTrack();
|
||||
@@ -29,18 +35,11 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
stay.track = null;
|
||||
stay.isOnTrack = false;
|
||||
}
|
||||
|
||||
return stay;
|
||||
}
|
||||
|
||||
public void NewInitialize(string elementName, float exactJudgeTime)
|
||||
{
|
||||
base.NewInitialize(elementName);
|
||||
this.exactJudgeTime = exactJudgeTime;
|
||||
this.track = null;
|
||||
this.isOnTrack = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Dreamteck.Splines;
|
||||
using Lean.Pool;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
@@ -9,8 +11,11 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public static Tap GenerateElement(string elementName, float exactJudgeTime, BaseElement attach)
|
||||
{
|
||||
Tap tap = LeanPool.Spawn(EditorManager.instance.basePrefabs.tapNote, attach.transform).GetComponent<Tap>();
|
||||
tap.NewInitialize(elementName, exactJudgeTime);
|
||||
Tap tap = Instantiate(EditorManager.instance.basePrefabs.tapNote, attach.transform).GetComponent<Tap>();
|
||||
tap.Initialize(elementName);
|
||||
tap.exactJudgeTime = exactJudgeTime;
|
||||
tap.transformSubmodule = new TransformSubmodule(tap);
|
||||
tap.timeDurationSubmodule = new TimeDurationSubmodule(tap);
|
||||
tap.SetParent(attach);
|
||||
|
||||
if (attach.TryGetComponent(out Track track))
|
||||
@@ -18,6 +23,7 @@ namespace Ichni.RhythmGame
|
||||
if (track.trackTimeSubmodule != null)
|
||||
{
|
||||
tap.track = track;
|
||||
tap.trackPositioner = tap.AddComponent<SplinePositioner>();
|
||||
tap.trackPositioner.spline = track.trackPathSubmodule.path;
|
||||
tap.isOnTrack = true;
|
||||
tap.UpdateNoteInTrack();
|
||||
@@ -29,18 +35,11 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
tap.track = null;
|
||||
tap.isOnTrack = false;
|
||||
}
|
||||
|
||||
return tap;
|
||||
}
|
||||
|
||||
public void NewInitialize(string elementName, float exactJudgeTime)
|
||||
{
|
||||
base.NewInitialize(elementName);
|
||||
this.exactJudgeTime = exactJudgeTime;
|
||||
this.track = null;
|
||||
this.isOnTrack = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user