using System; using System.Collections; using System.Collections.Generic; using Ichni.RhythmGame.Beatmap; using Lean.Pool; using Sirenix.OdinInspector; using UnityEngine; namespace Ichni.RhythmGame { public partial class ElementFolder : GameElement, IHaveTransformSubmodule, IHaveTimeDurationSubmodule { public List trackList; public TransformSubmodule transformSubmodule { get; set; } public TimeDurationSubmodule timeDurationSubmodule { get; set; } public static ElementFolder GenerateElement(string name, Guid id, List tags, bool isFirstGenerated, GameElement parentElement) { ElementFolder elementFolder = Instantiate(GameManager.instance.basePrefabs.elementFolder).GetComponent(); elementFolder.Initialize(name, id, tags, isFirstGenerated, parentElement); return elementFolder; } public override void SetDefaultSubmodules() { transformSubmodule = new TransformSubmodule(this); timeDurationSubmodule = new TimeDurationSubmodule(this); } } public partial class ElementFolder { public override void SaveBM() { matchedBM = parentElement != null ? new ElementFolder_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM) : new ElementFolder_BM(elementName, elementGuid, tags, null); } } public partial class ElementFolder { [Button("Test GetAllNotes")] public List GetAllNotes() { List notes = new List(); foreach (GameElement element in childElementList) { if (element is NoteBase note) { notes.Add(note); } } foreach (NoteBase note in notes) { Debug.Log(note.GetType() + " " + note.elementName + " " + note.exactJudgeTime); } return notes; } } namespace Beatmap { public class ElementFolder_BM : GameElement_BM { public ElementFolder_BM() { } public ElementFolder_BM(string elementName, Guid elementGuid, List tags, GameElement_BM attachedElement) : base(elementName, elementGuid, tags, attachedElement) { } public override void ExecuteBM() { matchedElement = ElementFolder.GenerateElement(elementName, elementGuid, tags, false, GetElement(attachedElementGuid)); } public override GameElement DuplicateBM(GameElement parent) { return ElementFolder.GenerateElement(elementName, Guid.NewGuid(), tags, false, parent); } } } }