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
3
Question by Mike 4 · May 19, 2010 at 02:55 AM · editoreditor-scriptingmenugridlevel-editor

How do I make a level editor in the editor

In my project once it starts up. I am creating a grid. each node has specific data. What I need to do is to create the grid in edit mode so I can change some of the nodes data.

I am aware I can addComponentMenu but not sure how to make it all work.

When we create this grid in edit mode I also need to save the changes so when I do run the game the node data is the same as the node data in the edit mode.

Any help would be appreciated thanks.

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
2

Answer by qJake · May 19, 2010 at 04:05 AM

You can write your own Editor script to automate some of the things you may need to do repetitively while editing your game.

See the Editor Scripting Reference for a list of objects you can use in your editor scripts. You can also see this handy-dandy guide on How to extend the Unity Editor.

More editor example scripts can be found here at the Unify Community Wiki.

Comment
Add comment · Show 5 · 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 Mike 4 · May 19, 2010 at 04:15 AM 0
Share

I have looked at all that info and it's helping me out a bit. I have a custom inspecotr that has a slider for row and columns. Also a button to create the grid based on the row and colums. It works and creates my nodes in the editor. The problem I have is that once I run the game any changes I make to the nodes aren't saved and neither is the grid i made

avatar image qJake · May 19, 2010 at 05:14 AM 0
Share

If you make changes to your game while it's in Play $$anonymous$$ode (the Play button is ON at the top), then your changes won't be saved. You can only make permanent changes when you aren't in "play mode".

avatar image claytoncurmi · Aug 13, 2010 at 07:07 AM 0
Share

Hi! I have a similar problem to yours! I'm trying to set class variables through getters & setters. I wrote a custom editor that exposes these methods. The code works just fine, that is if I change values while the game is in play mode, these values are passed to the respective variables. However if I set the values in edit mode, the values are lost as soon as I click on the Play button (values are actually set to the default). I've added the @script ExecuteInEdit$$anonymous$$ode() but to no avail! How can persist the changes I've made in the custom editor while in edit mode?

avatar image john-essy · Jul 13, 2012 at 07:47 PM 0
Share

in C# add this to the top of your code [ExecuteInEdit$$anonymous$$ode] and JS

@script ExecuteInEdit$$anonymous$$ode()

avatar image john-essy · Jul 13, 2012 at 07:47 PM 0
Share

Sorry just realised this is like a year old

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

1 Person is following this question.

avatar image

Related Questions

How do I create a new object in the Editor as a child of another object? 1 Answer

Override scene view grid with my own? 0 Answers

Editor Scripting Question 1 Answer

Editor menus are invisible 1 Answer

Updating Player Settings with code 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