@@ -56,6 +56,10 @@ namespace Ichni.RhythmGame
|
||||
timeDurationSubmodule.startTime += offset;
|
||||
timeDurationSubmodule.endTime += offset;
|
||||
}
|
||||
public virtual void InvokeUpdate()
|
||||
{
|
||||
UpdateAnimation(EditorManager.instance.songInformation.songTime);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UniRx;
|
||||
using UnityEngine;
|
||||
@@ -11,10 +12,10 @@ namespace Ichni.RhythmGame
|
||||
public class BeatmapContainer : IBaseElement
|
||||
{
|
||||
public List<GameElement> gameElementList;
|
||||
|
||||
|
||||
[NonSerialized]
|
||||
public List<UnityAction> lowPriorityActions;
|
||||
|
||||
|
||||
public BaseElement_BM matchedBM { get; set; }
|
||||
|
||||
public BeatmapContainer()
|
||||
@@ -23,7 +24,7 @@ namespace Ichni.RhythmGame
|
||||
lowPriorityActions = new List<UnityAction>();
|
||||
Observable.EveryUpdate().Subscribe(_ => ExecuteLowPriorityActions());
|
||||
}
|
||||
|
||||
|
||||
public void ExecuteLowPriorityActions()
|
||||
{
|
||||
if (lowPriorityActions.Count > 0)
|
||||
@@ -47,6 +48,30 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
public IEnumerator AfterLoadSet()
|
||||
{
|
||||
Trail.FreezeAllTrails(true);
|
||||
foreach (var element in gameElementList)
|
||||
{
|
||||
element.gameObject.SetActive(false);
|
||||
if (element is IHaveTransformSubmodule haveTransform)
|
||||
{
|
||||
TransformSubmodule transformSubmodule = haveTransform.transformSubmodule;
|
||||
foreach (AnimationBase i in element.childElementList.OfType<AnimationBase>())
|
||||
{
|
||||
i.InvokeUpdate();
|
||||
}
|
||||
transformSubmodule.Refresh();
|
||||
}
|
||||
}
|
||||
yield return null;
|
||||
foreach (var element in gameElementList)
|
||||
{
|
||||
element.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
@@ -54,7 +79,7 @@ namespace Ichni.RhythmGame
|
||||
public partial class BeatmapContainer_BM : BaseElement_BM
|
||||
{
|
||||
public List<BaseElement_BM> elementList;
|
||||
|
||||
|
||||
|
||||
public BeatmapContainer_BM()
|
||||
{
|
||||
@@ -64,7 +89,7 @@ namespace Ichni.RhythmGame
|
||||
public BeatmapContainer_BM(List<GameElement> gameElementList)
|
||||
{
|
||||
elementList = new List<BaseElement_BM>();
|
||||
|
||||
|
||||
gameElementList.ForEach(e =>
|
||||
{
|
||||
e.SaveBM();
|
||||
@@ -90,7 +115,7 @@ namespace Ichni.RhythmGame
|
||||
EditorManager.instance.beatmapContainer = new BeatmapContainer();
|
||||
EditorManager.instance.beatmapContainer.matchedBM = this;
|
||||
GameElement_BM.identifier.Clear();
|
||||
|
||||
|
||||
elementList.ForEach(element =>
|
||||
{
|
||||
if (element == null)
|
||||
@@ -98,7 +123,7 @@ namespace Ichni.RhythmGame
|
||||
Debug.LogError("Null element detected in elementList. Skipping execution.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (LowPriorityGameElementTypes.Contains(element.GetType()))
|
||||
{
|
||||
return;
|
||||
@@ -125,7 +150,7 @@ namespace Ichni.RhythmGame
|
||||
element.ExecuteBM();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
EditorManager.instance.beatmapContainer.ExecuteLowPriorityActions();
|
||||
}
|
||||
}
|
||||
@@ -136,7 +161,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
//typeof(NoteJudgeSubmodule_BM),
|
||||
};
|
||||
|
||||
|
||||
public static readonly List<Type> LowPriorityDataTypes = new()
|
||||
{
|
||||
typeof(EnableControlEffect_BM),
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Ichni.RhythmGame
|
||||
public bool isShowingSphere;
|
||||
|
||||
public static PathNode GenerateElement(string elementName, Guid id, List<string> tags, bool isFirstGenerated,
|
||||
Track track, bool isShowingSphere)
|
||||
Track track, bool isShowingSphere, int index = -1)
|
||||
{
|
||||
PathNode pathNode = Instantiate(EditorManager.instance.basePrefabs.pathNode, track.transform)
|
||||
.GetComponent<PathNode>();
|
||||
@@ -39,7 +39,15 @@ namespace Ichni.RhythmGame
|
||||
pathNode.track = track;
|
||||
pathNode.isShowingSphere = isShowingSphere;
|
||||
pathNode.SetPathNodeSphere(isShowingSphere);
|
||||
track.trackPathSubmodule.pathNodeList.Add(pathNode);
|
||||
if (index < 0)
|
||||
{
|
||||
track.trackPathSubmodule.pathNodeList.Add(pathNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
track.trackPathSubmodule.pathNodeList.Insert(index, pathNode);
|
||||
}
|
||||
|
||||
|
||||
return pathNode;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user