Health/Assets/Scripts/YogaDataLoader.cs

63 lines
1.8 KiB
C#

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