Image not appearing after transferring build to Mac from PC?
I have recently added a mute button to my game on my PC, but for some reason when I save and open it on my mac so I can build it onto iOS, the image for the button appears as a big white box. I have examined the buttons settings on my mac when the game is running and can see that it does not gain an image source for the button (which it does on PC). What is strange is the fact that the button image works and switches perfectly fine on my PC. Any tips?
public Sprite onButton;
public Sprite offButton;
public Button soundButton;
public Image soundButtonImage;
public int isMute;
void Start ()
{
Button btnSound = soundButton.GetComponent<Button>();
btnSound.onClick.AddListener(ChangeSound);
isMute = PlayerPrefs.GetInt("isMute", 0);
if (isMute == -1)
{
soundButtonImage.sprite = offButton;
}
if (isMute == 1)
{
soundButtonImage.sprite = onButton;
}
}
public void ChangeSound()
{
if (isMute == -1)
{
soundButtonImage.sprite = onButton;
AudioListener.volume = 1.0f;
isMute = 1;
}
else if (isMute == 1)
{
soundButtonImage.sprite = offButton;
AudioListener.volume = 0.0f;
isMute = -1;
}
PlayerPrefs.SetInt("isMute", isMute);
}
Comment
Your answer
Follow this Question
Related Questions
Button calls itself numerous times 0 Answers
Play sound only when button is pressed 1 Answer
How to implement voice overs linked with buttons? 0 Answers
Need help with Mute Button 1 Answer
How to stop and re-start audio? 1 Answer