Hold初步
This commit is contained in:
@@ -1,18 +1,75 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
public class BasicHoldVisual : MonoBehaviour
|
||||
namespace Ichni.RhythmGame.ThemeBundles.Basic
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
public partial class BasicHoldVisual : NoteVisualBaseHold
|
||||
{
|
||||
public static BasicHoldVisual GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, GameElement parentElement, string themeBundleName, string objectName)
|
||||
{
|
||||
BasicHoldVisual holdVisual = SubstantialObject.GenerateElement(elementName, id, tags,
|
||||
isFirstGenerated, themeBundleName, objectName, parentElement).GetComponent<BasicHoldVisual>();
|
||||
|
||||
return holdVisual;
|
||||
}
|
||||
|
||||
public override void FirstSetUpObject(bool isFirstGenerated)
|
||||
{
|
||||
NoteBase note = parentElement as NoteBase;
|
||||
if(note == null) throw new System.Exception("NoteVisual只能生成在Note下。");
|
||||
this.note = note;
|
||||
note.noteVisual = this;
|
||||
|
||||
if (isFirstGenerated)
|
||||
{
|
||||
effectSubmodule.effectCollection["Generate"].Add(new BasicNoteGenerateExpand(this));
|
||||
effectSubmodule.effectCollection["Holding"].Add(new BasicNoteHoldingExpand(this));
|
||||
effectSubmodule.effectCollection["Perfect"].Add(new BasicNotePerfectBurst(this));
|
||||
effectSubmodule.effectCollection["Good"].Add(new BasicNoteGoodBurst(this));
|
||||
effectSubmodule.effectCollection["Bad"].Add(new BasicNoteBadShrink(this));
|
||||
effectSubmodule.effectCollection["Miss"].Add(new BasicNoteMissPale(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public partial class BasicHoldVisual
|
||||
{
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new Beatmap.BasicHoldVisual_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM, themeBundleName, objectName);
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
namespace Beatmap
|
||||
{
|
||||
|
||||
public class BasicHoldVisual_BM : SubstantialObject_BM
|
||||
{
|
||||
public BasicHoldVisual_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public BasicHoldVisual_BM(string elementName, Guid id, List<string> tags,
|
||||
GameElement_BM parent, string themeBundleName, string objectName) :
|
||||
base(elementName, id, tags, parent, themeBundleName, objectName)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = BasicHoldVisual.GenerateElement(elementName, elementGuid, tags, false,
|
||||
GetElement(attachedElementGuid), themeBundleName, objectName);
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return BasicHoldVisual.GenerateElement(elementName, Guid.NewGuid(), tags, false, parent, themeBundleName, objectName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,10 @@ using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.Basic
|
||||
{
|
||||
public class BasicNoteBadExpand : NoteBadEffect
|
||||
public class BasicNoteBadShrink : NoteBadEffect
|
||||
{
|
||||
Renderer noteMainRenderer;
|
||||
public BasicNoteBadExpand(NoteVisualBase noteVisual)
|
||||
public BasicNoteBadShrink(NoteVisualBase noteVisual)
|
||||
{
|
||||
this.note = noteVisual.note;
|
||||
this.noteVisual = note.noteVisual;
|
||||
@@ -29,39 +29,39 @@ namespace Ichni.RhythmGame.ThemeBundles.Basic
|
||||
public override void Adjust()
|
||||
{
|
||||
noteMainRenderer.material.DOColor(Color.clear, effectTime).SetEase(Ease.OutQuad);
|
||||
noteVisual.noteMain.transform.DOScale(Vector3.one * 1.5f, effectTime).SetEase(Ease.OutQuad).OnComplete(() => noteVisual.noteMain.SetActive(false));
|
||||
noteVisual.noteMain.transform.DOScale(Vector3.zero, effectTime).SetEase(Ease.OutQuad).OnComplete(() => noteVisual.noteMain.SetActive(false));
|
||||
}
|
||||
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new Beatmap.BasicNoteBadExpand_BM(effectTime);
|
||||
return new Beatmap.BasicNoteBadShrink_BM(effectTime);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("Basic Note Bad Expand");
|
||||
var container = inspector.GenerateContainer("Basic Note Bad Shrink");
|
||||
var effectTimeField = inspector.GenerateInputField(this, container, "Effect Time", nameof(effectTime));
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class BasicNoteBadExpand_BM : NoteBadEffect_BM
|
||||
public class BasicNoteBadShrink_BM : NoteBadEffect_BM
|
||||
{
|
||||
public BasicNoteBadExpand_BM()
|
||||
public BasicNoteBadShrink_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public BasicNoteBadExpand_BM(float effectTime) : base(effectTime)
|
||||
public BasicNoteBadShrink_BM(float effectTime) : base(effectTime)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
||||
{
|
||||
return new BasicNoteBadExpand(attachedGameElement as NoteVisualBase);
|
||||
return new BasicNoteBadShrink(attachedGameElement as NoteVisualBase);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.Basic.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.ThemeBundles.Basic
|
||||
{
|
||||
public class BasicNoteHoldingExpand : NoteHoldingEffect
|
||||
{
|
||||
public BasicNoteHoldingExpand(NoteVisualBaseHold noteVisual)
|
||||
{
|
||||
this.note = noteVisual.note;
|
||||
this.noteVisual = noteVisual;
|
||||
this.effectTime = GetHoldingTime();
|
||||
}
|
||||
|
||||
public override void Recover()
|
||||
{
|
||||
noteVisual.noteMain.SetActive(true);
|
||||
noteVisual.noteMain.transform.localScale = Vector3.one;
|
||||
this.effectTime = GetHoldingTime();//TODO: 后续改为修改Hold的判定时间和结束时间时,自动调整effectTime
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
noteVisual.noteMain.transform.localScale = Vector3.one * 2f;
|
||||
}
|
||||
|
||||
public override void Execute()
|
||||
{
|
||||
noteVisual.noteMain.transform.localScale = Vector3.one + Vector3.one * effectProgressPercent;
|
||||
}
|
||||
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new BasicNoteHoldingExpand_BM(effectTime);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("Basic Note Holding Expand");
|
||||
var holdingTimeText = inspector.GenerateHintText(this, container, () => $"Holding Time: {GetHoldingTime()}");
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class BasicNoteHoldingExpand_BM : NoteHoldingEffect_BM
|
||||
{
|
||||
public BasicNoteHoldingExpand_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public BasicNoteHoldingExpand_BM(float effectTime) : base(effectTime)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
||||
{
|
||||
return new BasicNoteHoldingExpand(attachedGameElement as NoteVisualBaseHold);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 971e63ea1e76642e7931d0b40be179bc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -30,7 +30,7 @@ namespace Ichni.RhythmGame.ThemeBundles.Basic
|
||||
effectSubmodule.effectCollection["Generate"].Add(new BasicNoteGenerateExpand(this));
|
||||
effectSubmodule.effectCollection["Perfect"].Add(new BasicNotePerfectBurst(this));
|
||||
effectSubmodule.effectCollection["Good"].Add(new BasicNoteGoodBurst(this));
|
||||
effectSubmodule.effectCollection["Bad"].Add(new BasicNoteBadExpand(this));
|
||||
effectSubmodule.effectCollection["Bad"].Add(new BasicNoteBadShrink(this));
|
||||
effectSubmodule.effectCollection["Miss"].Add(new BasicNoteMissPale(this));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user