Health/Assets/Scripts/YogaDataLoader.cs

61 lines
1.7 KiB
C#
Raw Normal View History

2023-11-10 07:17:23 +00:00
using System.Collections.Generic;
using UnityEngine;
public class YogaDataLoader
{
public static YogaDataData LoadData(int index)
{
//Resources.Load<TextAsset>("YogaActions/YogaAction" + ActionIndex);
2023-11-12 15:09:33 +00:00
Dictionary<int, YogaDataData> data = new Dictionary<int, YogaDataData>();
#if UNITY_EDITOR
data[-1] = new YogaDataData()
{
VideoPath = "Video/Action1",
Action = AvatarAction.HeadShake,
MaxActionCount = 1000,
2023-11-13 02:53:34 +00:00
MustPoints = new List<string>() { "Nose", "REye", "LEye", "Neck" }
2023-11-12 15:09:33 +00:00
};
#endif
data[1] = new YogaDataData()
{
VideoPath = "Video/Action1",
Action = AvatarAction.HeadShake,
MaxActionCount = 4,
2023-11-13 02:53:34 +00:00
MustPoints = new List<string>() { "Nose", "REye", "LEye", "Neck" }
2023-11-12 15:09:33 +00:00
};
data[2] = new YogaDataData()
{
VideoPath = "Video/Action2",
Action = AvatarAction.Nod,
MaxActionCount = 4,
2023-11-13 02:53:34 +00:00
MustPoints = new List<string>() { "Nose", "REye", "LEye", "Neck" }
2023-11-12 15:09:33 +00:00
};
data[3] = new YogaDataData()
{
VideoPath = "Video/Action3",
Action = AvatarAction.HandsUp,
MaxActionCount = 4,
MustPoints = new List<string>() { "Nose", "RShoulder", "LShoulder", "RightWrist" }
};
2023-11-10 07:17:23 +00:00
if (data.ContainsKey(index))
return data[index];
else
{
Debug.LogError("YogaDataLoader.LoadData: index out of range");
}
2023-11-12 15:09:33 +00:00
2023-11-10 07:17:23 +00:00
return null;
}
}
public class YogaDataData
{
public string VideoPath;
public AvatarAction Action;
public int MaxActionCount;
2023-11-12 15:09:33 +00:00
public List<string> MustPoints = new List<string>();
2023-11-10 07:17:23 +00:00
}