Tmp Fix FixedString32 being zero at runtime.

Tmp Fix FixedString32 being zero at runtime.
This commit is contained in:
max 2021-01-19 15:23:52 +01:00
parent a192fed5e9
commit 3e69eb9d84
3 changed files with 13 additions and 18 deletions

View File

@ -5,32 +5,24 @@ namespace TAO.VertexAnimation
{ {
public class VA_Animation : ScriptableObject public class VA_Animation : ScriptableObject
{ {
public VA_Animation(int a_maxFrames, int a_frames, int a_fps, int a_positionMapIndex, int a_colorMapIndex = -1) public VA_AnimationData Data;
{
Data = new VA_AnimationData(this.name, a_frames, a_maxFrames, a_fps, a_positionMapIndex, a_colorMapIndex);
}
public VA_Animation(VA_AnimationData a_data)
{
this.name = a_data.name.ToString();
Data = a_data;
}
public VA_AnimationData Data
{
get; private set;
}
// data.name will be overwritten by this.name. // data.name will be overwritten by this.name.
public void SetData(VA_AnimationData a_data) public void SetData(VA_AnimationData a_data)
{ {
a_data.name = this.name;
Data = a_data; Data = a_data;
} }
public VA_AnimationData GetData()
{
// TODO: Fix data name, FixedString32 doesn't transfer from editor?
Data.name = new FixedString32(name);
return Data;
}
public FixedString32 GetName() public FixedString32 GetName()
{ {
return Data.name; return new FixedString32(this.name);
} }
} }
} }

View File

@ -30,7 +30,9 @@ namespace TAO.VertexAnimation
{ {
foreach (VA_Animation animation in book.animations) foreach (VA_Animation animation in book.animations)
{ {
animationData.Add(animation.Data); // TODO: Fix data name, FixedString32 doesn't transfer from editor?
//animation.Data.name = new FixedString32(animation.name);
animationData.Add(animation.GetData());
} }
} }
} }

View File

@ -34,6 +34,7 @@ namespace TAO.VertexAnimation
{ {
// Copy data. // Copy data.
animationDataArray[i] = animationLib.animationLibrary.animationData[i]; animationDataArray[i] = animationLib.animationLibrary.animationData[i];
UnityEngine.Debug.Log("VA_AnimationLibrary added " + animationDataArray[i].name.ToString());
} }
// Construct blob asset reference. // Construct blob asset reference.