基础内容-7
Trail 完整Note
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Dreamteck.Splines;
|
||||
@@ -7,13 +8,14 @@ using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public class Flick : NoteBase
|
||||
public partial class Flick : NoteBase
|
||||
{
|
||||
public List<Vector2> availableFlickDirections;
|
||||
public static Flick GenerateElement(string elementName, float exactJudgeTime, BaseElement attach, List<Vector2> directions)
|
||||
public static Flick GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
float exactJudgeTime, BaseElement attach, List<Vector2> directions)
|
||||
{
|
||||
Flick flick = Instantiate(EditorManager.instance.basePrefabs.tapNote, attach.transform).GetComponent<Flick>();
|
||||
flick.Initialize(elementName);
|
||||
flick.Initialize(elementName, id, tags);
|
||||
flick.exactJudgeTime = exactJudgeTime;
|
||||
flick.availableFlickDirections = directions;
|
||||
flick.transformSubmodule = new TransformSubmodule(flick);
|
||||
@@ -44,4 +46,42 @@ namespace Ichni.RhythmGame
|
||||
return flick;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Flick
|
||||
{
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new Beatmap.Flick_BM(elementName, elementGuid, tags, parentElement.matchedBM, exactJudgeTime, availableFlickDirections);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class Flick_BM : BaseElement_BM
|
||||
{
|
||||
public float exactJudgeTime;
|
||||
public List<Vector2> availableFlickDirections;
|
||||
public Flick_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Flick_BM(string elementName, Guid elementGuid, List<string> tags, BaseElement_BM attachedElement, float exactJudgeTime, List<Vector2> directions)
|
||||
: base(elementName, elementGuid, tags, attachedElement)
|
||||
{
|
||||
this.exactJudgeTime = exactJudgeTime;
|
||||
availableFlickDirections = directions;
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = Flick.GenerateElement(elementName, elementGuid, tags, exactJudgeTime, GetElement(attachedElementGuid), availableFlickDirections);
|
||||
}
|
||||
|
||||
public override BaseElement DuplicateBM(BaseElement parent)
|
||||
{
|
||||
return Flick.GenerateElement(elementName, elementGuid, tags, exactJudgeTime, parent, availableFlickDirections);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public abstract class NoteBase : BaseElement
|
||||
public abstract partial class NoteBase : BaseElement
|
||||
{
|
||||
[Title("Basic Info")]
|
||||
public float exactJudgeTime;
|
||||
@@ -41,9 +41,9 @@ namespace Ichni.RhythmGame
|
||||
public Vector2 noteScreenPosition;
|
||||
public bool isJudged;
|
||||
|
||||
public override void Initialize(string name)
|
||||
public override void Initialize(string name, Guid id, List<string> tags)
|
||||
{
|
||||
base.Initialize(name);
|
||||
base.Initialize(name, id, tags);
|
||||
generateEffects = new EffectSubmodule(this);
|
||||
generalJudgeEffects = new EffectSubmodule(this);
|
||||
perfectJudgeEffects = new EffectSubmodule(this);
|
||||
@@ -113,14 +113,23 @@ namespace Ichni.RhythmGame
|
||||
isJudged = true;
|
||||
}
|
||||
}
|
||||
|
||||
generateEffects.effectList.ForEach(e => e.UpdateEffect());
|
||||
|
||||
foreach (var effect in generateEffects.effectList)
|
||||
switch (EditorManager.instance.currentJudgeType)
|
||||
{
|
||||
effect.UpdateEffect();
|
||||
}
|
||||
foreach (var effect in perfectJudgeEffects.effectList)
|
||||
{
|
||||
effect.UpdateEffect();
|
||||
case NoteJudgeType.Perfect:
|
||||
perfectJudgeEffects.effectList.ForEach(e => e.UpdateEffect());
|
||||
break;
|
||||
case NoteJudgeType.Good:
|
||||
goodJudgeEffects.effectList.ForEach(e => e.UpdateEffect());
|
||||
break;
|
||||
case NoteJudgeType.Bad:
|
||||
badJudgeEffects.effectList.ForEach(e => e.UpdateEffect());
|
||||
break;
|
||||
case NoteJudgeType.Miss:
|
||||
missJudgeEffects.effectList.ForEach(e => e.UpdateEffect());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,4 +153,15 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public abstract partial class NoteBase
|
||||
{
|
||||
public enum NoteJudgeType
|
||||
{
|
||||
Perfect,
|
||||
Good,
|
||||
Bad,
|
||||
Miss
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,11 +13,5 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public List<GameObject> notePartList;
|
||||
public List<GameObject> effectPartList;
|
||||
|
||||
public void NewInitialize(NoteBase note)
|
||||
{
|
||||
base.Initialize(note.elementName + " Note Visual");
|
||||
this.note = note;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Dreamteck.Splines;
|
||||
@@ -7,12 +8,13 @@ using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public class Stay : NoteBase
|
||||
public partial class Stay : NoteBase
|
||||
{
|
||||
public static Stay GenerateElement(string elementName, float exactJudgeTime, BaseElement attach)
|
||||
public static Stay GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
float exactJudgeTime, BaseElement attach)
|
||||
{
|
||||
Stay stay = Instantiate(EditorManager.instance.basePrefabs.tapNote, attach.transform).GetComponent<Stay>();
|
||||
stay.Initialize(elementName);
|
||||
stay.Initialize(elementName, id, tags);
|
||||
stay.exactJudgeTime = exactJudgeTime;
|
||||
stay.transformSubmodule = new TransformSubmodule(stay);
|
||||
stay.timeDurationSubmodule = new TimeDurationSubmodule(stay);
|
||||
@@ -42,4 +44,41 @@ namespace Ichni.RhythmGame
|
||||
return stay;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Stay
|
||||
{
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new Beatmap.Stay_BM(elementName, elementGuid, tags, parentElement.matchedBM, exactJudgeTime);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class Stay_BM : BaseElement_BM
|
||||
{
|
||||
public float exactJudgeTime;
|
||||
|
||||
public Stay_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Stay_BM(string elementName, Guid elementGuid, List<string> tags, BaseElement_BM attachedElement, float exactJudgeTime)
|
||||
: base(elementName, elementGuid, tags, attachedElement)
|
||||
{
|
||||
this.exactJudgeTime = exactJudgeTime;
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = Stay.GenerateElement(elementName, elementGuid, tags, exactJudgeTime, GetElement(attachedElementGuid));
|
||||
}
|
||||
|
||||
public override BaseElement DuplicateBM(BaseElement parent)
|
||||
{
|
||||
return Stay.GenerateElement(elementName, elementGuid, tags, exactJudgeTime, parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Dreamteck.Splines;
|
||||
@@ -7,12 +8,13 @@ using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public class Tap : NoteBase
|
||||
public partial class Tap : NoteBase
|
||||
{
|
||||
public static Tap GenerateElement(string elementName, float exactJudgeTime, BaseElement attach)
|
||||
public static Tap GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
float exactJudgeTime, BaseElement attach)
|
||||
{
|
||||
Tap tap = Instantiate(EditorManager.instance.basePrefabs.tapNote, attach.transform).GetComponent<Tap>();
|
||||
tap.Initialize(elementName);
|
||||
tap.Initialize(elementName, id, tags);
|
||||
tap.exactJudgeTime = exactJudgeTime;
|
||||
tap.transformSubmodule = new TransformSubmodule(tap);
|
||||
tap.timeDurationSubmodule = new TimeDurationSubmodule(tap);
|
||||
@@ -42,4 +44,41 @@ namespace Ichni.RhythmGame
|
||||
return tap;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Tap
|
||||
{
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new Beatmap.Tap_BM(elementName, elementGuid, tags, parentElement.matchedBM, exactJudgeTime);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class Tap_BM : BaseElement_BM
|
||||
{
|
||||
public float exactJudgeTime;
|
||||
|
||||
public Tap_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Tap_BM(string elementName, Guid elementGuid, List<string> tags, BaseElement_BM attachedElement, float exactJudgeTime)
|
||||
: base(elementName, elementGuid, tags, attachedElement)
|
||||
{
|
||||
this.exactJudgeTime = exactJudgeTime;
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = Tap.GenerateElement(elementName, elementGuid, tags, exactJudgeTime, GetElement(attachedElementGuid));
|
||||
}
|
||||
|
||||
public override BaseElement DuplicateBM(BaseElement parent)
|
||||
{
|
||||
return Tap.GenerateElement(elementName, elementGuid, tags, exactJudgeTime, parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user