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 13, 2013 at 08:12 AM · guidisplayarraylistincrementpassing

How will display values like table?

Hi All,

In my code i am storing values like an array.

     one.Add(StripeValue.ToString()+Pendulum2.Timeperiod.ToString()+Pendulum2.count.ToString());

Displaying is some what problem i am facing

can u please tell will how will i display row by row?

My code is like this:

 foreach(string s in one) {
 GUI.Label(new Rect(0,hieght,400,10), s ,fontstyle);


Every time i want to increase hieght element. can please give how will increment the hieght variable in the code of for each statement.

Please help me.

shankar

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
1

Answer by Graham-Dunnett · Apr 13, 2013 at 03:32 PM

 foreach(string s in one) {
    GUI.Label(new Rect(0,hieght,400,10), s ,fontstyle);
    hieght += 123; // or whatever value you need to offset each row.
Comment
Add comment · Show 1 · 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 16, 2013 at 05:56 AM 0
Share

Hey $$anonymous$$r. Graham i did but i can't get.

 void Update() {
 
  if (!dragging) {
    if(anglespeed>0 && anglespeed<180)
    {
        length1 = ((anglespeed*2*($$anonymous$$athf.PI)*GUI$$anonymous$$enu.StripeValue)/180);
        speed=length1/Timeperiod;
    }
    else if(anglespeed>180 && anglespeed<=270)
    {
        angles1 = anglespeed-180;
        angles2 = 180-angles1;
        length1 = ((angles2*2*($$anonymous$$athf.PI)*GUI$$anonymous$$enu.StripeValue)/180);
        speed=length1/Timeperiod;
    }
    else if(anglespeed>-90 && anglespeed<0)
    {
        angles1 = anglespeed+90;
        length1 = ((angles1*2*($$anonymous$$athf.PI)*GUI$$anonymous$$enu.StripeValue)/180);
        speed=length1/Timeperiod;
    }
 
    float f = ($$anonymous$$athf.Sin (fTimer * speed - $$anonymous$$athf.PI / 2.0f) + 1.0f) / 2.0f ;
    v3T.Set (0.0f, 0.0f, $$anonymous$$athf.Lerp(startAngle, endAngle, f));
    pivot.eulerAngles = v3T;
    fTimer += Time.deltaTime;
    Timeperiod=(2*($$anonymous$$athf.PI)*($$anonymous$$athf.Sqrt(GUI$$anonymous$$enu.StripeValue/9.81f)))  ;
    //Debug.Log(startAngle+","+endAngle);
    
             
    if (f >= 0.5 && fPrev < 0.5) {
 // decrease angles
             
             if(startAngle>endAngle){
 
                 startAngle -=1;
                                      endAngle +=1;
                 count +=1;
                 }

             else {
                 startAngle = 270;
                 endAngle = 270;
                 
                  threevalues.Add(GUI$$anonymous$$enu.StripeValue.ToString()+Timeperiod.ToString()+count.ToString());
                 
                 Debug.Log(threevalues[0]);
                 
             }
         }
       fPrev = f;

 
     }
     }


in my code

threevalues.Add(GUI$$anonymous$$enu.StripeValue.ToString()+Timeperiod.ToString()+count.ToString());

i wrote in update method. so that condition i want only one value to store but that is storing every frame value. so my

 foreach(string s in one) {
 GUI.Label(new Rect(0,hieght,400,10), s ,fontstyle);

is disturbed. can help on that.

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

Update in one script show in another - Properties 1 Answer

UnityGUI display delay 3 Answers

Displaying multiple GUITextures On One Camera 0 Answers

Transfer ArrayList data into another script 1 Answer

Display only for one player 2 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