Start() protected method

protected Start ( ) : void
return void
示例#1
0
    protected void UpdateWeather(bool autoStart)
    {
        Weather newWeather = null;

        switch (weatherType)
        {
        case WeatherType.Clear:
        case WeatherType.Clear_Blue:
            newWeather = new ClearWeather();
            break;

        case WeatherType.Rain:
        case WeatherType.Heavy_Rain:
            newWeather = new RainWeather();
            break;

        case WeatherType.Snow:
        case WeatherType.Heavy_Snow:
            newWeather = new SnowWeather();
            break;

        case WeatherType.Cloudy:
        case WeatherType.Heavy_Cloudy:
            newWeather = new CloudyWeather();
            break;
        }

        if (newWeather != null)
        {
            if (weather != null)
            {
                weather.Stop(this, -1);
                activeWeathers.Add(weather);
            }
            weather = newWeather;
            weather.Init(this);
            if (autoStart)
            {
                weather.Start(this);
            }
        }
    }
示例#2
0
 protected virtual void OnStart()
 {
     weather.Start(this);
 }