コード例 #1
0
        private void ShowKeywords(Shader s)
        {
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Keywords", EditorStyles.miniButton);

            Rect buttonRect = GUILayoutUtility.GetRect(Styles.arrayValuePopupButton, GUI.skin.button, GUILayout.MinWidth(kValueFieldWidth));

            buttonRect.width = kArrayValuePopupBtnWidth;
            if (GUI.Button(buttonRect, Styles.arrayValuePopupButton, EditorStyles.miniButton))
            {
                var globalKeywords = ShaderUtil.GetShaderGlobalKeywords(s);
                var localKeywords  = ShaderUtil.GetShaderLocalKeywords(s);

                PopupWindowWithoutFocus.Show(
                    buttonRect,
                    new KeywordsPopup(globalKeywords, localKeywords, 150.0f),
                    new[] { PopupLocation.Left, PopupLocation.Below, PopupLocation.Right });
            }

            EditorGUILayout.EndHorizontal();
        }