Toggle button problem

 var ren : Renderer;   // renderer material
 var male : Texture2D;
 var female : Texture2D;
 var a1  = 0;
 var myskin : GUISkin;
 var togglemale : boolean = false;
 var togglefemale : boolean = true;

 function OnGUI () 
 {
   GUI.skin = myskin;
   togglemale= GUI.Toggle(Rect(Screen.width*(4.1/6.55),Screen.height*(    (4.7/6.3),Screen.width*(1.3/6.55),Screen.height*(.5/6.3)),togglemale,"MALE");
   togglefemale = GUI.Toggle(Rect(Screen.width*(4.1/6.55),Screen.height*(5.7/6.3),Screen.width*(1.3/6.55),Screen.height*(.5/6.3)),togglefemale,"FEMALE");

  if (togglemale== true)
  {
  ren.renderer.material.mainTexture = male;
  Debug.Log ("mmm");
   }

  if (togglefemale== true)
  {
  ren.renderer.material.mainTexture = female;
  Debug.Log ("fff");
  }

 }

i am new to unity my probelm is i am using a gui.toggle button named as MALE and FEMALE my need is when i select Male button male texture should display when i click FEMALE button female texture should display. But toggle button is not working properly .I have used renderer as cube

I think you need to use one toggle instead of two. As it is, you have four potential combinations: male TRUE, female TRUE; male FALSE, female FALSE; male TRUE, female FALSE; and male FALSE, female TRUE.

Use one toggle ("genderToggle") and:

  if (genderToggle == true)
  {
  ren.renderer.material.mainTexture = male;
  Debug.Log ("mmm");
   } else {
  ren.renderer.material.mainTexture = female;
  Debug.Log("fff");
  }

Also your GUI code has some errors. It should be:

   togglemale= GUI.Toggle(Rect(Screen.width*(4.1/6.55),Screen.height*(    (4.7/6.3),Screen.width*(1.3/6.55),Screen.height*(.5/6.3)),togglemale,"MALE");
   togglefemale = GUI.Toggle(Rect(Screen.width*(4.1/6.55),Screen.height*(5.7/6.3),Screen.width*(1.3/6.55),Screen.height*(.5/6.3)),togglefemale,"FEMALE");

By using "toggleMale" instead of "togglemale", you declared a new variable instead of referring to the variable you declared at the top of the script.

Design3.com is right, don't use 2 variables for the same inforamtion.

use this with the example code from Design3

var genderToggle : boolean = false;

genderToggle = GUI.Toggle(Rect([...]),genderToggle,"MALE");
genderToggle = !GUI.Toggle(Rect([...]),!genderToggle,"FEMALE");

or what would be better in such a case, use a ToolBar.

var gender : int = 0;
var toolbarStrings : String[] = ["MALE", "FEMALE"];

function OnGUI () {
   [...]
   gender = GUI.Toolbar(Rect ([...]), gender, toolbarStrings);
   if (gender == 0)
   {
      //Male
      [...]
}

To make a vertical toolbar use a SelectionGrid with xCount = 1