为非托管数组添加释放
This commit is contained in:
Submodule Assets/Convention updated: 8e419a3257...223df3fb91
@@ -53,5 +53,11 @@ namespace Demo.Game
|
|||||||
{
|
{
|
||||||
return Count;
|
return Count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
if (Datas.IsCreated)
|
||||||
|
Datas.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace Demo.Game
|
|||||||
public MathExtension.EaseCurveType easeCurveType = MathExtension.EaseCurveType.Linear;
|
public MathExtension.EaseCurveType easeCurveType = MathExtension.EaseCurveType.Linear;
|
||||||
}
|
}
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public struct UpdatementCompiledEntries
|
public struct UpdatementCompiledEntries: IDisposable
|
||||||
{
|
{
|
||||||
public NativeArray<float> TimePoints;
|
public NativeArray<float> TimePoints;
|
||||||
public NativeArray<DataType> Positions;
|
public NativeArray<DataType> Positions;
|
||||||
@@ -35,6 +35,16 @@ namespace Demo.Game
|
|||||||
EaseCurveTypes = easeCurveTypes;
|
EaseCurveTypes = easeCurveTypes;
|
||||||
Count = count;
|
Count = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
if (TimePoints.IsCreated)
|
||||||
|
TimePoints.Dispose();
|
||||||
|
if (Positions.IsCreated)
|
||||||
|
Positions.Dispose();
|
||||||
|
if (EaseCurveTypes.IsCreated)
|
||||||
|
EaseCurveTypes.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Content = 0;
|
public int Content = 0;
|
||||||
@@ -190,5 +200,10 @@ namespace Demo.Game
|
|||||||
|
|
||||||
item.SetupDuration(new(CompiledEntries.TimePoints[0], CompiledEntries.TimePoints[^1]), GetTimelineItemColor());
|
item.SetupDuration(new(CompiledEntries.TimePoints[0], CompiledEntries.TimePoints[^1]), GetTimelineItemColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
CompiledEntries.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user