Ejemplo n.º 1
0
 void Play()
 {
     if (BaseGlobal == null)
     {
         return;
     }
     if (Clips == null)
     {
         CLog.Error("BaseAudioPlay没有配置音频文件:{0}", name);
     }
     if (!Is2D)
     {
         AudioSource = BaseGlobal.AudioMgr.PlaySFX(
             BaseMathUtils.RandArray(Clips),
             Pos,
             IsLoop,
             IsCache,
             IsForce,
             Volume * BaseGlobal.AudioMgr.GetRealVolumeSFX());
     }
     else
     {
         AudioSource = BaseGlobal.AudioMgr.PlayUI(BaseMathUtils.RandArray(Clips), IsLoop);
     }
 }
Ejemplo n.º 2
0
        public string GetFemale(bool isTrans = false)
        {
            string ret = BaseMathUtils.RandArray(Last) + BaseLanguageMgr.Space + BaseMathUtils.RandArray(Female);

            if (isTrans)
            {
                return(BaseLanguageMgr.Get(ret));
            }
            return(ret);
        }
Ejemplo n.º 3
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);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 随机选择
 /// </summary>
 public void RandSelect()
 {
     Select(BaseMathUtils.RandArray(SelectItems));
 }