Esempio n. 1
0
    /// <summary>
    /// Get a random station in the scene for testing.
    /// </summary>
    /// <returns></returns>
    public int GetRandomStationId()
    {
        StationController station;

        do
        {
            int index = Mathf.RoundToInt(UnityEngine.Random.Range(0, StationCount - 1));
            station = Stations.ElementAt(index).Value;
        } while (station.outOfService);
        return(int.Parse(station.name));
    }
        private void timer_Tick(object sender, EventArgs e)
        {
            var index = Stations.IndexOf(SelectedStationMap);

            if (index == Stations.Count - 1)
            {
                //var station = Stations.FirstOrDefault();
                //station?.LoadRelatedInfo();
                ;
                SelectedStationMap = Stations.FirstOrDefault();
            }
            else
            {
                //var station = Stations.ElementAt(index + 1);
                //station?.LoadRelatedInfo();
                SelectedStationMap = Stations.ElementAt(index + 1);
            }
        }