Пример #1
0
            /// <summary>
            /// Based on the chosen control, generate an override path to rebind to.
            /// </summary>
            private string GeneratePathForControl(InputControl control)
            {
                var device = control.device;

                Debug.Assert(control != device, "Control must not be a device");

                var deviceLayoutName =
                    InputControlLayout.s_Layouts.FindLayoutThatIntroducesControl(control, m_LayoutCache);

                if (m_PathBuilder == null)
                {
                    m_PathBuilder = new StringBuilder();
                }
                else
                {
                    m_PathBuilder.Length = 0;
                }

                control.BuildPath(deviceLayoutName, m_PathBuilder);

                return(m_PathBuilder.ToString());
            }