unity3d - How to pick up an object using a GUITexture -
How do I apply GUITExture
to select an object?
The problem is that I have a GetButtonUp input, how can I convert it to a GUI button? Usage
is a layer type of my tag type. Here's the code:
#pragma strict var primary: item; // Your Primary Item Holder Virus Secondary: Items; // Your secondary item holder var myLayerMask: LayerMask; Private War Hitime: GameAbject; / / Remember to create a new input named "Use" named raycast hit function update () {if (Input.GetButtonUp ("Use") :) {var hit: RaycastHit; Var direction = change Transform Direct (Vector 3. Forgeword); Debug Drerey (Transet Status, Direction * 2.5, Color. Blue); // If you press "Use" then Ryanka shows (Physics. Reset status, Direction, Hit, 2.5, MyLayer Mask) (if (hit.transform.tag == "item") / tag " Item "{HitItem = hit.transform.gameObject; // HitEight gets hits.gameObject Var item SCR: item script = hottime.GetCompNent (" MEDuscript "); if (item SCR.MITIM.ISSCCondary) // If hit object Secondary (if (Active.Object == blank) // Check if you have secondary item (Secondary = Item SCR.mientime; Destroyed (hit.transform.gameObject); If (Primary.Active OBJ == blank) // Check you already have // Content containing your handheld secondary. ActiveObj Active = true;} and if (primarily active obus) {if (primary activity obje active == false) {medium nonactive obbs activate = true}}}} // and also for primary :) (! ItemScr.MyItem.IsSecondary) // If the hit item is primary {if (Primary.ActiveObj == null) // If you do not have primary, then go away It is ... {primary = item SCR.mientime; destroyed (hit.transform.gameObject); If (Secondary. ActiveObj == zero) {Primary. ActivObj.active = true; } And if (Secondary Active Oct.) {If (Secondary nonactive Oct. Activated == incorrect) {Primary. Active OBJ Active = true; }}}}}}}}
to make any phone call with the GUI The ONGII method is required and usually the GUI scripts are kept separate from other parts of your program and connected to the main camera or empty object. Personally I use the main camera
It was good to walk through unity and if you want to change C #, then I suggest that Google is an ideal for this type of question Should be the source.
Comments
Post a Comment