Files
ichni_Creator_Studio/Assets/ThemeBundles/Basic/Scripts/NoteVisual/BasicNoteVisual.cs
SoulliesOfficial 7ab738cb68 架构重新设计
基本重做了所有物体和次级模块代码
2025-02-08 02:31:39 -05:00

72 lines
2.9 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using Ichni.RhythmGame.Beatmap;
using Lean.Pool;
using UnityEngine;
namespace Ichni.RhythmGame.ThemeBundles.Basic
{
public partial class BasicNoteVisual : NoteVisualBase
{
public new static BasicNoteVisual GenerateElement(string elementName, Guid id, List<string> tags,
bool isFirstGenerated, GameElement parentElement, string themeBundleName, string objectName)
{
BasicNoteVisual noteVisual = SubstantialObject.GenerateElement(elementName, id, tags,
isFirstGenerated, themeBundleName, objectName, parentElement).GetComponent<BasicNoteVisual>();
NoteBase note = parentElement as NoteBase;
if(note == null) throw new System.Exception("NoteVisual只能生成在Note下。");
noteVisual.note = note;
note.noteVisual = noteVisual;
if (isFirstGenerated)
{
note.effectSubmodule.effectCollection["Generate"].Add(new BasicNoteGenerateExpand(noteVisual.note));
note.effectSubmodule.effectCollection["Perfect"].Add(new BasicNotePerfectBurst(noteVisual.note));
note.effectSubmodule.effectCollection["Good"].Add(new BasicNoteGoodBurst(noteVisual.note));
note.effectSubmodule.effectCollection["Bad"].Add(new BasicNoteBadExpand(noteVisual.note));
note.effectSubmodule.effectCollection["Miss"].Add(new BasicNoteMissPale(noteVisual.note));
}
return noteVisual;
}
}
public partial class BasicNoteVisual
{
public override void SaveBM()
{
matchedBM = new Beatmap.BasicNoteVisual_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM, themeBundleName, objectName);
}
}
namespace Beatmap
{
public class BasicNoteVisual_BM : SubstantialObject_BM
{
public BasicNoteVisual_BM()
{
}
public BasicNoteVisual_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 = BasicNoteVisual.GenerateElement(elementName, elementGuid, tags, false,
GetElement(attachedElementGuid), themeBundleName, objectName);
}
public override GameElement DuplicateBM(GameElement parent)
{
return BasicNoteVisual.GenerateElement(elementName, elementGuid, tags, false, parent, themeBundleName, objectName);
}
}
}
}