Guest User

Untitled

a guest
May 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3.  
  4. public var ItemObject : GameObject[];
  5. public var MenuObject : GameObject[];
  6. public var i : int;
  7.  
  8. public var itemstatus : int=0;
  9. public var menustatus : int=0;
  10.  
  11. public var ActiveItem : int=0;
  12.  
  13. public var infotext : GUIText;
  14.  
  15. function Initialize()
  16. {
  17.    
  18.    for (i=0;i<MenuObject.Length;i++)
  19.    {
  20.      MenuObject[i].SetActiveRecursively(true);
  21.      MenuObject[i].renderer.material.color = Color.white;
  22.    }
  23.  
  24.    for (i=0;i<ItemObject.Length;i++)
  25.    {
  26.      ItemObject[i].SetActiveRecursively(false);
  27.    }
  28.  
  29.  
  30. }
  31.  
  32.  
  33. function Control_Item(nr : int, status : boolean, Obj : GameObject[])
  34. {
  35.   Obj[nr].SetActiveRecursively(status);
  36. }
  37.  
  38.  
  39. function SetObj_Color(Obj : GameObject[],Col : Color,nr : int)
  40. {
  41.   Obj[nr].renderer.material.color = Col;
  42. }
  43.  
  44.  
  45. function Check_ItemStatus()
  46. {
  47.   if (itemstatus==0) Control_Item(0,true,ItemObject);
  48.   if (itemstatus==1) Control_Item(1,true,ItemObject);
  49.   if (itemstatus==2) Control_Item(2,true,ItemObject);
  50.   if (itemstatus==3) Control_Item(3,true,ItemObject);
  51.   if (itemstatus==4) Control_Item(4,true,ItemObject);
  52.   if (itemstatus==5) Control_Item(5,true,ItemObject);
  53.   if (itemstatus==6) Control_Item(6,true,ItemObject);
  54.   if (itemstatus==7) Control_Item(7,true,ItemObject);
  55.   if (itemstatus==8) Control_Item(8,true,ItemObject);
  56.   if (itemstatus==9) Control_Item(9,true,ItemObject);
  57. }
  58.  
  59.  
  60. function Check_MenuStatus()
  61. {
  62.   if (menustatus==0) SetObj_Color(MenuObject,Color.red,0);
  63.   if (menustatus==1) SetObj_Color(MenuObject,Color.red,1);
  64.   if (menustatus==2) SetObj_Color(MenuObject,Color.red,2);
  65.   if (menustatus==3) SetObj_Color(MenuObject,Color.red,3);
  66.   if (menustatus==4) SetObj_Color(MenuObject,Color.red,4);
  67.   if (menustatus==5) SetObj_Color(MenuObject,Color.red,5);
  68.   if (menustatus==6) SetObj_Color(MenuObject,Color.red,6);
  69.   if (menustatus==7) SetObj_Color(MenuObject,Color.red,7);
  70.   if (menustatus==8) SetObj_Color(MenuObject,Color.red,8);
  71.   if (menustatus==9) SetObj_Color(MenuObject,Color.red,9);  
  72. }
  73.  
  74.  
  75.  
  76.  
  77.  
  78. function Start()
  79. {
  80.    Initialize();
  81.    
  82.    //itemstatus=1;
  83.    
  84. }
  85.  
  86.  
  87.  
  88.  
  89. function Update () {
  90.  
  91.   Check_ItemStatus();
  92.   Check_MenuStatus();
  93.  
  94.   for (var cnt1=0;cnt1<ItemObject.Length;cnt1++)
  95.   {
  96.     if (ItemObject[cnt1].active==true)
  97.     {
  98.       ActiveItem = ItemObject[cnt1];
  99.     }
  100.    
  101.    
  102.  
  103.   }
  104.  
  105.   //printshit();
  106.  
  107.  
  108.  
  109. }
Add Comment
Please, Sign In to add comment