void OnGUI() { #if UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 int shaderCount = 0; foreach (var obj in Selection.objects) { if (obj is Shader) { shaderCount++; } } if (shaderCount <= 0) { EditorGUILayout.HelpBox("Please select Forward Shader(s) from your Project", MessageType.Info); } else { EditorGUILayout.HelpBox(string.Format("{0} Shader{1} Selected", shaderCount, (shaderCount > 1)?"s":""), MessageType.None); CreateBackup = EditorGUILayout.Toggle("Create Backup", CreateBackup); FilterName = (FilterNames)EditorGUILayout.EnumPopup("Filter Type", FilterName); if (GUILayout.Button("Convert")) { GenerateSofterShaders(); Close(); } } #else GUILayout.Label("This feature is no longer needed in Unity 5+"); #endif }
private void Enlist(string label, Func <ITenantDBsDir, FilteredListVMBase> constructor) { _enlisteds.Add(_enlisteds.Count, constructor); FilterNames.Add(label); }
private static FilterExpression GetFilter(Expression <Func <T, object> > param, FilterNames filterType, object obj1, object obj2) { return(new FilterExpression { Column = param.GetPropertyName(), Lower = obj1, Higher = obj2, Type = filterType, ColumnType = param.GetPropertyType().AssemblyQualifiedName }); }
static string AddUsePasses(string code, FilterNames filter) { // Question mark makes it non-greedy.... // Matching: UsePass\s*\"ShadowSoftener.*?\" return(Regex.Replace(code, SubShaderSearchString, string.Format("$1\n\tUsePass \"ShadowSoftener/{0}\"", filter.ToString().ToUpper()))); }
public Filter(FilterNames name, FilterTypes type, string value = "") { FilterName = name; FilterType = type; FilterValue = value; }