using UnityEngine; using System.Collections.Generic; using System; using System.Xml.Serialization; using AX.TrackRecord; using System.Collections; using UnityEngine.UI; public class RecordItemBtn : MonoBehaviour { public void ClickRecordBtn() { } /*int Index; public static bool lock_ = false; GameObject ThePfire; void Start() { //stopwatch = this.gameObject.transform.parent.parent.gameObject.GetComponent().stopwatch.gameObject;111 ThePfire = GameObject.Find("pdrawline").gameObject; } bool Has = false; void Update() { if (!kong) { return; } if (Index < ID || (Index != ID && !lock_)) //点击节点后开始重新生成事件 { Record.GetEventIndex(Index, true, false); Index++; lock_ = true; } else if (Index == ID)//生成的最后时间 { for (int i = 0; i < Record.record_Load.EventList.Count; i++) { if (Record.record_Load.EventList[i].eventType == eventTypeRecord.StartPractice) { int Id = i; if (Index >= Id) { stopwatch.gameObject.SetActive(true); TimeSpan GameTime_ = (Record.record_Load.EventList[Index].Time_).Subtract(Record.record_Load.EventList[Id].Time_).Duration(); //Stopwatch.hours = GameTime_.Hours;11 //Stopwatch.minutes = GameTime_.Minutes;11 //Stopwatch.seconds = GameTime_.Seconds;11 } else { stopwatch.gameObject.SetActive(false); } } } Record.GetEventIndex(Index, true, true); lock_ = true; Record.has = false; kong = false; Record.ComputationTime(Index); RecordManager.Instance.TheDeltaTimeSinceStartPlayBack = (float)GameTime.TotalSeconds; //改变RecordManager脚本的时间 Index++; } } public int ID; public int Num; RecordManager Record; public void GetTheID(int id, int num, RecordManager manager) { ID = id; Num = num; Record = manager; TheSumTime = (Record.record_Load.EventList[Record.record_Load.EventList.Count - 1].Time_).Subtract(Record.record_Load.StartTime).Duration(); Value = (float)(this.gameObject.transform.localPosition.x / this.gameObject.transform.parent.parent.GetComponent().Sprielength); } ArrayList List; bool kong = false; TimeSpan GameTime; GameObject stopwatch; public float Value; TimeSpan TheSumTime; public void ButtonClick() //点击节点重新生成事件,重新对进度条赋值 { foreach (Transform child in ThePfire.transform) { if (child != null) { Destroy(child.gameObject); } } Index = 0; Record.has = true; List = new ArrayList(); Record.DestroyGame(); //删除所有事件 kong = true; //控制Update GameTime = (Record.record_Load.EventList[ID].Time_).Subtract(Record.record_Load.StartTime).Duration(); //当前时间 TheSumTime = (Record.record_Load.EventList[Record.record_Load.EventList.Count - 1].Time_).Subtract(Record.record_Load.StartTime).Duration(); double df = GameTime.TotalSeconds / TheSumTime.TotalSeconds; string t = df.ToString(); Value = float.Parse(t); //TheSumTime = (Record.record_Load.EventList[Record.record_Load.EventList.Count - 1].Time_).Subtract(Record.record_Load.StartTime).Duration(); //Value = (float)(GameTime.TotalSeconds /TheSumTime.TotalSeconds); this.gameObject.transform.parent.parent.GetComponent().ClickJieDianApect(GameTime); // // this.gameObject.transform.parent.parent.GetComponent().slider.value=Value; Record.LoadObjSetToOriginalTran(); } * */ }