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


Quickly add touch controls to your game using Lean Touch ― no code required! Simply pick the components you want, customize the settings, and enjoy consistent controls across Android, iOS, and Desktop!
> Get Lean Touch <


Lean Touch+ is an extension to the popular Lean Touch, adding a massive amount of new components and demo scenes. These allow you to quickly add touch controls to your game ― no code required! Simply pick the components you want, customize the settings, and enjoy consistent controls across Android, iOS, and Desktop!
> Get Lean Touch+ <


Lean GUI is a collection of components that extend Unity’s GUI system, allowing you to rapidly polish and enhance the user experience (UX) of your game’s UI.
> Get Lean GUI <


Lean GUI Shapes allows you to quickly add lines, rounded boxes, polygons, and much more to your GUI! Each shape is fully customizable and is procedurally generated, lowering your texture memory usage, and allows you to quickly tweak your UI designs.
> Get Lean GUI Shapes <


Lean Texture allows you quickly modify textures in your project with a range of filters, pack them together into channels, and much more!
> Get Lean Texture <


Lean Texture+ is an extension to Lean Texture, adding many new types of texture modification tools!
> Get Lean Texture+ <


Quickly add multi-language support to your games using Lean Localization. This lightweight asset allows you to localize text, sounds, load CSV, and much more!
> Get Lean Localization <


Improve the performance of your game within minutes using Lean Pool. This lightweight asset manages prefab spawning, despawning, recycling, and much more!
> Get Lean Pool <


Lean Transition allows you to easily tween or animate almost anything in your game, making it transition smoothly and look professional.
> Get Lean Transition <

Feel free to ask any of your questions here!

2 Likes

Hello, I am pretty new to Unity. What I want to achieve is to initiate a rotation of a small object by swiping in clockwise or counter-clockwise manner with a single finger. Is it possible to detect with the library? Which example can I use to get some advice from? Could you please advice. I just recently purchased the Lean Touch+. Thanks

2 Likes

There’s no component or demo scene that can detect this yet, but this sounds like a good idea so I can add it. I’ll send you a build when it’s implemented!

2 Likes

Hi Darkcoder,

I was looking at LeanTouch/LeanTouch+: do they manage gesture recognition?

If the answer is yes, here you can find more detail about my needs:

Basically, in my game, I want to allow the player to trace magic symbols on the screen and this will trigger some internal mechanics.

Is it possible to create some particles effects and trails during the player gestures to improve the visual quality of the action?

The next version of LeanTouch+ will include drawn shape recognition :slight_smile:

You can already add trails to fingers using LeanFingerTrail/Fade, but not particles. I’ll add that too!

Hi Sir,
I am looking for this function too.
I guess the idea is to attach three conductive points to form a fixed triangle so that unity can detect and locate the triangle movement.

Seems everyone wants this :smile:

Good news is that I’ve just finished implementing this feature, I’m just working on making the demo scenes for it now. I’ll submit a new version and send everyone early builds later today.

2 Likes

you are so great, i just brought Lean touch + and wait for your great demo :slight_smile:

1 Like

LeanTouch works great! Thanks for the Asset!

I want to run 2 windows touchscreens at the same time from 1 PC. (only have 1 at the moment to test myself)
Would I be able to differentiate between touches coming from either screen?
for example, the left screen rendering camera 1 is controlling camera 1 by touch and the same for the right screen with camera 2.

Can you share any experience with running touch in windows on multiple screens?

Thanks!
Tom

I don’t have access to any dual touch screen setups, so I have no idea. Unity’s Touch class doesn’t appear to contain any information about screens though, so assuming it does support such setups, there’s no automatic way to detect which screen it’s on. You would probably have to calculate this yourself.

1 Like

Carlos,

Our team is referencing an English.txt csv file in LeanLocalization. We are using the Lean Localized Text Phrase Path variable on each of our text objects and the text display red even though the connection is working. Also, when we update to the latest version and import the csv, it does not fill in the Phrase Path variable. Without having to reselect each text box, how should we proceed?

Also, Is there a way to update the CSV file after build if we wanted to be able to change the text on the fly from the CSV?

I made a mistake with LeanLocalizedBehaviour.cs, change like 26 to: [FormerlySerializedAs(“PhraseName”)]

Your behaviours should now carry over after your upgrade. If the old version works fine then you could just stick with that, since I did change quite a lot recently.

Modifying text from a CSV isn’t a scenario I considered when designing Lean Localization. One thing you could do is change the LeanLanguageCSV script execution order to be -100 or something, then you could create a normal LeanPhrase with a GameObject name matching the phrase you want to override, then you can add a translation Entry for the desired language.

Hi, thanks for your great assets.
I’m working with lt+ and wanna get pinch data and direction, i’ve added a leanmultipinch script to my gameobject on scene, and added a function to onpinch event, buy i don’t understand how to get pinch data.

