• 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
2
Question by Demigiant · Feb 21, 2011 at 09:26 AM · editorwindowglobal

Global (and not project-related) Editor Window?

Hello,

I've created an Editor Window with some global utilities, and I'm kind of annoyed that I have to manually copy it inside every project to have it working (also, each time I change it, I have to re-copy it everywhere).

Is there a way to have an Editor Window work automatically with all existing/new projects? Maybe there's a single place where the CS file should be copied? I couldn't find it anywhere :P

Thanks & a nice day :)

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

3 Replies

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

Answer by yoyo · Feb 22, 2011 at 06:35 PM

One option would be to have your editor window (and any other global source) in a single location on your machine, and then create a symbolic link from each Unity project to the central location. Not quite automatic though, since you need to set up the links, but at least you can maintain your source in one place, you don't need to copy the files again each time there's a change.

So you would have a folder structure something like ...

\Unity
    \Common
        \Editor
            \Common
    \Projects
        \MyFirstProject
            \Assets
                \Editor
                    \Common -> \Unity\Common\Editor\Common
        \MyOtherProject
            \Assets
                \Editor
                    \Common -> \Unity\Common\Editor\Common

Under Windows 7 you can create a symbolic link from a command shell with the mklink command. Note that the command shell needs to be launched with administrator privileges in order to do so.

mklink /D \Unity\Projects\MyFirstProject\Assets\Editor\Common \Unity\Common\Editor\Common

Under other versions of Windows you can create a directory junction (equivalent to a symbolic link) with junction.exe, available here.

Not being a Mac guy, I'm not sure how symbolic links work on the Mac, but it appears to be possible.

Comment
Add comment · Show 4 · 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 Demigiant · Feb 22, 2011 at 10:00 PM 0
Share

Cool! This "hack" is wonderful, I'll use it in many other ways too :) I wish I could give you 10 votes Yoyo, thanks :)

avatar image yoyo · Feb 22, 2011 at 10:18 PM 0
Share

I'm glad it's useful.

avatar image Demigiant · Feb 23, 2011 at 11:22 AM 0
Share

Tested it and it works perfectly: I love it! :) Also, exporting packages that contain stuff related to simbolic links works perfectly.

avatar image Adam-Buckner ♦♦ · Sep 14, 2011 at 12:37 AM 0
Share

This does not work as easily on the $$anonymous$$ac as it does on the PC: http://forum.unity3d.com/threads/104374

avatar image
1

Answer by johan-skold · Feb 21, 2011 at 11:04 AM

Sadly I don't think there's any such thing. The closest thing would be to create a unity package of your assets, and store it in the default folder for packages (Unity/Editor/Standard Packages). That way you can just tick its box during project creation and have Unity import it right away.

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 Demigiant · Feb 21, 2011 at 12:08 PM 0
Share

Thanks Johan, nice trick :) I'll wait to see if somebody knows some other hack, and otherwise check yours as correct. Though, if this is the only way, it kinds of sucks: Unity's manual says that a custom Editor window will "create a standard, dockable editor window that saves its position between invocations, can be used in custom layouts, etc". But saving your custom window into a custom layout is broken, if you create a new project without it. Baaad :/

avatar image johan-skold · Feb 21, 2011 at 02:36 PM 0
Share

You can always add it to http://feedback.unity3d.com :)

avatar image Demigiant · Feb 22, 2011 at 10:51 AM 0
Share

Done :) Also, I found another possible solution (see next answer), though I didn't test it yet

avatar image
0

Answer by Demigiant · Feb 22, 2011 at 10:50 AM

Not the answer, but a possible alternate solution I found (along with Johan's): see the example placed in the EditorApplication.applicationPath reference.

[edit] Actually, thinking more about it, this solution is foolish :P A script still needs to be manaully copied to any new project folder, so that it can be used to "almost" automatically import other scripts.

Anyway, I'm not deleting this answer, cause it might be useful - at least to me :)

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Accessing GameObjects from Editor static class in Plugins...not. 1 Answer

How to test iOS Joysticks in Editor Game Window? 1 Answer

Editor crashes on EditorWindow.Close() 0 Answers

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