// 随机选择 public void RandSelectChara() { SelectChara(RandUtil.RandArray(SelectCharasItems)); }
void RandWeather(float prop = 0.2f) { if (Data.Count <= TotalCount) { if (RandUtil.Rand(prop)) { Spawn(WeatherType.Rand <WorldWeatherType>(), new Vector2(RandUtil.RandInt(0, RealCount), RandUtil.RandInt(0, RealCount))); } } }
//随意枚举的值,枚举的序号必须从0开始 public static T Rand <T>(this Type enumType) { Array temp = Enum.GetValues(enumType); return((T)temp.GetValue(RandUtil.RandInt(0, temp.Length))); }
public void RandRotationY() { RandUtil.RandForwardY(SelfBaseUnit); GrabNewQuateration(); }
protected override void StopMove() { base.StopMove(); _animator.CrossFade("Idle" + RandUtil.RandInt(0, 4), 0.1f, 0, RandUtil.Range(0.0f, 0.9f)); }
protected override void StopMove() { base.StopMove(); _animator.CrossFade("idle" + RandUtil.RandInt(0, 2), 0.1f); }