Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public var ItemObject : GameObject[];
- public var MenuObject : GameObject[];
- public var i : int;
- public var itemstatus : int=0;
- public var menustatus : int=0;
- public var ActiveItem : int=0;
- public var infotext : GUIText;
- function Initialize()
- {
- for (i=0;i<MenuObject.Length;i++)
- {
- MenuObject[i].SetActiveRecursively(true);
- MenuObject[i].renderer.material.color = Color.white;
- }
- for (i=0;i<ItemObject.Length;i++)
- {
- ItemObject[i].SetActiveRecursively(false);
- }
- }
- function Control_Item(nr : int, status : boolean, Obj : GameObject[])
- {
- Obj[nr].SetActiveRecursively(status);
- }
- function SetObj_Color(Obj : GameObject[],Col : Color,nr : int)
- {
- Obj[nr].renderer.material.color = Col;
- }
- function Check_ItemStatus()
- {
- if (itemstatus==0) Control_Item(0,true,ItemObject);
- if (itemstatus==1) Control_Item(1,true,ItemObject);
- if (itemstatus==2) Control_Item(2,true,ItemObject);
- if (itemstatus==3) Control_Item(3,true,ItemObject);
- if (itemstatus==4) Control_Item(4,true,ItemObject);
- if (itemstatus==5) Control_Item(5,true,ItemObject);
- if (itemstatus==6) Control_Item(6,true,ItemObject);
- if (itemstatus==7) Control_Item(7,true,ItemObject);
- if (itemstatus==8) Control_Item(8,true,ItemObject);
- if (itemstatus==9) Control_Item(9,true,ItemObject);
- }
- function Check_MenuStatus()
- {
- if (menustatus==0) SetObj_Color(MenuObject,Color.red,0);
- if (menustatus==1) SetObj_Color(MenuObject,Color.red,1);
- if (menustatus==2) SetObj_Color(MenuObject,Color.red,2);
- if (menustatus==3) SetObj_Color(MenuObject,Color.red,3);
- if (menustatus==4) SetObj_Color(MenuObject,Color.red,4);
- if (menustatus==5) SetObj_Color(MenuObject,Color.red,5);
- if (menustatus==6) SetObj_Color(MenuObject,Color.red,6);
- if (menustatus==7) SetObj_Color(MenuObject,Color.red,7);
- if (menustatus==8) SetObj_Color(MenuObject,Color.red,8);
- if (menustatus==9) SetObj_Color(MenuObject,Color.red,9);
- }
- function Start()
- {
- Initialize();
- //itemstatus=1;
- }
- function Update () {
- Check_ItemStatus();
- Check_MenuStatus();
- for (var cnt1=0;cnt1<ItemObject.Length;cnt1++)
- {
- if (ItemObject[cnt1].active==true)
- {
- ActiveItem = ItemObject[cnt1];
- }
- }
- //printshit();
- }
Add Comment
Please, Sign In to add comment