- Home /
Restrict sliders in Unity inspector to have different values
I have proper functioning code to display a class in the Unity inspector and being able to change the values.
 [System.Serializable]
 public class Info
 {
     [Range(0,2)]
     public int Type;
     public int Amount;
     [Range(0,2)]
     public int Type2;
     public int Amount2;
 }
My problem is this, I want the both sliders to have different values at all times.
Let's say "Type1" is initially on value 0. Then I want "Type2" to only have the option to select the values 1 and 2.
So basicly Type1 != Type2.
Is this at all possible, in that case how?
Answer by karljj1 · Nov 17, 2014 at 09:31 PM
You could create your own property drawer or Editor for the class.
I've put this problem aside for the time being, I'll get back when I have done some testing. Thanks!
Your answer
 
 
             Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
C# access slidervalue 1 Answer
Restricting enum options in inspector when using a propertydrawer. 0 Answers
Move camera with inspector slider and include it's current location? 2 Answers
Multiple Cars not working 1 Answer
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                