void Play() { if (BaseGlobal == null) { return; } if (Clips == null) { CLog.Error("BaseAudioPlay没有配置音频文件:{0}", name); } if (!Is2D) { AudioSource = BaseGlobal.AudioMgr.PlaySFX( RandUtil.RandArray(Clips), Pos, IsLoop, IsCache, IsForce, Volume * BaseGlobal.AudioMgr.GetRealVolumeSFX()); } else { AudioSource = BaseGlobal.AudioMgr.PlayUI(RandUtil.RandArray(Clips), IsLoop); } }
// 只获得名称 public string RandName(bool isTrans = false) { string ret = RandUtil.RandArray(All); if (isTrans) { return(BaseLanguageMgr.Get(ret)); } return(ret); }
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); }
// 随机选择 public void RandSelectChara() { SelectChara(RandUtil.RandArray(SelectCharasItems)); }