private Sounds soundEffect; //Script for the SoundManager's sounds. void Start() { wiresList = this.gameObject.GetComponent <WireConnectorList> (); setPicker = PowerboxGameManager.instance.GetComponent <SetPicker>(); spaceList = setPicker.currentSet.GetComponent <WireSpaceList>(); playerHealth = PowerboxGameManager.instance.GetComponent <PowerboxPlayerHealth>(); //GameObject.FindWithTag ("GameController").GetComponent<PowerboxPlayerHealth> (); audioPlayer = GameObject.Find("SoundManager").GetComponent <AudioSource> (); soundEffect = GameObject.Find("SoundManager").GetComponent <Sounds> (); /*SpawnList is called here to enable the creation of more wires.*/ spawnList = PowerboxGameManager.instance.GetComponent <SpawnableObjectsList>(); }
private Sounds soundEffect; //Script for the SoundManager's sounds. // Use this for initialization void Start() { //Gets the GameManager GameObject gameManager = GameObject.Find("PowerboxGameManager"); //Get the SearchDescription script WITHIN the GameManager. searchList = gameManager.GetComponent <DescriptionList> (); //Get the Set Picker Script setList = gameManager.GetComponent <SetPicker>(); //Get the WireSpaceList Script spaceList = setList.currentSet.GetComponent <WireSpaceList> (); //Sets the name of the wirespace. wireSpace = this.gameObject; defaultSprite = wireSpace.GetComponent <Image> ().sprite; pressedSprite = wireSpace.GetComponent <Button> ().spriteState.pressedSprite; //Sets the sounds audioPlayer = GameObject.Find("SoundManager").GetComponent <AudioSource> (); soundEffect = GameObject.Find("SoundManager").GetComponent <Sounds> (); }