getting error pixelInset when converted script from js to c#
using UnityEngine;
using System.Collections;
public class MYCLASSNAME : MonoBehaviour {
private bool yPositionFromTop = true;
private bool xPositionFromRight = false;
public Vector2 buttonPosition;
public float buttonSize = 1.0f;
public GUITexture getGuiTexture;
void Start (){
getGuiTexture = GetComponent<GUITexture>();
transform.position = Vector3.zero;
}
void Update (){
if(xPositionFromRight){
guiTexture.pixelInset.x = Screen.width - buttonPosition.x - guiTexture.texture.width * .5f * buttonSize;
}
else{
guiTexture.pixelInset.x = buttonPosition.x - guiTexture.texture.width * .5f * buttonSize;
}
if(yPositionFromTop){
guiTexture.pixelInset.y = Screen.height - buttonPosition.y - guiTexture.texture.height * .5f * buttonSize;
}
else{
guiTexture.pixelInset.y = buttonPosition.y - guiTexture.texture.height * .5f * buttonSize;
}
guiTexture.pixelInset.width = guiTexture.texture.width * buttonSize;
guiTexture.pixelInset.height = guiTexture.texture.height * buttonSize;
}
}
error message is:
Error Cannot modify a value type return value of UnityEngine.GUITexture.pixelInset'. Consider storing the value in a temporary variable)(1): skipped because it was sent more than once in 0.10 seconds** **Cannot modify a value type return value of UnityEngine.GUITexture.pixelInset’. Consider storing the value in a temporary variable