Search Unity

xcode error with CustomComposite

Discussion in 'Input System' started by zemzemdesign, Dec 13, 2019.

  1. zemzemdesign

    zemzemdesign

    Joined:
    Jul 23, 2016
    Posts:
    3
    Hi, I have a very simpel custom Composite to test and in Unity everyting seems ok but I get error in xcode.

    CustomComposite.cs
    Code (CSharp):
    1. #if UNITY_EDITOR
    2. [InitializeOnLoad]
    3. #endif
    4. public class CustomComposite : InputBindingComposite<float>
    5. {
    6.     [InputControl(layout = "Button")]
    7.     public int firstPart;
    8.  
    9.     public override float ReadValue(ref InputBindingCompositeContext context)
    10.     {
    11.         return context.ReadValue<float>(firstPart);
    12.     }
    13.  
    14.  
    15.  
    16.     static CustomComposite()
    17.     {
    18.         InputSystem.RegisterBindingComposite<CustomComposite>();
    19.     }
    20.  
    21.     [RuntimeInitializeOnLoadMethod]
    22.     static void Init() {}
    23. }
    InputManager.cs
    Code (CSharp):
    1. public class InputManager : MonoBehaviour
    2. {
    3.  
    4.     private InputController inputController;
    5.  
    6.     private void Awake()
    7.     {
    8.         inputController = new InputController();
    9.  
    10.         inputController.Gameplay.Test.performed += ctx => OnTest(ctx);
    11.     }
    12.  
    13.     private void OnEnable()
    14.     {
    15.         inputController?.Enable();
    16.     }
    17.  
    18.     private void OnDisable()
    19.     {
    20.         inputController?.Disable();
    21.     }
    22.  
    23.     private void OnTest(InputAction.CallbackContext context)
    24.     {
    25.  
    26.     }
    27. }
    Error in Xcode:
    Screen Shot 2019-12-13 at 15.18.02 PM.png

    Screen Shot 2019-12-13 at 15.17.34 PM.png
     
  2. zemzemdesign

    zemzemdesign

    Joined:
    Jul 23, 2016
    Posts:
    3
    I have tried drawing touch demo and everytings works fine, but when I copied
    PointerInput.cs
    PointerInputManager.cs
    Helpers.cs
    PointerControls
    from the demo to a new project I got errors again in Xcode.

    Projects is on github:https://github.com/nesadkadric/191214_inputsystem03

    Screen Shot 2019-12-14 at 19.41.31 PM.png

    Screen Shot 2019-12-14 at 19.42.50 PM.png