So, I’m making a GUI Background changing script to add a little user input on the user side, And I came up teh ye-olde pain in teh butt “Expressions in statements must only be executed for their side-effects”. Anybody have any idea what went wrong? I’ve examined it and I have found nothing as to what is wrong.
public var overlayCount = 0;
@HideInInspector
public var texture : Texture2D = wallpaper1;
public var wallpaper1 : Texture2D;
public var wallpaper2 : Texture2D;
public var wallpaper3 : Texture2D;
function OnGui() {
if (GUI.Button(Rect(10,10,50,30),"<-"))
overlayCount - 1;
if (overlayCount < 0){
overlayCount = 1;
}
if (GUI.Button(Rect(70,10,50,30),"->"))
overlayCount + 1;
if (overlayCount > 3){
overlayCount = 3;
}
if (overlayCount == 1){
texture = wallpaper1;
}
if (overlayCount == 2){
texture = wallpaper2;
}
if (overlayCount == 3){
texture = wallpaper3;
}
}