Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
1
Question by Shankar · Apr 02, 2013 at 08:06 AM · guiphysicsupdatevaluestable

I have been struggling with a GUI window with table data for over a week now. What am I doing wrong?

Hi All,

Can anybody solve this problem. I struck from last one week. But i can't get any solution. in unity c# arrays not possible to develop i here.

My task is, In simple pendulum when ever i drag the bob and leave, after some time the pendulum stops. On that case i want to update a table. Depending on that values i will compare.

for any doubts and please see this link:

http://answers.unity3d.com/questions/427103/how-will-i-update-my-table-values-every-time.html

in that wrote code like this:

   void DoMyWindow3(int windowID)
  {
     
  GUI.Label(new Rect(0,0,400,100), " Length Timeperiod Angle "       +StripeValue+""+Pendulum2.Timeperiod +""+Pendulum2.count ,fontstyle);
     
 
  }


How can i implement logic for table. thing here is when ever user leaves the bob that will stop at one time on that case the values will update in to that window. please give me any code suggestions or any tutorials or any thing.

If u want full project see this link:

https://www.dropbox.com/s/6ptsqw40lol55b8/Pendulm1.unitypackage

hey please help me. At almost one week over. but my task will not go front.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by whydoidoit · Apr 02, 2013 at 08:26 AM

I think I've posted the answer to this on your other question http://answers.unity3d.com/questions/427103/how-will-i-update-my-table-values-every-time.html

Comment
Add comment · Show 3 · Share
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 Shankar · Apr 02, 2013 at 08:57 AM 0
Share

Hey $$anonymous$$r. Whydoidoit. Thanks for answering this question. I applied that code into my logic but that didn't work.

i changed my code like this:

    void Do$$anonymous$$yWindow3(int windowID)
 {
 
          GUILayout.BeginVertical("box");
 //Title row
 GUILayout.BeginHorizontal("box");
 //Display the titles
 GUILayout.Label("S.No", "button", GUILayout.Width(120));
 GUILayout.Label("Count", "button", GUILayout.Width(120));
 GUILayout.Label("Length", "button", GUILayout.Width(120));
 GUILayout.Label("Timeperiod", "button", GUILayout.Width(120));
 GUILayout.EndHorizontal();
 //Draw the elements
 for(var i = 0; i < numberOfResults; i++)
 {
 GUILayout.BeginHorizontal();
 GUILayout.Label(i.ToString(), GUILayout.Width(120));
 GUILayout.Label(Pendulum2.count.ToString(),   GUILayout.Width(120));
 GUILayout.Label(StripeValue + "m", GUILayout.Width(120));
 //Right justify
 GUILayout.BeginHorizontal(GUILayout.Width(120));
 GUILayout.FlexibleSpace();                                         GUILayout.Label(Pendulum2.Timeperiod.ToString(),                        GUILayout.Width(120));
 GUILayout.EndHorizontal();
 GUILayout.EndHorizontal();
  
 }
 GUILayout.EndVertical();
     
 

}

But that is showing

errors: 1)Unable to use a named GUIStyle without a current skin. $$anonymous$$ost likely you need to move your GUIStyle initialization code to OnGUI 2)CompareBaseObjects can only be called from the main thread. Constructors and field initializers will be executed from the loading thread when loading a scene.

so if i press play button it is not taking. if you don't $$anonymous$$d please download and it. https://www.dropbox.com/s/h6bk05dfy9pe4ay/Pendulum%202.unitypackage

avatar image whydoidoit · Apr 02, 2013 at 09:37 AM 0
Share

Create a GUISkin in your project and apply the skin by doing GUI.skin = yourNewSkin (where yourNewSkin is a reference you've dragged in to the inspector).

http://docs.unity3d.com/Documentation/ScriptReference/GUI-skin.html

avatar image whydoidoit · Apr 02, 2013 at 09:38 AM 0
Share

CompareBaseObjects implies you are running this code off the main thread - not sure how you are doing that. No time to download now I'm afraid.

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

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How will i get new line in window data? 1 Answer

How will i update my table values every time? 1 Answer

Passing values every time to table? 0 Answers

how will i get every time values in table window? 0 Answers

need help for Displaying Values? 0 Answers


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