This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public static class CameraExtensions { | |
public static void LayerCullingShow(this Camera cam, int layerMask) { | |
cam.cullingMask |= layerMask; | |
} | |
public static void LayerCullingShow(this Camera cam, string layer) { | |
LayerCullingShow(cam, 1 << LayerMask.NameToLayer(layer)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System; | |
using UnityEngine; | |
public class LoopedEnumList<T> | |
{ | |
private readonly List<T> _items; | |
private readonly int _startIndex; | |
private int _currentIndex; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public static class RuntimePlatformUtils | |
{ | |
private static RuntimePlatform _platform; | |
static RuntimePlatformUtils() | |
{ | |
_platform = Application.platform; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public static class UnityExtensionMethods | |
{ | |
#region go_utils | |
public static void Activate(this GameObject go) | |
{ | |
go.SetActive(true); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System; | |
namespace TarasOsirisGists | |
{ | |
public static class ListUtils | |
{ | |
private static Random _rnd; | |
/// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using JetBrains.Annotations; | |
using UnityEngine; | |
[PublicAPI] | |
public abstract class MonoSingleton<T> : MonoBehaviour where T : MonoSingleton<T> | |
{ | |
static T _instance; | |
public static T Instance | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
[UTActionInfoAttribute(actionCategory = "Build")] | |
[UTDoc(title = "Set Android Texture Compression", description = "Sets Android texture Compression.")] | |
[UTInspectorGroups(groups = new []{ "Player" })] | |
public class UTSetAndroidBuildSubtarget : UTAction | |
{ | |
[UTDoc(description = "Android targets, only: The texture compression.")] | |
[UTInspectorHint(group = "Player", order = 4, required = true)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
/// <summary> | |
/// PlayerPrefs wrapper to provide saving boolean values. | |
/// </summary> | |
public static class CustomPlayerPrefs | |
{ | |
private const int StorageFalse = 0; | |
private const int StorageTrue = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using HutongGames.PlayMaker; | |
using UnityEngine; | |
[ActionCategory("SmoothMoves")] | |
[Tooltip("Sets the sprite color of the Sprite")] | |
public class SmoothMoves_SetSpriteColor : FsmStateAction | |
{ | |
[RequiredField] | |
[CheckForComponent(typeof(SmoothMoves.Sprite))] | |
[Tooltip("Game Object to set the color on.")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public static class AndroidIdRetriever | |
{ | |
public static string Retrieve() | |
{ | |
AndroidJavaClass clsUnity = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); | |
AndroidJavaObject objActivity = clsUnity.GetStatic<AndroidJavaObject>("currentActivity"); | |
AndroidJavaObject objResolver = objActivity.Call<AndroidJavaObject>("getContentResolver"); | |
AndroidJavaClass clsSecure = new AndroidJavaClass("android.provider.Settings$Secure"); |