/// <summary> /// 获取当前地点的事件,返回的是EventData /// </summary> /// <param name="station"></param> /// <returns></returns> public EventData getEvent(MapStation station) { List <EventData> stationEvents = new List <EventData>(); for (int i = 0; i < mEventList.eventCount; i++) { if (mEventList.eventList[i].position.Equals(station.stationData.name)) { stationEvents.Add(mEventList.eventList[i]); } } if (stationEvents.Count > 0) { int index = Random.Range(0, stationEvents.Count - 1); return(stationEvents[index]); } else { return(null); } }
void Reset() { this.startStation = this.GetComponent <MapStation> (); }