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);
        }
Beispiel #2
0
        public static Perk Random()
        {
            Type type = Randomf.Element(types);

            return((Perk)Activator.CreateInstance(type));
        }
Beispiel #3
0
 protected override System.Type RandomArchetype()
 {
     System.Type[] array = EyeOrbiterType.types.Values.ToArray();
     return(Randomf.Element(array));
 }