Esempio n. 1
0
 /// <summary>
 /// 현재 날씨에 따라서(웨더매니저.겟메인웨더), 어떤 함수를 호출할 지를 바꿉니다.
 /// </summary>
 public virtual void ChangeState()
 {
     currentMainWeatherType = WeatherManager.Instance.GetMainWeather();
     if (currentMainWeatherType != affectedWeather)
     {
         Debug.Log("Weather is Different");
         ChangeDelegate(currentMainWeatherType);
     }
     else
     {
     }
 }
Esempio n. 2
0
    /// <summary> 메인 날씨를 변경합니다. 날씨가 바뀌고 있는 도중이라면 false를 반환하며, 날씨가 변경되지 않습니다. 정상적으로 변경할 시 true를 반환합니다. </summary>
    public bool SetMainWeather(eMainWeatherType mWeatherType)
    {
        //날씨가 바뀌고 있는 중이면 SetWeather이 적용되지 않음.
        if (isMainWeatherChanging == true)
        {
            return(false);
        }

        prevMainWeather = nowMainWeather;
        nowMainWeather  = mWeatherType;

        StartCoroutine(runMainWeatherTimer());

        return(true);
    }
Esempio n. 3
0
    protected void ChangeDelegate(eMainWeatherType _wt)
    {
        Debug.Log("ChangeDelegate");
        switch (_wt)
        {
        case eMainWeatherType.SUNNY:
            EnterSunny();
            weatherDelegate = ProcessSunny;
            break;

        case eMainWeatherType.RAINY:
            EnterRainy();
            weatherDelegate = ProcessRainy;
            break;

        default:
            weatherDelegate = ProcessSunny;
            break;
        }
        affectedWeather = _wt;
    }
Esempio n. 4
0
 /// <summary>
 /// 이게 그냥 StageWeatherType이라는 게 될 수 있음. 주의하기.
 /// 그렇다면, 그냥 ChangeCanUse에서 디폴트웨더타입 대신 스테이지 웨더 ㅌ타입을 사용하면 됨.
 /// </summary>
 protected void SetDefaultWeatherType()
 {
     defaultWeatherType = WeatherManager.Instance.GetMainWeather();
 }
Esempio n. 5
0
 /// <summary>
 /// 기본적으로 SUNNY로 초기화합니다.
 /// </summary>
 public virtual void Init()
 {
     currentMainWeatherType = WeatherManager.Instance.GetMainWeather();
     affectedWeather        = WeatherManager.Instance.GetMainWeather();
     ChangeDelegate(affectedWeather);
 }