VolumeControl.Start C# (CSharp) Method

Start() public method

public Start ( ) : void
return void
    void Start()
    {
        ambiente2 = gameObject.AddComponent<AudioSource>();
        //ambiente2.clip = Resources.Load("Sounds/music1") as AudioClip;
        ambiente2.volume = 0.5f;
        //ambiente2.Play();
        GameObject menuVol;
        myBtn = GameObject.Find("ButtonSound").GetComponent<Button>();;
        myImage = Resources.Load<Sprite>("mute"); // Make sure not to include the file extension
        //Make sure it is added in the Inspector. Or reference it using GameObject.Find.
        myBtn.image.sprite = myImage; // That is right, no need to GetComponent.

        //ambiente2.GetComponent.<VolumeControlAccess>().xxx = 2;
        //artificialIntelligence = GameObject.Find("EnemyPlayer1").GetComponent<Player>();
        //civilitzation = GameObject.Find("EnemyPlayer1").GetComponent<Player>().civilization;
    }