refactor: Update Unity to 2022.3.62

This commit is contained in:
2025-06-21 01:22:02 +08:00
parent d71bf7d4a5
commit 283783954f
112 changed files with 778 additions and 907 deletions

View File

@@ -41,7 +41,7 @@ namespace Cryville.Crtr.Event {
protected Transform RootTransform;
readonly List<SkinComponent> _comps = new List<SkinComponent>();
readonly List<SkinComponent> _comps = new();
protected IEnumerable<SkinComponent> Components { get { return _comps; } }
public Vector3 Position { get; protected set; }
@@ -68,7 +68,7 @@ namespace Cryville.Crtr.Event {
static readonly int _var_current_time = IdentifierManager.Shared.Request("current_time");
static readonly int _var_invisible_bounds = IdentifierManager.Shared.Request("invisible_bounds");
public readonly IntKeyedDictionary<PropSrc> PropSrcs = new IntKeyedDictionary<PropSrc>();
public readonly IntKeyedDictionary<PropSrc> PropSrcs = new();
SkinContainer skinContainer;
protected Judge judge;
public void AttachSystems(PdtSkin skin, Judge judge) {
@@ -76,9 +76,9 @@ namespace Cryville.Crtr.Event {
this.judge = judge;
}
public readonly IntKeyedDictionary<List<Anchor>> Anchors = new IntKeyedDictionary<List<Anchor>>();
public readonly IntKeyedDictionary<Anchor> DynamicAnchors = new IntKeyedDictionary<Anchor>();
public readonly IntKeyedDictionary<double> DynamicAnchorSetTime = new IntKeyedDictionary<double>();
public readonly IntKeyedDictionary<List<Anchor>> Anchors = new();
public readonly IntKeyedDictionary<Anchor> DynamicAnchors = new();
public readonly IntKeyedDictionary<double> DynamicAnchorSetTime = new();
Anchor a_cur;
Anchor a_head;
Anchor a_tail;
@@ -98,8 +98,7 @@ namespace Cryville.Crtr.Event {
DynamicAnchors.Add(name, result);
DynamicAnchorSetTime.Add(name, double.NaN);
}
List<Anchor> list;
if (!Anchors.TryGetValue(name, out list))
if (!Anchors.TryGetValue(name, out List<Anchor> list))
Anchors.Add(name, list = new List<Anchor>());
list.Add(result);
return result;
@@ -158,8 +157,7 @@ namespace Cryville.Crtr.Event {
}
#endregion
public virtual void Update(ContainerState s, StampedEvent ev) {
if (ev is StampedEvent.Anchor) {
var tev = (StampedEvent.Anchor)ev;
if (ev is StampedEvent.Anchor tev) {
if (tev.Target == a_head) {
if (s.CloneType == 2) SetGraphicalActive(true, s);
else SetPreGraphicalActive(true, s);
@@ -234,7 +232,7 @@ namespace Cryville.Crtr.Event {
}
}
static readonly SimpleObjectPool<StampedEvent.Anchor> anchorEvPool
= new SimpleObjectPool<StampedEvent.Anchor>(1024);
= new(1024);
void PushAnchorEvent(ContainerState state, double time, Anchor anchor, int priority = 0, bool forced = false) {
var tev = anchorEvPool.Rent();
tev.Time = time;
@@ -245,8 +243,8 @@ namespace Cryville.Crtr.Event {
state.Bus.PushTempEvent(tev);
}
public virtual void Discard(ContainerState s, StampedEvent ev) {
if (ev is StampedEvent.Anchor) {
ReturnAnchorEvent((StampedEvent.Anchor)ev);
if (ev is StampedEvent.Anchor anchor) {
ReturnAnchorEvent(anchor);
}
}
void ReturnAnchorEvent(StampedEvent.Anchor ev) {
@@ -264,8 +262,7 @@ namespace Cryville.Crtr.Event {
Anchor _openedAnchor;
public int OpenedAnchorName { get { return _openedAnchor == null ? 0 : _openedAnchor.Name; } }
public bool TryGetAnchorsByName(int name, out IReadOnlyCollection<Anchor> result) {
List<Anchor> anchors;
var ret = Anchors.TryGetValue(name, out anchors);
var ret = Anchors.TryGetValue(name, out List<Anchor> anchors);
result = anchors;
return ret;
}