Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by mouseman919 · Sep 22, 2011 at 02:09 PM · editorvariableslink

Linking 2 script variables (min + max) to one editor bar - MinMaxSlider?

Is there a way to highlight the link between 2 script variables so that the editor will display them in a linked (min/max) fashion?

So instead of this display in the editor:

 SpawnTimeMin : 5
 SpawnTimeMax : 8
 LeashDistMin : 15
 LeashDistMax : 35

I would have something like

 SpawnTimeMin / SpawnTimeMax : 5-8
 LeashDistMin / LeashDistMax : 15-35

In my scripts I have a lot of dual variables for min and max, for example SpawnTimeMin SpawnTimeMax, LeashDistMin, LeashDistMax. Depending on a monster type these variables are different and i'd like to set them in the editor.

At the moment I'm simply having to change 2 numbers, but I noticed there is a nice built in bar called MinMaxSlider, where you can change 2 numbers with only 1 row, and it gives you a nice visual explanation of the values. Is this something I can somehow take advantage of?

Comment
Add comment · Show 2
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 syclamoth · Sep 22, 2011 at 02:29 PM 0
Share

Yes, indeed it is- but you'll need to create a custom editor to be able to use it. In most cases, it's more trouble than it's worth, but on the other hand, if you're up to the (reasonably straightforward) challenge, it's useful to know how to do.

avatar image mouseman919 · Sep 22, 2011 at 03:09 PM 0
Share

That does sound like more trouble than it's worth. However, out of interest, what would the general process be? Would I have to define my own parser to detect a certain new keyword or struct?

I was hoping for something along the lines of:

      var SpawnTime$$anonymous$$in : float;
      var SpawnTime$$anonymous$$ax : float; 
      @link SpawnTime$$anonymous$$in, SpawnTime$$anonymous$$ax;

I guess I could make a class / struct that contains $$anonymous$$ and max variables then have the editor have a custom slider to represent that struct / class type or something?

0 Replies

· Add your reply
  • Sort: 

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How to link this 2 variables from 2 different scripts / gameobjects? 1 Answer

Link 2 variables from 2 different scripts to 3rd script 1 Answer

C# Custom Object Editor Error 2 Answers

How can I edit a scene at runtime and have those variables saved? 1 Answer

Need help with Editor script 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