static void Update() { if (CheckIsClient()) { EditorApplication.update -= Update; return; } bool show = forceShow || VarwinUnitySettings.Options.Any(x => x.IsNeedToDraw); bool layersShow = VarwinUnitySettings.Layers.Any(x => !string.Equals(VarwinUnitySettings.GetLayer(x.Key), x.Value)); bool tagsShow = !VarwinUnitySettings.TagsAreValid(); bool bindings = !VarwinUnitySettings.CheckSteamVRBindings(); if (show || layersShow || tagsShow || bindings) { ShowWindow(); } EditorApplication.update -= Update; }
public void DrawLayersList() { int count = VarwinUnitySettings.Layers.Count(x => (!string.Equals(VarwinUnitySettings.GetLayer(x.Key), x.Value))); if (count > 0) { EditorGUILayout.Space(); GUILayout.Label("Layers:"); var layerButtonStyle = new GUIStyle(EditorStyles.miniButtonLeft); foreach (var layer in VarwinUnitySettings.Layers) { if (!string.Equals(VarwinUnitySettings.GetLayer(layer.Key), layer.Value)) { if (GUILayout.Button($"Set Layer{layer.Key} as \"{layer.Value}\"", layerButtonStyle)) { VarwinUnitySettings.SetLayer(layer.Key, layer.Value); VarwinUnitySettings.Save(); } } } if (count > 1) { EditorGUILayout.Space(); if (GUILayout.Button($"Apply all layers")) { ApplyAllLayers(); } } EditorGUILayout.Space(); } }