Example #1
0
        // This differs from RebindingOperation.GeneratePathForControl in that it cycles through all
        // layouts in the inheritance chain and generates a path for each one that contains the given control.
        private static IEnumerable <string> GeneratePossiblePathsForControl(InputControl control)
        {
            var builder          = new StringBuilder();
            var deviceLayoutName = control.device.m_Layout;

            do
            {
                // Skip layout if it is supposed to be hidden in the UI.
                var layout = EditorInputControlLayoutCache.TryGetLayout(deviceLayoutName);
                if (layout.hideInUI)
                {
                    continue;
                }

                builder.Length = 0;
                yield return(control.BuildPath(deviceLayoutName, builder));
            }while (InputControlLayout.s_Layouts.baseLayoutTable.TryGetValue(deviceLayoutName, out deviceLayoutName));
        }