public void UpdateSceneRandomly() { if (this.SceneList.Length != 0) { int[] rates = new int[this.SceneList.Length]; for (int i = 0; i < this.SceneList.Length; i++) { rates[i] = this.SceneList[i].ChooseRate; } this._sceneId = ConfigAtmosphereUtil.ChooseRandomly(rates); } }
public int GetSceneIdRandomly() { if (this.SceneList.Length == 0) { return(0); } int[] rates = new int[this.SceneList.Length]; for (int i = 0; i < this.SceneList.Length; i++) { rates[i] = this.SceneList[i].ChooseRate; } return(ConfigAtmosphereUtil.ChooseRandomly(rates)); }