void Start() { BuildFurnitureTypeMap(); randomSound = GetComponent <RandomSound>(); placedFurniture = new List <Furniture>(); placedDecorations = new List <Decoration>(); placedRugs = new List <Rug>(); tempCoordinates = new List <Vector3>(); rugCoordinates = new List <Vector3>(); RearrangeFurniture(); }
private void LoadResources() { // Get sprites from multiple sprite stuff Sprite[] allSprites = Resources.LoadAll <Sprite>("Textures/Animation/X/Xanimation0"); xSprite = allSprites[allSprites.Length - 1]; allSprites = Resources.LoadAll <Sprite>("Textures/Animation/O/OAnimation0"); oSprite = allSprites[allSprites.Length - 1]; // Load sounds oPlaceSounds = Resources.Load <RandomSound>("Sounds/Drawing/RandomOPlaceSound"); xPlaceSounds = Resources.Load <RandomSound>("Sounds/Drawing/RandomXPlaceSound"); }
/// <summary> /// Start an audio of a random bank /// </summary> /// <param name="a_randomSoundType">id of the random bank</param> /// <param name="a_mixerGroupType">id of the mixer we want to output through</param> public void StartRandom(RANDOM_SOUND_TYPE a_randomSoundType, MIXER_GROUP_TYPE a_mixerGroupType) { RandomSound randomSound = m_listRandomSound.Find(x => x.Type == a_randomSoundType); if (randomSound.ListSounds.Count > 0) { int rnd = (int)Utils.RandomFloat(0, randomSound.ListSounds.Count); AudioClip toPlay = randomSound.ListSounds[rnd]; randomSound.AudioSourceKey = StartAudio(randomSound.ListSounds[rnd], a_mixerGroupType, false, false, (AUDIOSOURCE_KEY)randomSound.AudioSourceKey); randomSound.EverUsed.Add(toPlay); randomSound.ListSounds.Remove(toPlay); if (randomSound.ListSounds.Count == 0) { randomSound.ListSounds.AddRange(randomSound.EverUsed); randomSound.EverUsed.Clear(); } } }
// Use this for initialization void Start() { this.attack = GetComponentInParent <Attack>(); this.wallHit = GetComponent <RandomSound>(); this.audioSource = GetComponentInParent <AudioSource>(); }
void Start() { sound = GetComponent <RandomSound>(); UpdateText(); }