Hi, Today is my first contact with the TOUCH CAMERA PRO asset. As soon as I enter the asset, the following messages are returned:
Assets \ Exoa \ TouchCameraPro-Demo \ Scripts \ FocusOnClick.cs (10,29): error CS0115: 'FocusOnClick.OnSelected ()': no suitable method found to override
and
Assets\Exoa\TouchCameraPro-Demo\Scripts\FocusOnClick.cs(19,29): error CS0115: 'FocusOnClick.OnDeselected()': no suitable method found to override

any idea how to fix it?

My Unity Version 2020.3.30f1.1607

    Okay, I solved the problem. Rather, there is an incompatibility with the new version of Lean Touch (Latest release date
    Mar 4, 2022). In the FocusOnClick file I replaced the code

    protected override void OnSelected()
        {
            print("OnSelect " + gameObject.name);
            if (follow)
                CameraEvents.OnRequestObjectFollow?.Invoke(gameObject, focusOnFollow);
            else
                CameraEvents.OnRequestObjectFocus?.Invoke(gameObject);
        }

    with

    protected override void OnSelected(LeanSelect select)
        {
            base.OnSelected(select);
            print("OnSelect " + gameObject.name);
            if (follow)
                CameraEvents.OnRequestObjectFollow?.Invoke(gameObject, focusOnFollow);
            else
                CameraEvents.OnRequestObjectFocus?.Invoke(gameObject);
        }

    and respectively for the method OnDeselected

      paul Thanks! Indeed the new version of lean touch has changed this. Thanks for letting me know! I will update TCP.

        a month later

        Hello, I have same problem here, altough I have the last version Mar 18, 2022
        Is there something more to do ?
        thanks

          tepat Hi Tepat, sorry about that, it seems that the Lean touch version is different depending on the Unity Version you have. Did you try to apply the change above ? (just add the "LeanSelect select" param)

          Thanks

            Anthony yes, i tried to apply the change above, but I got another error, but I succeed to remove it ! thanks !

              Here is the full script for anybody interested

              using Exoa.Events;
              using Lean.Common;

              public class FocusOnClick : LeanSelectableBehaviour
              {
              public bool follow;
              public bool focusOnFollow;

              protected override void OnSelected(LeanSelect select)
              {
                  if (follow)
                      CameraEvents.OnRequestObjectFollow?.Invoke(gameObject, focusOnFollow);
                  else
                      CameraEvents.OnRequestObjectFocus?.Invoke(gameObject);
              }
              
              protected override void OnDeselected(LeanSelect select)
              {
                  if (follow)
                      CameraEvents.OnRequestObjectFollow?.Invoke(null, focusOnFollow);
              }

              }

              It doesn't work for me

              sorry the error message is in french
              "aucune surcharge pour la méthode 'Invoke' n'accepte les arguments 3"

                tepat edited. Sorry I mixed up with the new version's code that is not yet released xD

                  Write a Reply...