public void PlayRandom(GameObject obj) { if (clips.Length == 0) { Debug.LogWarning($"RandomCLips {name} in {obj.name} has no clips"); return; } AudioEntity ae = clips.Length == 1 ? clips[0] : Randomf.Element(clips); if (!ae.clip) { Debug.LogWarning($"Random AudioEntity in {obj.name} is missing a clip"); return; } ae.Play(obj); }
public static Perk Random() { Type type = Randomf.Element(types); return((Perk)Activator.CreateInstance(type)); }
protected override System.Type RandomArchetype() { System.Type[] array = EyeOrbiterType.types.Values.ToArray(); return(Randomf.Element(array)); }