using System.Collections.Generic; using UnityEngine; public class YogaDataLoader { public static YogaDataData LoadData(int index) { //Resources.Load("YogaActions/YogaAction" + ActionIndex); Dictionary data = new Dictionary(); #if UNITY_EDITOR data[-1] = new YogaDataData() { VideoPath = "Video/Action2", Action = AvatarAction.Nod, MaxActionCount = 1000, MustPoints = new List() { "Nose", "REye", "LEye", "Neck" }, //AnyPoints = new List() { "RWrist", "LWrist" } }; #endif data[1] = new YogaDataData() { VideoPath = "Video/Action1", Action = AvatarAction.HeadShake, MaxActionCount = 4, MustPoints = new List() { "Nose", "REye", "LEye", "Neck" } }; data[2] = new YogaDataData() { VideoPath = "Video/Action2", Action = AvatarAction.Nod, MaxActionCount = 4, MustPoints = new List() { "Nose", "REye", "LEye", "Neck" } }; data[3] = new YogaDataData() { VideoPath = "Video/Action3", Action = AvatarAction.HandsUp, MaxActionCount = 4, MustPoints = new List() { "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 MustPoints = new List(); public List AnyPoints = new List(); }