Hi everyone
I again another problem in my inventory!
I try to call a GUI texture that gives information when we click on the object in the inventory pick
here is what I have realized:
Image
if i pick up object number one it true
and if pick up object number three its not work
Here we see that all walk the way I want except that if I pick up the objects of an order
different texture that does voice over the GUI texture is not displayed
here is the script
public void Bag ( float posX , float posY , float sX , float sY ){
GUI.BeginGroup(new Rect(Screen.width - posX, Screen.height - posY, sX, sY));
GUI.Box (new Rect (0, 0, sX, sY), bagName);
for ( int i = 0; i < 5; i++) {
for (int j = 0; j < 9; j++) {
if (ctrl.GetObjectsInBag(offsetBag + (5*i)+j) == null) {
tmpTexture = defaultTextureSlots;
}else{
tmpTexture = ctrl.GetObjectsInBag(offsetBag +(5*i)+j).GetComponent<ObjectInfo>().iconTexture;
}
if (GUI.Button (new Rect (slotSize * j + spacingBetweenSlots * (j + 9) + 10, slotSize * i + spacingBetweenSlots * (i + 5) + 15, slotSize, slotSize), tmpTexture)) {
if (ctrl.GetObjectsInBag(offsetBag + (5*i)+j) != null)
{
button = true;
ctrl.mouseTextureHanding.SetCursor(ctrl.GetObjectsInBag(offsetBag +(5*i)+j).GetComponent<ObjectInfo>().iconTexture);
ctrlEssai.objectInfo.SetCursorEssai(ctrl.GetObjectsInBag(offsetBag +(5*i)+j).GetComponent<ObjectInfo>().iconTexture);
ctrlEssai.objectInfoInventaire.SetCursorEssai(ctrl.GetObjectsInBag(offsetBag +(5*i)+j).GetComponent<ObjectInfoInventaire>().iconTexture);
}
}
}
}
GUI.EndGroup();
}
public void BagEssaiInfo ( float posX , float posY , float sX , float sY ){
for ( int i = 0; i < 1; i++) {
for (int j = 0; j < 1; j++) {
if (ctrl.GetObjectsInBag(offsetBag + (0*i)+j) == null) {
tmpTextureEssai = defaultTextureSlots;
}else{
tmpTextureEssai = ctrl.GetObjectsInBag(offsetBag +(1*i)+j).GetComponent<ObjectInfoInventaire>().infoTexture;
}
if (GUI.Button (new Rect (slotSize * j + spacingBetweenSlots * (j + 1) + 0, slotSize * j + spacingBetweenSlots * (i + 1) + 0, slotSize, slotSize), tmpTextureEssai)) {
}
}
}
}
}
If I change the script and I write in paragraph BagEssaiInfo
for ( int i = 0; i < 3; i++) {
for (int j = 0; j < 1; j++) {
It works except that saw that there was 3 GUI texture is not the picture perfect voice
there would be someone there could help me make the texture appears correctly when I click on the GUI Texture pick


