Search Unity

  1. How can our website serve you better? Give us your feedback. Take our survey and let us know.
    Dismiss Notice

LeanTouch+ ☀️ LeanPool ☀️ LeanGUI ☀️ LeanLocalization ☀️ LeanTransition

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

  1. jma00049

    jma00049

    Joined:
    Feb 21, 2019
    Posts:
    77
    Hello, I cant import Lean to use it via script, the
    Code (CSharp):
    1. using Lean;
    did not work and I need to import it in order to user buttons via script. Any help?
     
  2. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    Yes, I describe how to do this HERE.

    You have a LeanAnimationRepater that is starting them automatically?

    Which asset? Lean Touch for example is inside the Lean.Touch namespace. Also, you may have to create an assembly for your code and make that assembly reference the lean one (e.g. LeanTouch). For example, here you can see the LeanTouch asmdef references the LeanCommon one so it can access its code:

    upload_2021-4-5_23-57-47.png

    You can read more about that HERE.
     
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,239
    the leanrepeater is below a leananimation so it shouldn't but it does
     
  4. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    What do you mean? It looks like your "pulsing..." GameObject has the LeanAnimationRepeater component, and that is playing all transitions on the same "pulsing..." GameObject. Based on your settings this means the "pulsing..." transitions will play every 3 seconds without any intervention from you.

    The LeanAnimation component will transition the CanvasGroup.alpha as well as the "pulsing..." transitions.

    It seems like you're misunderstanding how the LeanAnimation components work. The LeanAnimation component is entirely manual and you must call BeginTransitions() on it, but LeanAnimationOnce and LeanAnimationRepeater are automatic and require no calls. Also, these components aren't transitions, so they will be ignored by the transition/animation system. Only components with Transition in the name are used.
     
  5. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,239
    Hello, I'm running into this, would you know what could cause it?
    upload_2021-4-6_9-20-29.png
     
  6. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    What are you doing to cause this?
     
  7. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,239
    invoking this BeginAnimation on this
    upload_2021-4-6_9-49-42.png
     
  8. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,239
    No I understand how LeanAnimation works, what I didn't know is that LeanAnimation* had different startup behavior, due to them sharing prefix.
    Since you're adding them to the core, consider making them ̶i̶n̶h̶e̶r̶i̶t̶ ̶f̶r̶o̶m̶ ̶L̶e̶a̶n̶A̶n̶i̶m̶a̶t̶i̶o̶n̶ ̶a̶n̶d̶ startup the same way. This way, when launched from an event (in this case ultevent) the same method is expected.
     
  9. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,239
    alright it seems that if you put a delay transition at the end it borks the whole thing (i was doing that to pause before it runs the child)
    upload_2021-4-6_11-6-50.png
    the proper is this
    upload_2021-4-6_11-8-16.png
    now i know never to leave a join as last component, maybe add an error catcher for noobs

    and... that was not it, it was the duration = 0 on the setactive
    setting it as 0.01 works, seems that this bug is resilient :)
     
    Last edited: Apr 6, 2021
  10. johnwilkins

    johnwilkins

    Joined:
    Apr 7, 2021
    Posts:
    2
    Hi - sorry if covered elsewhere (have searched and can't find). Is there a function such that moving two fingers up or down tilts the camera on a particular axis? I want to have the same effect as in google maps on mobile, whereby if you move two fingers up or down, it tilts the angle of view. (I also want to use this alongside a rotate function so that if you twist then the 'map' rotates, but I can see that this is there.) Many thanks.
     
  11. Paul-van-der-Laan

    Paul-van-der-Laan

    Joined:
    Oct 12, 2013
    Posts:
    16
    Can you send me a message as well or share the fix publicly? I noticed significant drifting as well with the LeanDragTranslateAlong component in my project but also in the example scene DragUnderAlongPlane you can notice constant drifting (to a minor extend) for some of the objects in the scene. It seems to be linked to the dampening variable, when I set it to 0, there is no drifting (but obviously I can't move the object either anymore).

    For the record, I'm using LeanTouch+ 2.1.7 as I currently don't have access to 2.1.8 from my current place.
     
    Last edited: Apr 8, 2021
  12. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    Alright, I'll add some additional settings to LeanAnimationRepeater to make this clearer and more flexibile.


    This looks like a bug, I'll see if I can fix it. Also I'll try and fix the duration = 0 issue again, maybe it only breaks for certain kinds of transitions now.


    The LeanMultiDirection component can be used to do this with the settings Angle = 0, Use / Required Finger Count = 2. You can then connect its OnDelta event to the LeanPitchYaw's RotatePitch function. The Lean/Touch+/Examples/Camera/One Finger Zoom demo scene does something similar for zoom.
     
    laurentlavigne likes this.
  13. cihad_unity

    cihad_unity

    Joined:
    Dec 27, 2019
    Posts:
    35
    Hello,
    I want to use tap and double tap events but I can't seem to find a demo.
    In update history you wrote there was a demo called TapSpawnCount but it was deleted after maybe?

    I need to run a function with single tap, run another with double tap. Please guide me on this.
    While there are plenty of demos for a kickstart, documentation page is very simple and I can't find any information for a specific component.

    Another suggestion: I'd prefer every lean component to have different forum thread. I want to get updates on lean touch but not lean pool or gui.
    Thanks
     
  14. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    I still can't replicate any issues with Duration = 0 transitions.

    parent:
    upload_2021-4-9_19-5-47.png

    child:
    upload_2021-4-9_19-6-5.png

    works exactly as expected. You'll have to modify one of the example scenes and show me a scenario that I can test that replicates this.


    This is shown in the "Lean/Touch+/Examples/03 Finger Tap Expired" and "04 Rotate" demo scenes using the LeanFingerTapExpired component. I recommend you still use LeanFingerTap for the last tap action, so it can trigger instantly, but the first (and other non-last ones) should use LeanFingerTap.

    I plan to improve the demo scene organization soon, as the amount of demo scenes is getting pretty high and some of the demo scene names aren't clear. For information about a specific component you can click the help button on the inspector for it, and look at the bottom list in the documention page to see all components (note that half the components are in the documentation for the Common+ folder).

    I don't plan to split this forum up because the other assets aren't very popular, like 90% of posts here are about LeanTouch.
     

    Attached Files:

  15. cihad_unity

    cihad_unity

    Joined:
    Dec 27, 2019
    Posts:
    35
    Thank you!
    I managed to do that by checking `finger.touchCount` no so difficult but it was important to know :)
     
    Darkcoder likes this.
  16. johnwilkins

    johnwilkins

    Joined:
    Apr 7, 2021
    Posts:
    2
    Thanks. Two follow ups please:
    1) Can there be flexibility so it's not strictly 0, but within a tolerance? In google maps there's a quite a wide tolerance
    2) I can't see anywhere in your documentation or demo scenes how to move the camera based on pinch to zoom. There are loads of examples of scaling components, and I've seen elsewhere about zooming the camera. But how would I translate the camera in the direction it is looking when a user pinches (and the converse)?

    Many thanks
     
  17. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    1 - Angle = 0 means the direction is up-down, and 90 would be left/right, it doesn't mean the angle tolerance. With this component there is no angle tolerance as such, it just gives you the distance the finger travelled in that direction which is technically the dot product between your finger direction and the direction defined by the angle, but you can just think of it as up and down like in any map app.

    2 - This is shown in the Orbit / Zoom / Relative demo scene: upload_2021-4-11_21-33-5.png

    This can be combined with components in other examples to add more features commonly seen in map apps. Basically there are many camera control components, each of these can be configured in multiple ways, and therefore thousands of possible combinations for all of these so I can't make a demo scene for every combination. The demo scenes try to show one feature off at a time so you can later combine them as you like, there are some that combine multiple though, like the Sidescroll 2D / Zoom / Rotate / Map demo scene:
    upload_2021-4-11_21-35-38.png

    This implements a camera system like a typical 2D map app.
     

    Attached Files:

  18. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    Hey everyone,

    I made some changes to the way the component and inspector code is structured in all Lean assets, which might break existing projects. Just to be sure, I went ahead and implemented every large code change I was holding off on. Therefore I don't recommend you update these assets if you're in the middle of a project. If you want to try it, you should back up your project files first (or use version control, which you should be already).

    Version 2.2.0 of Lean Touch is now out!
    • NOTE  This is a huge update. Back up your project files before installing.
    • Fixed LeanFingerFilter ignoring manually added fingers that went up.
    • Simplified organization of all demo scenes.
    • Added LeanSelect.Limit setting.
    • The LeanSelect component now stores what it selected.
    • Allowed multiple LeanSelect components to operate at once.
    • Added mouse hover simulated finger.
    • Moved multi finger simulation to new LeanTouchSimulator component.
    • Moved LeanSelect.SearchType to ScreenQuery setting.
    • Moved LeanSelectable.DeselectOnUp to LeanSelect.DeselectWithNothing setting.
    • Renamed LeanSelectable.IsSelected to SelfSelected.
    • Renamed LeanSelectable.OnSelect to OnSelectedFinger.
    • Renamed LeanSelectable.OnDeselect to OnDeselected.
    • Renamed LeanSelect.AutoDeselect to DeselectWithNothing.
    • Added LeanTouch.UseTouch setting.
    • Added LeanTouch.UseHover setting.
    • Added LeanTouch.UseMouse setting.
    • Added LeanTouch.UseSimulator setting.
    • Added LeanSelectable.OnSelected event.
    • Added LeanSelectable.OnFirstSelected event.
    • Added LeanSelectable.OnLastDeselected event.
    • Added LeanSelect.OnNothing event.
    • Renamed LeanSelectable to LeanSelectableByFinger.
    • Renamed LeanSelect to LeanSelectByFinger.
    • Combined 3D, 2D, and UI demo scenes.
    The biggest change with Lean Touch is I rewrote the selection system - the LeanSelect component now stores which objects it selected. This means each object can now be selected by different/multiple select components, and it also means the MaxSelectables setting can now auto deselect the first selected object.

    I also split LeanSelect into LeanSelect and LeanSelectByFinger. LeanSelect is now part of Lean/Common and has no knowledge of touch data, and LeanSelectByFinger does. Simiarly, LeanSelectable is now split into LeanSelectable and LeanSelectableByFinger. These changes make the code much easier to maintain, and they also make the selection system much more flexible. One consequence of this new system is that you can no longer just mark an object as selected as you would before, instead you have to mark it as SelfSelected, or you can drop the object into a LeanSelect/ByFinger component's Select setting to select it. Another nice thing about this system is LeanSelectable no longer needs the DeselectOnUp for press selection, this is now handled by the LeanSelectByFinger.DeselectWithFingers setting, which makes scene setup much easier.

    Another big change is I rewrote how finger data is sent. You can now enable/disable specific types of finger data from the LeanTouch component, including simulated multi fingers. Simulated multi fingers are now sent to LeanTouch using the LeanTouchSimulator component you can add alongside it. This new flexibility allows you to easily 'turn off' all fingers, e.g. if you want to show a tutorial or something and ignore what the user is doing. This new separated simulation system also allows you create your own inputs (e.g. pre-recorded for a tutorial) and send them, and other more advanced tasks. There is also the addition of the mouse hover finger data, though none of the current components use this.


    Version 2.3.0 Lean Touch+ is now out!
    • NOTE  This is a huge update. Back up your project files before installing.
    • Fixed LeanDragTranslateAlong positional drift.
    • Fixed LeanFingerTapQuick adding RectTransform.
    • Added Selection / Select Self / Down demo scene.
    • Improved LeanMultiUp component implementation.
    • Improved LeanDropCount component implementation.
    • Renamed LeanSelectSelf to LeanPickable.

    Version 1.5.0 Lean Localization is now out!
    • NOTE  This is a huge update. Back up your project files before installing.
    • Added auto translation option to LeanPhrase component.
    • Moved languages to separate LeanLanguage component and prefabs.
    • Allowed multiple LeanLocalization instances at once.
    • Changed LeanLocalization.SaveLanguage to only save when manually modified.
    The biggest change with Lean Localization is I rewrote how languages are defined. Previously, you had to fill the language data into the LeanLocalization component itself, but this made it difficult to modify and difficult to use multiple LeanLocalization components with different settings. To fix this, the languages are now defined by prefabs with the LeanLanguage component (the asset comes with the same preset languages as before). To add them you can now just drag and drop them as children of the LeanLocalizaiton component, or drop them into the Prefabs list. This should make it much easier to use! However, it does mean you need to set up your languages from scratch!

    Also, I added Google Translate support to auto translate the LeanPhrase text entries. All you have to do is write at least one translation (e.g. English), and when you create a translation for another language just click the 'modify' button, and select auto translate (see the documentation for more details).


    Version 1.4.0 Lean Pool is now out!
    • Made LeanGameObjectPool auto detach clones when being destroyed (e.g. changing scenes).

    Version 1.2.0 Lean Transition is now out!
    • Added transition builder tool.
    • Added Stop demo scene.
    • Added Skip demo scene.
    • Added Repeat demo scene.
    • Added LeanGameObjectPool.GetClones method.
    • Renamed LeanAnimation component to LeanManualAnimation.
    • Added LeanAnimationRepeater.RemainingCount setting.
    • Removed LeanAnimationOnce component (use LeanAnimationRepeater instead).

    Version 1.2.0 of Lean GUI is now out!
    • Added Non/Interactable events and transitions to LeanButton.
    • Added Non/Interactable events and transitions to LeanDrag.
    • Added Non/Interactable events and transitions to LeanResize.
    • Added Non/Interactable events and transitions to LeanJoystick.

    Let me know if you encounter any issues.

    Enjoy :)
     
    Last edited: Apr 12, 2021
    cihad_unity likes this.
  19. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,239
    renaming method is not a good idea, it breaks events
     
  20. Paul-van-der-Laan

    Paul-van-der-Laan

    Joined:
    Oct 12, 2013
    Posts:
    16
    I didn't have time to try the package with the separate fix you sent me but I can confirm the issue is fixed in the latest update, thanks!
     
    Darkcoder likes this.
  21. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    This is a component, not a method. The GUID is the same, and I added an empty LeanAnimation.cs, so it should auto upgrade fine.
     
  22. pradf4i

    pradf4i

    Joined:
    Nov 7, 2017
    Posts:
    34
    Hi @Darkcoder , is there a way to have different prefabs as a part of the pool and be able to specify them at runtime using Leanpool? Thanks.
     
  23. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    Different prefabs inside the same pool? If so, you can change the LeanGameObjectPool component's Prefab setting before/after you spawn. Keep in mind the despawned clones will be spawned in LIFO order, which may be undesirable. You can modify the TrySpawn to randomly pick from the despawnedClones list to possibly improve this.
     
    pradf4i likes this.
  24. cihad_unity

    cihad_unity

    Joined:
    Dec 27, 2019
    Posts:
    35
    Hi @Darkcoder,
    Is there a way to limit leantouch working area?
    e.g. I have a UI panel and I want its children to be draggable only in the panel region, not outside of it.
    Thanks
     
  25. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    For this you should use LeanGUI, which comes with the LeanConstrainToParent and LeanConstrainAnchoredPosition components. If you're moving them with LeanTouch components then they may not work well, in which case you may want to consider using the LeanDrag component from LeanGUI.
     
  26. YevgenG

    YevgenG

    Joined:
    Oct 17, 2018
    Posts:
    22
    Hello @Darkcoder ! I have, maybe, a bit stupid question :) Is it possible to localize texts that are in the config files like these with *LeanLocalization* without using custom code?

    upload_2021-4-19_17-56-1.png
     
  27. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    Those look like ScriptableObject assets. LeanLocalization only comes with components to localize other components, so no you would have to write some custom code to do this.
     
    YevgenG likes this.
  28. YevgenG

    YevgenG

    Joined:
    Oct 17, 2018
    Posts:
    22
    Darkcoder likes this.
  29. IceTrooper

    IceTrooper

    Joined:
    Jul 19, 2015
    Posts:
    28
    Maybe it's a simple question, but...
    How to simply check if nothing is selected?
    Scenario:
    1. Take Slingshot example scene
    2. Add horizontal camera moving with LeanFingerUpdate component (OnWorldDelta callback) and custom script (there are more things in script but it's not relevant for this description).
    I just want to move the camera if I didn't press down on the Slingshot object (or any object/GUI on the scene). For now, I got a moving camera, but it's moving even when I started touching slingshot which is not the desired effect of course.

    I got LeanTouch+ and love it, but I'm showing the capabilities of LeanTouch for a wider audience, so I want to make it as simple as possible with the free version (which I think it's possible just don't know how).
     
  30. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    This can be done using the LeanSelectedCount component. If you set the MatchMin/Max values to 0,0, then the OnMatch event will fire when you deselect everything, and OnUnmatch will fire when you select at least one object. You can set it to 1,-1 to achieve the opposite. Keep in mind this component starts in the 'unmatch' state, and only updates when in play mode. In the next version I will make it so you can manually adjust this so it's clearer what's happening.
     
    IceTrooper likes this.
  31. cdr9042

    cdr9042

    Joined:
    Apr 22, 2018
    Posts:
    79
    Hi,
    I want to make some changes to how LeanSelectable (LeanTouch's script) work: I want to select the object on finger down, not finger up, and I want to deselect all other LeanSelectable when I select one of them.

    I can easily edit the original script in the package. But I don't think it's a good idea to edit third-party's library. If LeanTouch gets updated then my changes will be overwritten.

    is there anyway to write my custom script and make it replaces LeanSelectable? Right now, the class LeanSelectable is coded into struct LeanFingerFilter, which is used in LeanDragTranslate, LeanPinchScale and so on. It'll be a pain to rewrite all these scripts just to make my custom LeanSelectable
     
  32. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    In the latest version I rewrote the selection system to be more flexible. Based on your description you can just connect LeanFingerDown to LeanSelectByFinger, and set the Limit settings to this:

    upload_2021-4-21_13-17-34.png

    This works differently to how you describe, but the result should be the same.
     
    cdr9042 likes this.
  33. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,239
    I've been chasing a bug for a few weeks and I would like to sanity check some of the stuff.
    Does this work alright or does it miss a few things to work properly with LeanTransition?

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections.Generic;
    3.  
    4. namespace Lean.Transition.Method
    5. {
    6.     /// <summary>This component allows you to play a sound after the specified duration.</summary>
    7.     [HelpURL(LeanTransition.HelpUrlPrefix + "LeanPlaySound")]
    8.     [AddComponentMenu(LeanTransition.MethodsMenuPrefix + "Play Sound" + LeanTransition.MethodsMenuSuffix + "(LeanPlaySound)")]
    9.     public class LeanPlaySound : LeanMethodWithStateAndTarget
    10.     {
    11.         public override System.Type GetTargetType()
    12.         {
    13.             return typeof(AudioClip);
    14.         }
    15.  
    16.         public override void Register()
    17.         {
    18.             PreviousState = Register(GetAliasedTarget(Data.Target), Data.Duration, Data.Volume);
    19.         }
    20.  
    21.         public static LeanState Register(AudioClip target, float duration, float volume = 1.0f)
    22.         {
    23.             var state = LeanTransition.SpawnWithTarget(State.Pool, target);
    24.             state.Volume = volume;
    25.             return LeanTransition.Register(state, duration);
    26.         }
    27.  
    28.         [System.Serializable]
    29.         public class State : LeanStateWithTarget<AudioClip>
    30.         {
    31.             [Range(0.0f, 1.0f)] public float Volume = 1.0f;
    32.             public AudioSource audioSource;
    33.  
    34.             public override void UpdateWithTarget(float progress)
    35.             {
    36.                 if (progress == 1.0f)
    37.                 {
    38.                     #if UNITY_EDITOR
    39.                     if (Application.isPlaying == false) { return; }
    40.                     #endif
    41.                     var gameObject = new GameObject(Target.name);
    42.                     if (!audioSource) audioSource = gameObject.AddComponent<AudioSource>();
    43.                     audioSource.clip = Target;
    44.                     audioSource.volume = Volume;
    45.                     audioSource.Play();
    46.                     Destroy(gameObject, Target.length);
    47.                 }
    48.             }
    49.  
    50.             public static Stack<State> Pool = new Stack<State>();
    51.  
    52.             public override void Despawn()
    53.             {
    54.                 Pool.Push(this);
    55.             }
    56.         }
    57.         public State Data;
    58.     }
    59. }
    60.  
    61. namespace Lean.Transition
    62. {
    63.     public static partial class LeanExtensions
    64.     {
    65.         public static T PlaySoundTransition<T>(this T target, AudioClip clip, float duration = 0.0f, float volume = 1.0f) where T : Component
    66.         {
    67.             Method.LeanPlaySound.Register(clip, duration, volume);
    68.             return target;
    69.         }
    70.  
    71.         public static GameObject PlaySoundTransition(this GameObject target, AudioClip clip, float duration = 0.0f, float volume = 1.0f)
    72.         {
    73.             Method.LeanPlaySound.Register(clip, duration, volume);
    74.             return target;
    75.         }
    76.     }
    77. }
     
  34. cdr9042

    cdr9042

    Joined:
    Apr 22, 2018
    Posts:
    79
    Huh, that's weird, I have version 2.1.8 but I can't update to version 2.2.0, there's no Update button like usual, only an Import button. When I pressed Import it says Nothing to Import. I'm using Unity 2019.4.8
     

    Attached Files:

  35. IceTrooper

    IceTrooper

    Joined:
    Jul 19, 2015
    Posts:
    28
    Great solution
    upload_2021-4-21_15-53-27.png
    That setup (like you described) works brilliantly. Thank you
     
    Darkcoder likes this.
  36. IceTrooper

    IceTrooper

    Joined:
    Jul 19, 2015
    Posts:
    28
    I don't know if it's related to the asset (I don't think so) or to Unity itself.
    Look at '%appdata%/Unity/Asset Store-5.x/Carlos Wilkes/ScriptingInput - Output' and delete this directory. You will force Unity to Download the asset again when you click the button in Package Manager.

    @Darkcoder anyway, is it expected behavior that when you download LeanTouch package it would override LeanTouch+ already downloaded package (and vice versa). As the result, you can' have 2 packages downloaded at one time. Both packages got the same name in that path I pasted above: 'Lean Touch.unitypackage'.
     
  37. mrokutwr

    mrokutwr

    Joined:
    Oct 1, 2020
    Posts:
    7
    Hey! I am using Lean Localization in my project. I have a problem's. Language detection doesn't work. + Loading the saved language does not work when restarting the app on the device or scene in unity.
    The language is saved in PlayerPrefs, but not loaded.
    I change the language through buttons with the SetCurrentLanguage component. Please help me!
     
  38. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    What do you expect to have happen and what is happening?

    The logic inside UpdateWithTarget doesn't seem to make sense, so maybe that's the issue. This always creates a new GameObject, but it only adds a component to it if the 'audioSource' field isn't set. If it is set, then it will play it and destroy the new GameObject, but since this 'audioSource' won't be on GameObject, it will never be destroyed.


    This is a bug with the Package Manager. You must manually delete the previously downloaded package, restart Unity, then download & import the asset. See HERE for where the downloaded files are. For me it's in: %appdata%\Unity\Asset Store-5.x\Carlos Wilkes


    Yes, LeanTouch+ includes LeanTouch. The asset store installer has no concept of asset dependencies, so uploading everything required together is easiest. I try to keep them all in sync, so there should be no need or issue to import them in any order.


    Did you enable the LeanLocalization.SaveLoad setting, and do you see the Languages list as expected? It should look something like this:

    upload_2021-4-22_10-33-54.png
     
    laurentlavigne likes this.
  39. cdr9042

    cdr9042

    Joined:
    Apr 22, 2018
    Posts:
    79
    Thanks for the tips. Turn out I have to update Unity to 2019.4.17 to be able to update LeanTouch.
    Following @Darkcoder 's post, I have made it works. Thank you

    LeanTouch.OnFingerDown += leanSelectByFinger.SelectScreenPosition;
     
    Darkcoder likes this.
  40. TeohRIK

    TeohRIK

    Joined:
    Jan 22, 2014
    Posts:
    105
    Hi, I having some issue with Lean Localization v1.5

    Before v1.5, when I changed the language in the script it will automatic record down and apply it when I open again next time, but it doesn't seem to work anymore with v1.5, not sure is my setting or just bug.

    This my current setting
    Capture.PNG

    This how I set the language in script now
    Capture 2.PNG

    Also there an error when using .net 4.x, but it can be solve if I add csc.rsp with -r:System.Web.dll
     
    Last edited: Apr 22, 2021
  41. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    I can replicate this issue. The code seems fine though, hmm. I'll send you a test build when I figure it out.
     
  42. mrokutwr

    mrokutwr

    Joined:
    Oct 1, 2020
    Posts:
    7


    my settings
     

    Attached Files:

  43. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    I believe I've fixed this bug. You can get an early build HERE.

    This also changes the LeanLocalization.SaveLoad setting to have the WhenChanged and WhenChangedAlt settings. This allows you to have two save/load languages (e.g. audio and text).
     
  44. TeohRIK

    TeohRIK

    Joined:
    Jan 22, 2014
    Posts:
    105
    Thanks :D gonna try it now

    Edit: Thanks, it working fine now
     
    Last edited: Apr 23, 2021
    Darkcoder likes this.
  45. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    Great, I'll submit an update!
     
  46. TeohRIK

    TeohRIK

    Joined:
    Jan 22, 2014
    Posts:
    105
    Oh hi, I noticed the CSV loader doesn't support comma anymore only supporting equal sign and loading the CSV in prefab editing mode doesn't allow to save
     
  47. mrokutwr

    mrokutwr

    Joined:
    Oct 1, 2020
    Posts:
    7
    Thank you! Works great.
    But I can't use the Language Detection method. I have an android phone. The language is not detected at the start of the game.
     
  48. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,588
    For now I hard coded the parsing to use the original (Title = Text // Comment) format. When I have more time I will implement proper command and semicolon CSV. What do you mean by saving the CSV in prefab mode?


    Which language detection method are you using? Which language is supposed to show? And does this language show up in the languages list of your LeanLocalization component, and does it have the right culture names set?
     
  49. mrokutwr

    mrokutwr

    Joined:
    Oct 1, 2020
    Posts:
    7
    I need to define the systemic Russian language. The Russian language prefab was taken from your asset.

    upload_2021-4-24_10-55-47.png upload_2021-4-24_10-55-47.png
     
  50. TeohRIK

    TeohRIK

    Joined:
    Jan 22, 2014
    Posts:
    105
    oh ok understand, take your time then, I can probably modify the script from my side first

    I mean like when trying to press the load now button in Lean Language CSV component in prefab editing mode, the game object wont set to dirty to allow us to press the save button to save the edited prefab.

    ----

    also I notice 1 very unusual bug with android split application binary built is that the GetTranslation for Object is not working, it working fine with Text
     
unityunity