public static DependencyProperty EnsureResourceKeyProperty(DependencyProperty targetProperty) { DependencyProperty resourceKeyProperty; lock (locker) { if (!DirectMap.TryGetValue(targetProperty, out resourceKeyProperty)) { resourceKeyProperty = RegisterResourceKeyProperty(targetProperty); DirectMap.Add(targetProperty, resourceKeyProperty); ReverseMap.Add(resourceKeyProperty, targetProperty); } } return(resourceKeyProperty); }
List <DirectMap> Map2Direct(Data data, AudioSource music) { Debug.Log("Jsonmap:" + data.map.Length); List <DirectMap> directMaps = new List <DirectMap>(); foreach (Map map in data.map) { DirectMap directMap = new DirectMap(); directMap.timing = Notes2Time(map.timing, data.bpm, (float)data.startTime / 100); directMap.note = map.note; directMap.isHead = map.isHead; directMaps.Add(directMap); } DirectMap EndMap = new DirectMap(); EndMap.timing = music.clip.length; EndMap.note = new int[6] { -1, 0, 0, 0, 0, 0 }; EndMap.isHead = false; directMaps.Add(EndMap); Debug.Log("directmap:" + directMaps.Count); return(directMaps); }