Fix multiple init calls on skin components.
This commit is contained in:
@@ -40,7 +40,7 @@ namespace Cryville.Crtr.Event {
|
|||||||
|
|
||||||
protected Transform RootTransform;
|
protected Transform RootTransform;
|
||||||
|
|
||||||
SkinComponent[] _comps;
|
readonly List<SkinComponent> _comps = new List<SkinComponent>();
|
||||||
|
|
||||||
public Vector3 Position { get; protected set; }
|
public Vector3 Position { get; protected set; }
|
||||||
public Quaternion Rotation { get; protected set; }
|
public Quaternion Rotation { get; protected set; }
|
||||||
@@ -130,7 +130,10 @@ namespace Cryville.Crtr.Event {
|
|||||||
MatchDynamic(ps, 0);
|
MatchDynamic(ps, 0);
|
||||||
ChartPlayer.etor.ContextEvent = null;
|
ChartPlayer.etor.ContextEvent = null;
|
||||||
ChartPlayer.etor.ContextState = null;
|
ChartPlayer.etor.ContextState = null;
|
||||||
_comps = RootTransform.GetComponentsInChildren<SkinComponent>();
|
foreach (Transform child in RootTransform) {
|
||||||
|
if (child.name.Contains(':')) continue;
|
||||||
|
_comps.AddRange(child.GetComponentsInChildren<SkinComponent>());
|
||||||
|
}
|
||||||
foreach (var i in _comps) i.Init();
|
foreach (var i in _comps) i.Init();
|
||||||
}
|
}
|
||||||
public virtual void PostInit() {
|
public virtual void PostInit() {
|
||||||
|
Reference in New Issue
Block a user