4855136--467306--Schermata 2019-08-14 alle 11.05.53.png

    public void onpinch(Lean.Touch.LeanMultiPinch myData)
    {
        Debug.Log(myData.????);
    }

Hey DarkCoder,

Just running through and example project I found that uses LeanTouch - I updated the asset in the project to the latest version and now its complaining with these error messages:

Assets/Scripts/ARImageScene.cs(228,17): error CS0200: Property or indexer 'LeanSelectable.OnSelectUp' cannot be assigned to -- it is read only

this is the bit of code in question:

var leanSelectable = imageObject.GetComponent<LeanSelectable>();

if (leanSelectable != null)
{
// intialize events ( only needed when LeanSelectable is added via code - currently not the case )
if (leanSelectable.OnSelectUp == null)
{
leanSelectable.OnSelectUp = new LeanSelectable.LeanFingerEvent();
leanSelectable.OnDeselect = new UnityEngine.Events.UnityEvent();
}

// image OnSelectUp event instead of OnSelect to include Tab information 
leanSelectable.OnSelectUp.AddListener(ImageSelectUp);
leanSelectable.OnDeselect.AddListener(ImageDeselect);
}

Obviously these properties used to have setters as well as getters but I was wondering if you had any suggestions for a fix?

Hi,

Thank you for the Lean series, they are great!

I have been working with the LeanDrag in Lean GUI recently. Is there a functionality to constrain/clamp the drag surface to the parent object instead of entering floating numbers?

The OnPinch event you can see in the event inspector gives you one parameter (Single), this is another name for float. The actual value of this depends on your Scale setting, which is currently Pinch Scale. If there is no scale then this will be 1.0, but if you get a value of say 0.9, then that means between the previous and current frame, you pinched to 90% of the previous scale (e.g. if your fingers were 100pixels apart, then they are now 90). If your fingers expanded then this would be above 1.0.

You can remove the code that checks to see if leanSelectable.OnSelectUp is null, and the code inside that gives it a new instance.

This code used to be required because the events were public fields, but I’ve now made them private and given them properties that automatically initialize to non-null when accessed for the first time. This should require less code now and allow users to develop faster. Unfortunately you will have to remove this old code though!

Not currently, but that sounds like a great idea. I can try adding it next week!

1 Like

Hi! Thank you for your great assets. I am currently using Lean Localization, and it’s been a blast to work with. Awesome stuff!

I am currently trying to get Tokens to work, but I can’t seem to get it to work. My current setup is:

  • I’m using a CSV with a tag / name and a translation including a token (i.e. token.test.translation = this is the token: {NAMEOFTOKEN}
  • I created a token (created using the ‘Add’ button in the LeanLocalization Inspector) called ‘NAMEOFTOKEN’
  • This generated a GameObject (and reference to this GameObject in the Lean Localization Inspector) called NAMEOFTOKEN and I added a value (ThisIsTheTokenValue)
  • I call the translation in code using: LeanLocalization.GetTranslationText(“token.test.translation”);

I keep getting ‘this is the token: {NAMEOFTOKEN}’ as a translation result, instead of ‘this is the token: ThisIsTheTokenValue’.

I’ve checked the documentation and I am doing exactly as suggested. I also looked into your examples, but there is no token example it seems? I’ve also tried using a similar setup without CSV and such, but I keep getting the same unwanted result.

Any idea?

Also: do you have a way so I can donate some bucks? Your tools have helped me out quite a bit, and I’d like to return the favour. Cheers!

Thanks for pointing this out. GetTranslationText currently just returns the raw text without any token substitution, I’ll have to update the code to do this, and now that you point it out I also notice a bug with the substitution code that would cause it to break if you tried to use it in your current scenario. I’ll send you an updated build in a little bit.

I have no donation system setup. The best way to support me is to write a review (or at least a rating) if you haven’t already. If you really want to give me money then you could always purchase one of my assets if they will help your project :slight_smile:

1 Like

I’m a beginner game developer, (so forgive me if I’m missing something obvious), and I wanted to make a mobile game, so I found this asset. It works very well and is easy to use, especially considering how I don’t have much experience in game design, but there is one thing that I’m not sure if I can do with this.

I have an object, which is an iceberg, that I want the player to be able to tilt by dragging a finger without necessarily swiping, so that the player does not have to lift their finger off of the screen. As the player drags their finger up or down, the iceberg tilts away and towards the player, and as the player drags their finger left and right, the iceberg tilts to the left or to the right. In essence, it will tilt in the direction that the player drags their finger and it will tilt more or less depending on the distance that the player drags their finger.

The closest thing that I found was the feature that could detect the angle and distance of a swipe. Please let me know if I can achieve what I described with this asset.

Thanks for this amazing asset! I’m definitely going to use it in more games in the future.

LeanTouch+ includes the LeanManualRotate/Smooth component (DragTurn2D demo scene), which can be used to do this. With this component you can rotate an object (e.g. iceberg) along two axes of rotation using a finger drag gesture.