Ejemplo n.º 1
0
        public void Change(SeasonType type, bool isForce = false)
        {
            if (!isForce)
            {
                if (type == SeasonType)
                    return;

            }
            SeasonType = type;
            CurData = RandUtil.RandArray(Data[type]);
            if (sunTween != null) DOTween.Kill(sunTween);
            if (snowTween != null) DOTween.Kill(snowTween);
            sunTween = DOTween.To(() => SunObj.Obj.intensity, x => SunObj.Obj.intensity = x, CurData.SunIntensity, 1.0f);
            ChangeWindPower(CurData.WindzonePower);
            if (IsShowSnow)
            {
                snowTween = DOTween.To(() => ActiveTerrainMat.GetFloat("_SnowAmount"), x => ActiveTerrainMat.SetFloat("_SnowAmount", x), CurData.AccumulatedSnow, 1.0f);
            }
            Callback_OnSeasonChanged?.Invoke(type, CurData.Type);
            OnSeasonChanged(type, CurData.Type);
        }
Ejemplo n.º 2
0
 public void Change(SeasonType type, bool isForce = false)
 {
     if (!isForce)
     {
         if (type == SeasonType)
         {
             return;
         }
     }
     SeasonType = type;
     CurData    = BaseMathUtils.RandArray(Data[type]);
     if (sunTween != null)
     {
         DOTween.Kill(sunTween);
     }
     if (snowTween != null)
     {
         DOTween.Kill(snowTween);
     }
     sunTween      = DOTween.To(() => Sun.intensity, x => Sun.intensity = x, CurData.SunIntensity, 1.0f);
     Wind.windMain = CurData.WindzonePower;
     snowTween     = DOTween.To(() => ActiveTerrainMat.GetFloat("_SnowAmount"), x => ActiveTerrainMat.SetFloat("_SnowAmount", x), CurData.AccumulatedSnow, 1.0f);
     Callback_OnSeasonChanged?.Invoke(type, CurData.Type);
 }