public BeatKey(BeatKey beatKey) { time = beatKey.time; type = beatKey.type; weight = beatKey.weight; position = beatKey.position; }
private IKeyObject createKeyInstance(BeatKey beatKey) { GameObject gameObject = Instantiate(regularKeyPrefab); IKeyObject keyObject = gameObject.GetComponent <IKeyObject>(); keyObject.initial(beatKey); return(keyObject); }
public bool setPointer(int index) { if (index > beatMap.Count - 1 || index < 0) { return(false); } pointer = index; mReader = beatMap[pointer]; return(true); }
public bool read() { if (pointer > beatMap.Count - 1) { return(false); } mReader = beatMap[pointer]; pointer++; return(true); }
public void test() { BeatKey beatKey = new BeatKey((int)showTime(), 1, 3, 1); IKeyObject keyObject; //if (recycleList.Count > 0) //{ // keyObject = recycleList[0]; // recycleList.RemoveAt(0); // keyObject.initial(beatKey); //} //else //{ // keyObject = createKeyInstance(beatKey); //} keyObject = createKeyInstance(beatKey); showList.Add(keyObject); keyObject.startWork(); }
private void readTimeLineXML(XmlReader reader) { int time = XmlConvert.ToInt32(reader.GetAttribute("time")); BeatKey key; while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element && reader.Name == "key") { key = new BeatKey(); key.time = time; key.type = XmlConvert.ToInt32(reader.GetAttribute("type")); key.weight = XmlConvert.ToInt32(reader.GetAttribute("weight")); key.position = XmlConvert.ToInt32(reader.GetAttribute("position")); beatMap.Add(key); } if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "timeline") { return; } } }
public void initial(BeatKey beatKey) { setTime(beatKey.time); setWeight(beatKey.weight); setPosition(beatKey.position); }