Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

LEAN ⚡️ Touch / GUI / Texture / Localization / Transition / Pool

Discussion in 'Assets and Asset Store' started by Darkcoder, Aug 1, 2019.

  1. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,672
    It's possible you used an older version of LeanLocalization which saved the CurrentLanguage as English, so now when you load it it's defaulting to English. You can try building your app again with a new Bundle Identifier, or change SaveLoad to WhenChangedAlt, or call the ClearSave() method when running on your device, then start the app again.


    Fixed the prefab issue for the next version.

    No idea about splat binaries. Text is just a string whereas the Objects need to reference something, so maybe splitting them causes the reference to break.
     
  2. mrokutwr

    mrokutwr

    Joined:
    Oct 1, 2020
    Posts:
    7

    Unfortunately it didn't work
     
  3. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,672
    Try the attached build. This includes the new "13 Debug" scene. When you run it, it should look something like this:

    upload_2021-4-25_10-21-15.png

    And at the bottom:

    upload_2021-4-25_10-21-27.png

    The "LOOKING FOR" in your case should be Russian, and in the "ALISES" list there should be Russian.

    If it shows "LOAING PREVIOUSLY SAVED"

    upload_2021-4-25_10-23-10.png

    Then you haven't cleared your saves.
     

    Attached Files:

  4. mrokutwr

    mrokutwr

    Joined:
    Oct 1, 2020
    Posts:
    7
     

    Attached Files:

  5. OldKing_Wang

    OldKing_Wang

    Joined:
    Jan 25, 2015
    Posts:
    27
    iShot2021-04-25 18.29.36.jpg

    Hi

    thanks for the awesome asstes!

    is this a bug?

    the Layer property not working in demo Lean+\Selection\07 SelectionBox

    it's working in demo Touch\16 Tap To Select
     
  6. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,672
    Looks like a bug, I'll check the code and get back to you.


    If I make a new project and import LeanTouch+ 2.3.0 then in the 07 SelectionBox demo scene I see this:

    upload_2021-4-26_12-26-41.png

    And it works as expected.

    Perhaps you updated from an older version and it used the old settings? (the ScreenQuery setting is new)
     
  7. OldKing_Wang

    OldKing_Wang

    Joined:
    Jan 25, 2015
    Posts:
    27
    yes , the default setting layers is set to Mixed. but when i change it to "Nothing" , i still can select those circle.

    (change it in edit mode , then hit the play btn , not change it in runtime)
     
  8. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,672
    I think I've fixed this issue, try the attached build!


    Oh I see. The ScreenQuery settings are only used when you're selecting with a finger event like SelectScreenPosition. The selection box doesn't perform a raycast. I'll update LeanSelectionBox and send you a new version of it!
     

    Attached Files:

  9. mrokutwr

    mrokutwr

    Joined:
    Oct 1, 2020
    Posts:
    7
    Everything works, thank you!
     
    Darkcoder likes this.
  10. canafarci

    canafarci

    Joined:
    Jan 14, 2019
    Posts:
    1
    Hello, i want to acces my custom script called IndividualBlock inside Lean Touch's LeanSelectableBlock script but i'm getting the error "The type or namespace name 'IndividualBlock' could not be found (are you missing a using directive or an assembly reference?)" i tried adding my script to the leantouch namespace but that doesn't seem to work either, how can i fix this?
     
  11. sas67uss

    sas67uss

    Joined:
    Feb 8, 2020
    Posts:
    73
    Hi
    Is it possible to create position_customizable touch controls that the player can drag and move touch controls on across the touch_screen and save this new positions as controls settings ?
     
  12. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,267
    how does graphics color transition work?
    here is what i use
    upload_2021-4-28_20-23-36.png
    and this stays red instead of turning green
    upload_2021-4-28_20-23-29.png
     
  13. tonygiang

    tonygiang

    Joined:
    Jun 13, 2017
    Posts:
    42
    Hi, I have a feature request for the Lean Pulse: Can we have an event for Lean Pulse that is invoked once when Remaining Pulses go from 1 (or any positive number, if that circumstance can even happen) to 0? I imagine this event would be named On No More Remaining Pulse. Whether this event is invoked before or after the On Pulse event is up to you.
     
    Last edited: Apr 29, 2021
  14. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,672
    All of the LeanTouch code is inside its own assembly (Assets/Lean/Touch/LeanTouch.asmdef), and Unity will compile this before 'normal' scripts that aren't in an assembly, so it cannot see your code. The solution depends on what you're trying to do exactly, but in general you shouldn't modify the lean code to access yours, you should only modify it to make it more accessible from outside, and/or make a derived class from it. The 'quick fix' would be to delete all the lean .asmdef files so it can all access each other, but it's generally bad practice.


    No idea what you're referring to.


    If I open the Lean GUI demo scene "01 Button", and modify the Tap Button's [Down Transitions] to look like this:

    upload_2021-4-29_22-56-8.png

    It works as expected, and this is similar to what you've done, so I don't know what the issue is. Check the Lean/Transition/GUIDE and see if you're on the latest 1.2.0 version.


    Try the attached patch, which changes OnPulse to give you the RemainingPulses count. The LeanPulseLast component hooks into this and fires its own event when this is 0.
     

    Attached Files:

    laurentlavigne likes this.
  15. sas67uss

    sas67uss

    Joined:
    Feb 8, 2020
    Posts:
    73
    Imagine that in the game menu in the control settings, for example, the player can change the position of the jump button from the right to the left of the screen. Like most mobile games on the market.
     
  16. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,672
    So like a preference setting of where a UI button should appear? If so, this sounds like a very game specific feature that would require many unrelated things like a settings menu, some kind of save/load system for the setting, and some way to position the button based on this setting. This kind of features is outside the scope of what LeanGUI or LeanTouch is designed for and would require some custom code.
     
  17. BrunoNunes23

    BrunoNunes23

    Joined:
    Sep 13, 2019
    Posts:
    2
    Hi,
    Will you make a version of lean localization supporting the new UIBuilder from unity?
     
  18. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,672
    Maybe when it's no longer in preview I'll look into it.
     
  19. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,267
    I upgraded to 1.2 and now every script that depends on LeanAnimation is broken
    upload_2021-5-3_13-11-11.png
    so...
    upload_2021-5-3_13-11-59.png
    no this is not auto upgrading fine
    the likelyhood that also ultEvents all lost their link is high but i don't know since compiling is broken
    upload_2021-5-3_13-13-21.png
    solution?
     
  20. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,267
    now after changing LeanAnimation to LeanManualAnimation in the red scripts I'm getting red everywhere.
    And why did you even change LeanAnimation to add "Manual" in the name? Manual means that it involves the hands...
    upload_2021-5-3_13-23-26.png
     
  21. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,267
    no mention of Currenthead removed or change in how anchor works.
    upload_2021-5-3_13-35-20.png
    upload_2021-5-3_13-44-35.png
    as I said the other week, changing class is a bad idea, it brings nothing to the users and was not requested, and now I see that you made deeper breaking changes.
    the result is project in the red.
    So from now on you *really* need to follow standard practice and keep the same architecture on dot releases - and please document the changes better than this.
     
  22. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,672
    Yes, that was a sloppy change log, I'll fix it in the next version.

    I renamed these classes and properties because I wasn't happy with them - I think the new names make it clearer what they do. If I increased the major version every time I changed a name we would be on a very high version numbers. Unity used to be able to auto upgrade components that change names as long as you keep the GUID, but somewhere along the line they changed this.
     
  23. tonygiang

    tonygiang

    Joined:
    Jun 13, 2017
    Posts:
    42
    The LeanPulseLast component appears to have an issue with its cachedPulse field never being assigned. Surely these lines were supposed to be part of it?

    Code (CSharp):
    1.  
    2.         void Awake()
    3.         {
    4.             cachedPulse = GetComponent<LeanPulse>();
    5.         }
    6.  
     
  24. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,267
    Changing name because you weren't "happy with them" makes users not happy with you. When working in a team, which assets are, it is bad practice to change on a whim.
    Next time you think of doing that, first take a breath and think of the impact on the user. The changes you made break the API.

    Regarding the change log, you need to do it now, not on next release, you're basically releasing a breaking asset, time to fix it.
    A good way to fix it is with an upgrade tuto, like Unity does when breaking the API. Outline what you broke, where you changed access points and how to fix it.
     
    Last edited: May 4, 2021
  25. Eatton

    Eatton

    Joined:
    Jan 16, 2019
    Posts:
    7
    Hi

    I am trying to use CSV files with Lean Localisation, but I can’t get the translations to show.

    Here is my Scene:

    LL.png

    I have set up French, English and Spanish text files and the translations are being detected correctly as shown here:

    Screenshot 2021-05-05 at 15.42.26.png

    I’m trying to do this programmatically as I have lots of translations, so in my script I assign a translation to a string variable like this:

    Screenshot 2021-05-05 at 15.35.44.png
    (ignore the red line under ‘Lean’, there are lots of red lines and this seems to be an error with Visual Studio because the scene compiles and runs correctly)

    However, the string is always blank and checking the log confirms this:

    Screenshot 2021-05-05 at 15.47.19.png

    Have I missed something? Please help me understand how to do this.
     
  26. Proto-G

    Proto-G

    Joined:
    Nov 22, 2014
    Posts:
    178
    Thanks again for such a polished asset. I have a question about Lean Transition.

    I'm designing a character customizer and using the Lean Material Color script which works awesome to transition from one hair color to the next.

    1) I need to figure out the skin color transition now. I can't use the Lean Material Color, because I need to change the material and not the color of the current material.

    I have 3 different skin color materials and 4 different variations of each material for 12 total options per character mesh. There are dozens of character meshes. I'm trying to figure out how to set this up using Lean Transition and without creating 100s of different gameobjects, duplicate materials, etc...

    2) I'm also wondering if any of your current scripts access the Tiling of a material. This would be better for my hair coloring, and even other customizations, as some have head bands and such that I don't want to change the color of while changing the hair color.

    3) How would I hook this material color transition up to a slider?

    Any help would be appreciated.
     
  27. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,672
    Ah yes, I forgot to include that!


    You're probably executing your code before LeanLocalization has initialized. You should hook into the LeanLocalization.OnLocalizationChanged event, and run your code there so you know it's reading up to date information.


    All of this would be simple to do with a little custom script that stores the current material state and applies it to your characters. You 'could' use editor configured transitions for all of this, and hook in some kind of event to store which one is currently set, but it would take a long time and be really difficult to modify later.
     
    Proto-G likes this.
  28. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,267
    don't forget the steps to fix your last version's breaking API please.
     
  29. starfoxy

    starfoxy

    Joined:
    Apr 24, 2016
    Posts:
    146
    I am on the newest version of Lean Pool for Unity 2019.4 and am spawning a single gameobject on start(). It works fine but when I stop the preview, it throws a warning in console:

    You're attempting to detach a null GameObject.

    Any ideas what I should do to avoid this warning?
     
    Last edited: May 10, 2021
  30. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,672
    It's a bug that I will fix as soon as I get more free time.
     
  31. pako

    pako

    Joined:
    Nov 21, 2012
    Posts:
    87
    Hi, I have been using Lean Touch in my project (Unity 2020.3.4f1). Now I want to upgrade to LeanTouch+.

    I'm not sure what's the best way to proceed. If I just try to import LeanTouch+, without first removing LeanTouch, I get many warnings that files exist with different GUID, etc. I've canceled the import to make sure that I don't mess up the project.

    Should I first delete the Lean folder before importing, or should I just import LeanTouch+ over the existing LeanTouch (or maybe even do something else)?

    Thanks!
     
  32. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,672
    I recently made a big update to all the Lean assets, so it sounds like you're trying to install the new LeanTouch+ on top of the old LeanTouch. This will probably work, but deleting the old Lean folder is probably best, as the Unity package 'updater' is pretty useless. Make sure you back up your project before doing this though.
     
    pako likes this.
  33. pako

    pako

    Joined:
    Nov 21, 2012
    Posts:
    87
    I removed the Lean folder before importing LeanTouch+ and everything worked fine. There was just one small glitch though. Apparently, LeanTouch.SimulateMultiFingers has been deprecated at some point. I suspect that its utility has been moved to the LeanTouchSimulator, with which I'm not familiar yet. Nevertheless, since I'm not using multi fingers, I just removed the relevant code, and everything works fine.

    Thanks again!
     
  34. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,672
    Nice! Yes, I moved the touch simulation to a separate component, this keeps the core code simpler, and it also means I or anyone else can modify or create their own touch simulation code more easily. There should be a new UI button to quickly add this component back, so it should be fairly easy to upgrade.
     
    pako likes this.
  35. starfoxy

    starfoxy

    Joined:
    Apr 24, 2016
    Posts:
    146
    Thank you @Darkcoder ! For updating Lean Pool, can I simply reimport the asset to overwrite the current version?
     
  36. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,672
    Probably.
     
  37. pako

    pako

    Joined:
    Nov 21, 2012
    Posts:
    87
    Hi,

    I'm trying to use LeanTouch+ with Opsive's Third Person Controller.

    More specifically, I want to detect a finger swipe and call the ThirdPersonController's methods GetAxis(name) and/or GetAxisRaw(name), where the "name" parameter is the name of the axis, very much like the equivalent Unity Input methods GetAxis and GetAxisRaw.

    Could you please recommend the best way to do this?

    Thanks
     
  38. Veteran66

    Veteran66

    Joined:
    Jul 12, 2015
    Posts:
    34
    Hi i using LeanTouch free

    Lean Drag Camera/ Plane Intercept

    but the camera will not stop in the Lean Plane Field

    what do I have to consider with the Lean Plane Field?
     
  39. Eatton

    Eatton

    Joined:
    Jan 16, 2019
    Posts:
    7
    Screenshot 2021-05-19 at 12.55.49.png

    Thanks for the reply Darkcoder, turns out I hadn't added the LeanLocalisation gameObject to my new scene when I switched scenes. Everything works now, thanks for such a great asset.
     
    Darkcoder likes this.
  40. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,672
    Why can't you just call these methods from the events LeanFingerSwipe etc give you?


    The PlaneIntercept feature is designed for components that place objects based on the mouse/finger position, like LeanFingerTap + LeanSpawn. LeanDragCamera moves based on a finger delta, which doesn't depend on the mouse/finger position so much as its change in position, so it's not suitable for your scenario. In LeanTouch+ I added components like LeanConstrainToBox that allow you to restrict the movement of cameras, etc.
     
  41. Veteran66

    Veteran66

    Joined:
    Jul 12, 2015
    Posts:
    34

    Thx Darkcoder with LeanConstrainToBox it work good.
    i buy now Lean Touch+ i lke it :)
     
  42. MariusAAnghel00

    MariusAAnghel00

    Joined:
    Jan 18, 2021
    Posts:
    5
    Hi, Thank you for the asset. (LeanLocalization)
    I have an issue: Everything works fine in unity -> If I manually change the language I can see that works fine in the app, but on a real phone (android phone) even with a different language the app still shows English. Sorry if this question is already answered, but I didn't found the answer in the thread

    In settings I have: Detect language: System language.

    Is something that I miss? Thank you!
     
  43. Veteran66

    Veteran66

    Joined:
    Jul 12, 2015
    Posts:
    34
    it is possible to make a touch Analog Counter with Lean Touch+
     

    Attached Files:

  44. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,672
    You can run the new "13 Debug" demo scene on your device to see what's happening.


    The rotation can be done using the "Lean/Touch+/Examples/Drag/04 DragTurn1D" demo scene as a base. To handle multiple dials you would combine it with the setup shown in the "Lean/Touch/Examples/23 Press To Select" demo scene.

    Detecting which number is currently rotated to/selected would require a custom script though. Maybe I can add something like this in the next version.
     
  45. Qhuhuit

    Qhuhuit

    Joined:
    Feb 17, 2018
    Posts:
    29
    Hello there, sorry if already answered or in the doc but I didn't find anything
    How do I disable LeanTouch to register the touch outside the game window while in play mode ?
    It's really annoying to select anything in the scene view and having the game register the mouse clicks as touches in the game. For instance my game uses the lean pitch on a camera and I want to debug at specific camera position, it is impossible to click in the scene view without making the camera move in game.
    Never seen this effect before, I don't even know how it is possible to register inputs outside of the game view, I'm curious to know. Maybe you used an [
    ExecuteAlways] attribute or something but it needs to be disableable.
     
  46. Veteran66

    Veteran66

    Joined:
    Jul 12, 2015
    Posts:
    34
    Hi Darkcoder

    the assets 05 Angle, i can rotate the Deal and it show the Digital angle in a field.

    how i can set the angle in a UI imput Field and the Dial will turn to this angle?
     

    Attached Files:

  47. Nejko

    Nejko

    Joined:
    Apr 10, 2019
    Posts:
    1
    Hi @Darkcoder I'm using LeanLocalization (which is a wonderful asset, great job!), and I was wondering if it was possible to get a Translation text according to a given Language ?

    Because the only "GetTranslation" method returns the translation of the current set language, and I can't find with "LeanLocalization.CurrentTranslations" the way to get it in the language I want, because in my game, each player would set their language for their HUD.

    Thanks for your answer!
     
  48. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,672
    LeanTouch just uses the input data Unity provides. You can uncomment LeanTouch.cs line 606 to make it ignore these fingers:

    Code (csharp):
    1. if (new Rect(0, 0, Screen.width, Screen.height).Contains(mousePosition) == true)
    You can also pause the game with Ctrl+Shift+P.


    You would have to write a script that converts your InputField's string into an angle float (e.g. float.Parse), and then set it on the LeanSelectableDial component's Angle value.


    Your game has multiple players on the same device/display, each with their own language? If so, you would have to search through every LeanPhrase in the scene, and call TryFindTranslation on them. This asset wasn't designed with this extreme edge case scenario so there's no built in way to do it.
     
  49. Berno

    Berno

    Joined:
    Oct 29, 2014
    Posts:
    36
    Hey,
    First thanks for your assets.
    I was looking to replace TouchScript with Lean Touch as it isn't being maintained anymore.
    I need to trigger on longpress gesture. It seems while googling I can find OnFingerHeldDown that was once in Lean Touch but isn't in the current version. Any chance this will return?

    Thanks
     
  50. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,672
    LeanTouch+ has the LeanFingerHeld component, which implements this gesture :)
     
unityunity