Hi guys. I need some help. I am using blender to create 3D objects. I know how to display image when button is click. but in blender the file name of the image i made is either .fbx or .obj it can't put in the texture. My question is what should i replace to display image from blender when the button is click? Any suggestions would be appreciated. Code (CSharp): using UnityEngine; using System.Collections; using System.Text.RegularExpressions; public class test1 : MonoBehaviour { public static string print = Try.aw; public GUIStyle B; public Texture2D A; public Texture2D C; bool CorrectValue; bool a; void OnGUI() { if(GUI.Button (new Rect (100, 100, 40, 40), "", B)) { if(int.Parse(print) == 1){ CorrectValue = true; } else { CorrectValue = false; } if(int.Parse(print) == 2){ a = true; } else { a = false; } } if(CorrectValue) { GUI.DrawTexture(new Rect(500,200,200,200),A); } if(a) { GUI.DrawTexture(new Rect(300,200,200,200),C); GUI.DrawTexture(new Rect(200,100,200,200),C); } } }
Use code tags to make the code more readable in the forum: http://forum.unity3d.com/threads/using-code-tags-properly.143875/
I had a look at the code and your description and I have no clue what you would like to achieve. At the moment, you are using textures in the code. Would you like to replace them with 3d objects?
yes dantus. that's my goal. we use blender to create 3d object but it has different extension. in texture you can only put images like jpeg or png but in blender it create extension .obj which is not available to put in the texture. do you have any idea on what to do so that we can have 3d objects?
You need to explain what you would like to achieve, because I am still unsure. What would you like to to with the 3d object in Unity?