in Education by
I am making a tool in Unity to build your project for muliple platforms when you press a button. I started with the preferences window for the tool, and came up with an anoying thing. Whenever I change the enum value of the EnumPopup field, the field turns blue in the editor window. Is there a way to disable this? See how in the 2nd picture the field is not blue, and in the 3rd picture the field has changed to blue? How do I prevent this from happening? Thanks in advance! JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Difficult to help without having the rest of your code. This is Unity built-in behaviour. I tried a lot of stuff see here to disable / overwrite the built-in coloring of prefix labels but had no luck so far. A workarround however might be to instead use an independent EditorGUI.LabelField which will not be affected by the EnumPopup together with the EditorGUIUtility.labelWidth: var LabelRect = new Rect( FILEMANAGEMENT_ENUMFIELD_RECT.x, FILEMANAGEMENT_ENUMFIELD_RECT.y, // use the current label width EditorGUIUtility.labelWidth, FILEMANAGEMENT_ENUMFIELD_RECT.height ); var EnumRect = new Rect( FILEMANAGEMENT_ENUMFIELD_RECT.x + EditorGUIUtility.labelWidth, FILEMANAGEMENT_ENUMFIELD_RECT.y, FILEMANAGEMENT_ENUMFIELD_RECT.width - EditorGUIUtility.labelWidth, FILEMANAGEMENT_ENUMFIELD_RECT.height ); EditorGUI.LabelField(LabelRect, "File relative to"); QuickBuilder.Settings.Relation = (QuickBuilder.Settings.PathRelation)EditorGUI.EnumPopup(EnumRect, QuickBuilder.Settings.Relation); As you can see the label is not turned blue while the width keeps being flexible Sidenotes Instead of setting values via edito scripts directly like QuickBuilder.Settings.Relation = you should always try and use the proper SerializedProperty. It handles things like Undo/Redo and also marks the according objects and scenes as dirty. Is there also a special reason why you use EditorGUI instead of EditorGUILayout? In the latter you don't need to setup Rects. EditorGUILayout.BeginHorizontal(); { EditorGUILayout.LabelField("File relative to", GUILayout.Width(EditorGUIUtility.labelWidth)); QuickBuilder.Settings.Relation = (QuickBuilder.Settings.PathRelation)EditorGUILayout.EnumPopup(QuickBuilder.Settings.Relation); } EditorGUILayout.EndHorizontal();

Related questions

0 votes
    This is currently how I copy code from an editor to a search field in VS code using vscodevim. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 3, 2022 in Education by JackTerrance
0 votes
    I do a lot of editing between Blend and VS. VS has a great option to "automatically reload changed ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    Which bar shows information about a document being edited? class 7 computer Select the correct answer from above options...
asked Dec 2, 2021 in Education by JackTerrance
0 votes
    The _____tools help you to select a portion of an image that is to be edited. Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    The name of the transaction file shall be provided by the operator and the file that contains the edited ... and Durability topic in section Transactions of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    I like to use Emacs' shell mode, but it has a few deficiencies. One of those is that it's not ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    Do I risk losing sales by disabling SSL 2.0 and PCT 1.0 in IIS5? Clarification: Sales would be ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 27, 2022 in Education by JackTerrance
0 votes
    Suppose I have a ggplot with more than one legend. mov...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    Five coins are tossed simultaneously. The probability that at least on head turning up, is A. `1//32` B. `5//32` C. `7//16` D. `31//32` Select the correct answer from above options...
asked Nov 16, 2021 in Education by JackTerrance
0 votes
    Hardware RAID implementations permit _________ that is, faulty disks can be removed and replaced by new ones ... in division Storage and File Structures of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    Turning on the rulers or gridlines that are built into most of the software programs helps in aligning Elements. (1)False (2)True...
asked May 18, 2021 in Technology by JackTerrance
0 votes
    _____________ is a tool for turning information into knowledge. Select the correct answer from below options A)Machine Learning B)Data Transformation C)Data Analysis...
asked Dec 3, 2020 in Technology by Editorial Staff
0 votes
    A box has 5 blue and 4 red balls. One ball is drawn at random and not replaced. Its colour is also not ... of second ball being blue? Select the correct answer from above options...
asked Nov 20, 2021 in Education by JackTerrance
0 votes
    Want to build a debug tool to monitor the app, pause execution when bad things occur. Dev can continue ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
...