Lean Common


DOCUMENTATION

What is Lean Common?

Lean Common is a lightweight collection of scripts and media used by all Lean assets.







Assets

Here's a list of all my other assets, please check them out!

You can also view this list on my Asset Store page.

Lean GUI

Lean GUI

Lean GUI is a colllection of components that extend Unity's GUI system, allowing you to rapidly enhance the user experience (UX) of your game's UI.


Lean Transition

Lean Transition

Quickly polish your games using Lean Transition. This asset allows you to easily tween or animate almost anything in your game, making it transition smoothly.


Paint in 3D

Paint in 3D

Paint all your objects using Paint in 3D - both in game, and in editor. All features are optimized with GPU accelerated texture painting, so you can enjoy consistent performance, even if you paint your objects one million times!


Lean Pool

Lean Pool

Quickly optimize the performance of your games using Lean Pool. Within minutes you can use this lightweight asset to preload, recycle, and limit the spawning of your prefabs.


Space Graphics Toolkit

Space Graphics Toolkit

Quickly make the space scene of your dreams using Space Graphics Toolkit. This huge collection of space effects can be customized and combined in any way you like, allowing you to quickly make realistic or fantasy worlds. Each feature has been heavily optimized to run on almost any device and platform.


Lean Touch

Lean Touch

Rapidly develop your game with consistent input across desktop & mobile using Lean Touch. This lightweight asset comes with many modular components, allowing you to customize them to your exact project needs!


Lean Localization

Lean Localization

Lean Localization is a localization library that's designed to be as simple to use as possible for both designers, and programmers.


Lean GUI Shapes

Lean GUI Shapes

Lean GUI Shapes allows you to quickly add lines, rounded boxes, polygons, and much more to your GUI!


Destructible 2D

Destructible 2D

Unlock the full potential of your 2D games using Destructible 2D, this asset allows you to quickly convert all your boring solid sprites into fully destructible ones!


Planet Pack - Space Graphics Toolkit

Planet Pack - Space Graphics Toolkit

This pack contains 26 high detail PBR planets, all finished using the powerful planet features of Space Graphics Toolkit (SGT). This is a standalone package, so SGT is not required. You can even use the included features to turn your own planets into beautiful worlds!


Lean Touch+

Lean Touch+

Lean Touch+ is an extension to the popular Lean Touch asset, adding many more example scenes.


Volumetric Audio

Volumetric Audio

Unity sounds only emanate from a single point source. This is great for explosions and footsteps, but quite often you need something more advanced. Volumetric Audio is an easy to use package that allows you to define boxes, spheres, capsules, paths, or meshes that sounds can emanate from.






Versions

1.0.0

Initial version.







Components

LeanHelper

This class contains useful methods used in almost all LeanTouch code.


static GameObject
CreateAsset
string name

This method creates an empty GameObject prefab at the current asset folder



static T
CreateElement<T>
Transform parent

This method allows you to create a UI element with the specified component and specified parent, with behavior consistent with Unity's built-in UI element creation.



static float
GetDampenFactor
float damping, float elapsed

This method gives you the time-independent 't' value for lerp when used for dampening. This returns 1 in edit mode, or if dampening is less than 0.



static T
Destroy<T>
T o

This method allows you to destroy the target object in game and in edit mode, and it returns null.



static T
GetObjectFromSerializedProperty<T>
object target, SerializedProperty property

This method gives you the actual object behind a SerializedProperty given to you by a property drawer.




LeanInput

This class wraps UnityEngine.Input and UnityEngine.InputSystem so they can both be used from the same interface.



LeanInspector<T>

This class allows you to quickly make custom inspectors with common features.



LeanDestroy

This component will automatically destroy a GameObject after the specified amount of time.

NOTE  If Seconds is set to -1, then you must manually call the DestroyNow method from somewhere.

GameObject
Target

The GameObject that will be destroyed.

None/null = This GameObject.



float
Seconds

The amount of seconds remaining before this GameObject gets destroyed.

-1 = You must manually call the DestroyNow method.



void
DestroyNow

You can manually call this method to destroy the current GameObject now.




LeanPath

This component stores a list of points that form a path.


List<Vector3>
Points

The points along the path.



bool
Loop

Do these points loop back to the start?



Space
Space

The coordinate system for the points.



int
Smoothing

The amount of lines between each path point when read from LeanScreenDepth.



LineRenderer
Visual

This allows you to draw a visual of the path using a LineRenderer.




LeanPlane

This component stores information about a 3D plane. By default this plane lays on the XY axis, or faces the Z axis.


bool
ClampX

Should the plane be clamped on the x axis?



bool
ClampY

Should the plane be clamped on the y axis?



float
SnapX

The distance between each position snap on the x axis.



float
SnapY

The distance between each position snap on the x axis.




LeanRoll

This component rotates the current GameObject based on the current Angle value.

NOTE  This component overrides and takes over the rotation of this GameObject, so you can no longer externally influence it.

float
Angle

The current angle in degrees.



bool
Clamp

Should the Angle value be clamped?



float
ClampMin

The minimum Angle value.



float
ClampMax

The maximum Angle value.



float
Damping

If you want this component to change smoothly over time, then this allows you to control how quick the changes reach their target value.

-1 = Instantly change.

1 = Slowly change.

10 = Quickly change.



void
IncrementAngle
float delta

The Angle value will be incremented by the specified angle in degrees.



void
DecrementAngle
float delta

The Angle value will be decremented by the specified angle in degrees.



void
RotateToDelta
Vector2 delta

This method will update the Angle value based on the specified vector.



void
SnapToTarget

This method will immediately snap the current angle to its target value.




LeanSpawn

This component allows you to spawn a prefab at the specified world point.

NOTE  For this component to work you must manually call the Spawn method from somewhere.

Transform
Prefab

The prefab that this component can spawn.



SourceType
DefaultPosition

If you call Spawn(), where should the position come from?



SourceType
DefaultRotation

If you call Spawn(), where should the rotation come from?



void
Spawn

This will spawn Prefab at the current Transform.position.



void
Spawn
Vector3 position

This will spawn Prefab at the specified position in world space.




LeanLinkTo

This component allows you to open a URL using Unity events (e.g. a button).


LinkType
Link

The URL that will be opened.




LeanUpgradeEventSystem

This component will automatically update the event system if you switch to using the new InputSystem.



Index

What is Lean Common?



Assets

Lean GUI

Lean Transition

Paint in 3D

Lean Pool

Space Graphics Toolkit

Lean Touch

Lean Localization

Lean GUI Shapes

Destructible 2D

Planet Pack - Space Graphics Toolkit

Lean Touch+

Volumetric Audio



Versions

1.0.0



Components

LeanHelper

LeanInput

LeanInspector<T>

LeanDestroy

LeanPath

LeanPlane

LeanRoll

LeanSpawn

LeanLinkTo

LeanUpgradeEventSystem