Skip to content

Instantly share code, notes, and snippets.

@ksnnacar
ksnnacar / LoadAddressablesSprite.cs
Last active December 1, 2021 08:54
Unity find atlas of a UI.Image.Sprite and set it as AssetReferenceAtlasedSprite.
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.U2D;
using UnityEngine.UI;
public class LoadAddressablesSprite : MonoBehaviour
{
[SerializeField] private AssetReferenceAtlasedSprite assetReferenceSprite;
@ksnnacar
ksnnacar / AddRemovePersistentListener.cs
Created November 28, 2017 21:42
AddRemovePersistentListener.cs
using UnityEngine.UI;
using UnityEditor.Events;
using UnityEngine.Events;
public class AddRemovePersistentListener : MonoBehaviour
{
/*
Just a basic use case for removing and adding listeners on runtime.
Sometimes it's pretty handy.
It may be expensive for dealing with a bunch of buttons and listeners. Use at your own risk.
K.S.A. 29.11.17
@ksnnacar
ksnnacar / LeanLocalizedTextMeshPro.cs
Last active January 21, 2025 14:27
Lean Localization Text Mesh Pro
/*
This file is my contribution to use the Lean Localization asset with TextMeshProUGUI,
I'm not the owner of the main asset, All copyrights are their respective owners.
Please check the original license of the package if you have any questions regarding that.
You can get the asset free on the assetstore:
http://www.assetstore.unity3d.com/#!/content/28504
22.11.2017 K.S.A
github.com/ksnnacar
*/