示例#1
0
    // Axes
    private void Axes(string ctrlName)
    {
        GUILayout.BeginHorizontal();

        bool enableX = TCKInput.GetAxisEnable(ctrlName, "Horizontal");

        GUILayout.BeginHorizontal();
        GUILayout.Label("Enable X Axis", GUILayout.Width(115));
        enableX = GUILayout.Toggle(enableX, string.Empty);
        GUILayout.EndHorizontal();
        TCKInput.SetAxisEnable(ctrlName, "Horizontal", enableX);

        if (enableX)
        {
            bool inverseX = TCKInput.GetAxisInverse(ctrlName, "Horizontal");
            GUILayout.BeginHorizontal();
            GUILayout.Label("Inverse X", GUILayout.Width(60));
            inverseX = GUILayout.Toggle(inverseX, string.Empty);
            GUILayout.EndHorizontal();
            TCKInput.SetAxisInverse(ctrlName, "Horizontal", inverseX);
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        bool enableY = TCKInput.GetAxisEnable(ctrlName, "Vertical");

        GUILayout.BeginHorizontal();
        GUILayout.Label("Enable Y Axis", GUILayout.Width(115));
        enableY = GUILayout.Toggle(enableY, string.Empty);
        GUILayout.EndHorizontal();
        TCKInput.SetAxisEnable(ctrlName, "Vertical", enableY);

        if (enableY)
        {
            bool inverseY = TCKInput.GetAxisInverse(ctrlName, "Vertical");
            GUILayout.BeginHorizontal();
            GUILayout.Label("Inverse Y", GUILayout.Width(60));
            inverseY = GUILayout.Toggle(inverseY, string.Empty);
            GUILayout.EndHorizontal();
            TCKInput.SetAxisInverse(ctrlName, "Vertical", inverseY);
        }
        GUILayout.EndHorizontal();
    }