- Home /
 
               Question by 
               rashiddevo · Apr 26, 2020 at 10:24 PM · 
                inspectoreditor-scriptingcustom editorcustom-inspectorcustom inspector  
              
 
              How to Hide/Show List or Array in the inspector based on a variable?
Please take at this simple code:
 public enum MoveType
     {Static, Dynamic}
     
     public enum MoveDirections
     {Top, Left, Right, Bottom}
     
     public MoveType moveType;
     public List<MoveDirections> moveDirections;
My question is simple: All I want to know is how to hide the list (moveDirections) from appearing on the inspector if the (moveType) variable is [Static] and show the list if the (moveType) variable is of type [Dynamic].
I know that this is to do with custom inspector but I have no clue on how to make this happen. Can you share some code that will help me?
               Comment
              
 
               
              Your answer
 
 
             Follow this Question
Related Questions
Custom inspector editor - how to put new editor fields in a specific place 1 Answer
How can i get SerializedProperty from UnityEvent which in List. Sorry for my Eng. 2 Answers
Script to create instance from in inspector 2 Answers
Custom inspector for MonoScript 1 Answer
Show texture (image box) in inspector with custom editor [C#]? 3 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                