Files
ichni_Creator_Studio/Assets/Scripts/GameElements/ElementFolder/ElementFolder.cs
2025-02-09 23:47:42 -05:00

73 lines
2.5 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using Ichni.RhythmGame.Beatmap;
using Lean.Pool;
using UnityEngine;
namespace Ichni.RhythmGame
{
public partial class ElementFolder : GameElement, IHaveTransformSubmodule, IHaveTimeDurationSubmodule
{
public List<Track> trackList;
public TransformSubmodule transformSubmodule { get; set; }
public TimeDurationSubmodule timeDurationSubmodule { get; set; }
public static ElementFolder GenerateElement(string name, Guid id, List<string> tags, bool isFirstGenerated, GameElement parentElement)
{
ElementFolder elementFolder = Instantiate(EditorManager.instance.basePrefabs.elementFolder).GetComponent<ElementFolder>();
elementFolder.Initialize(name, id, tags, isFirstGenerated, parentElement);
//elementFolder.GenerateTab(parentElement);
return elementFolder;
}
protected override void SetDefaultSubmodules()
{
transformSubmodule = new TransformSubmodule(this);
timeDurationSubmodule = new TimeDurationSubmodule(this);
submoduleList.Add(transformSubmodule);
submoduleList.Add(timeDurationSubmodule);
}
}
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);
}
}
namespace Beatmap
{
public class ElementFolder_BM : GameElement_BM
{
public ElementFolder_BM()
{
}
public ElementFolder_BM(string elementName, Guid elementGuid, List<string> 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, elementGuid, tags, false, parent);
}
}
}
}