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 Captain_Dando · Jul 17, 2012 at 02:37 PM · editorwindowtable

EditorWindow Table - is it possible?

Hi folks, is it possible to add a table to EditorWindow, which can be edited? for example, like in the column below, could I create a table with my own column headings, and the ability to add a new entry by clicking on the last entry?

alt text

Comment
Add comment · Show 3
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 Bunny83 · Jul 18, 2012 at 12:31 PM 1
Share

Is this just an arbitrary example, or do you want to make an sql table editor / creator? There are plenty of programs out there that can handle this way better ;)

The UnityGUI isn't that complicated, if you have an example data set, i can post an example.

avatar image Captain_Dando · Jul 18, 2012 at 12:38 PM 0
Share

It's to make a new table, so not for mysql or anything like that. I've learnt a bit of UnityGui so I'm going to sit down and try tackle this. Thank you for your input in any case

avatar image Bunny83 · Jul 18, 2012 at 12:56 PM 0
Share

You can take a look at my UPP editor ;)

It also uses a table / grid like editor.

3 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Paulius-Liekis · Jul 18, 2012 at 09:59 AM

No, there is no support out of the box, but you can do it yourself.

See some answers here: http://answers.unity3d.com/questions/12108/something-like-guitable-or-a-grid.html

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 Captain_Dando · Jul 18, 2012 at 11:46 AM 0
Share

Damn. Thanks anyways, I'll check it out

avatar image
2

Answer by cr4y · Apr 04, 2020 at 12:09 PM

I had the same problem so I've developed a solution.

screenshot

Please put the code below in Grid.cs file

 using UnityEngine;
 
 class Grid {
     readonly int height, width;
     Rect currentRow;
     int lastX = 0;
 
     public Grid(int width, int height) {
         this.width = width;
         this.height = height;
     }
 
     public Rect GetRect() {
         if (!EnoughSpaceInCurrentRow()) {
             currentRow = GUILayoutUtility.GetRect(width, height);
             lastX = 0;
         }
 
         return GetNextRectInCurrentRow();
     }
 
     bool EnoughSpaceInCurrentRow() {
         return currentRow.width >= lastX + width;
     }
 
     Rect GetNextRectInCurrentRow() {
         var ret = new Rect(currentRow) {x = lastX, width = width};
         lastX += width;
         return ret;
     }
 }

Then you can use it like this:

 var grid = new Grid(100, 50);
 for (int i = 1; i < 100; ++i) {
     var rect = grid.GetRect();
     GUI.Button(rect, "Button " +i);
 }

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 talhacagatayisik · Jan 21, 2021 at 07:57 PM 0
Share

Thats is very simple and beautiful, thanks.

avatar image
-1

Answer by bourriquet · Nov 24, 2018 at 04:30 PM

I looked for a way to do exactly that too, so I developed Editor GUI Table

The table has all the nice features you could expect like sorting rows, resizing, optional columns...

Just add [Table] before the collection declaration to display it in a table.

Here's how it looks: alt text

I hope it helps!

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

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 to make a visual editorwindow 0 Answers

Editor Windows - Where to get started? 1 Answer

OnDrawGizmos from EditorWindow 1 Answer

Open scene and load prefab 1 Answer

OnEditorQuit? 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