Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by prajaprihana · Nov 05, 2015 at 01:09 PM · multiplesetactivemultiple objects

please help me with AR multiple object

please help me, i wish when button "home" pressed it will only show (game object "home") "lt1" pressed it will only show (game object "lt1") "lt2" pressed it will only show (game object "lt2") i'm using setactive but it's not happen anything, please help me

 using UnityEngine;
 using System.Collections;
 public class Srisoeta : MonoBehaviour {
     
 
     public    GUISkin    guiSkin;
     public    float    guiRatio;
     public    float    sWidth;
     public    Vector3    GUIsF;
     
     public    GameObject home;
     public    GameObject lt1;
     public    GameObject lt2;
     
     void Awake(){
         sWidth = Screen.width;
         guiRatio = sWidth/1920;
         GUIsF = new Vector3(guiRatio,guiRatio,1);
     }
     void OnGUI(){
         GUI.skin = guiSkin;
 
         MultiObject ();
     }
     
     void MultiObject(){
         
 
         GUI.matrix = Matrix4x4.TRS (new Vector3 (GUIsF.x, GUIsF.y, 0), Quaternion.identity, GUIsF);
         if (GUI.Button (new Rect (20, 20, 256, 100), "home")) {
             home.SetActive (true);
             lt1.SetActive (false);
             lt2.SetActive (false);
             
         }
         
         if (GUI.Button (new Rect (20, 150, 256, 100), "lt1")) {
             home.SetActive (false);
             lt1.SetActive (true);
             lt2.SetActive (false);
             
         }
         
         if (GUI.Button (new Rect (20, 280, 256, 100), "lt2")) {
             home.SetActive (false);
             lt1.SetActive (false);
             lt2.SetActive (true);
             
         }
         
         if(GUI.Button(new Rect(20,540,256,100),"Exit")){
             Application.LoadLevel(1);
         }
         
     }
 }



Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image $$anonymous$$ · Nov 05, 2015 at 06:02 PM 0
Share

I brought that code into Unity (5.1.3f1), and it seems like it works fine for me. Are you just trying to have each button enable it's corresponding GameObject and disable the others?

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How do I get Unity/Salsa to read a multiple mic interface?,How do I get multiple mics from one interface to work in Unity/Salsa 0 Answers

physics.OverlapSphere colliders 1 Answer

Attaching multiple objects to one object with script. 1 Answer

Multiple players on single controller 2 Answers

How to play the same animation multiple times? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges