Skip to content

Instantly share code, notes, and snippets.

Avatar
🌍
https://ninevastudios.com/

Taras Leskiv TarasOsiris

🌍
https://ninevastudios.com/
View GitHub Profile
@TarasOsiris
TarasOsiris / UiHighlightCenteredItem.cs
Created Feb 26, 2014
Put this script on game object with UIDragScrollView to get scale and alpha highlighting effect. Might be not very efficient but it works ok.
View UiHighlightCenteredItem.cs
using UnityEngine;
using System;
namespace Com.Nravo.NGUI {
[RequireComponent(typeof(UIDragScrollView))]
public class UiHighlightCenteredItem : MonoBehaviour {
// coefs to monitor
// zero means target is centered, 1 means target is max away
[Range(0.0f, 1.0f)] public float distanceFromCenterHorizontalCoef;
View .gitignore
# =============== #
# Unity generated #
# =============== #
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
#Unity3D Generated File On Crash Reports
sysinfo.txt
@TarasOsiris
TarasOsiris / CustomAssetUtility.cs
Last active Aug 29, 2015
Generic method to create .asset files. Taken from here http://www.jacobpennock.com/Blog/?page_id=715 and modified a bit.
View CustomAssetUtility.cs
using UnityEngine;
using UnityEditor;
using System.IO;
/// <summary>
/// Taken from here : http://www.jacobpennock.com/Blog/?page_id=715 and modified
/// </summary>
public static class CustomAssetUtility
{
public static void CreateAsset<T>() where T : ScriptableObject
@TarasOsiris
TarasOsiris / SmoothMoves_SetSpriteColor.cs
Last active Aug 29, 2015
Playmaker action to set color of the SmoothMoves.Sprite.
View SmoothMoves_SetSpriteColor.cs
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.")]
@TarasOsiris
TarasOsiris / CustomPlayerPrefs.cs
Created Jun 20, 2014
Unity3D PlayerPrefs wrapper to provide saving boolean values.
View CustomPlayerPrefs.cs
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;
@TarasOsiris
TarasOsiris / UTSetAndroidBuildSubtarget.cs
Created Jun 24, 2014
Set Android Texture Compression uTomate Action
View UTSetAndroidBuildSubtarget.cs
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)]
@TarasOsiris
TarasOsiris / ListUtils.cs
Last active Aug 29, 2015
Collection extension methods
View ListUtils.cs
using System.Collections.Generic;
using System;
namespace TarasOsirisGists
{
public static class ListUtils
{
private static Random _rnd;
/// <summary>
@TarasOsiris
TarasOsiris / RuntimePlatformUtils.cs
Last active Aug 29, 2015
RuntimePlatform utility class for Unity
View RuntimePlatformUtils.cs
using UnityEngine;
public static class RuntimePlatformUtils
{
private static RuntimePlatform _platform;
static RuntimePlatformUtils()
{
_platform = Application.platform;
}
@TarasOsiris
TarasOsiris / LoopedEnumList.cs
Last active Aug 29, 2015
Looped Enum List for Unity3D
View LoopedEnumList.cs
using System.Collections.Generic;
using System;
using UnityEngine;
public class LoopedEnumList<T>
{
private readonly List<T> _items;
private readonly int _startIndex;
private int _currentIndex;
@TarasOsiris
TarasOsiris / NGUI_UpdateLabel.cs
Created Nov 27, 2014
Updates NGUI Label with provided parameters. Playmaker Action
View NGUI_UpdateLabel.cs
using UnityEngine;
using HutongGames.PlayMaker;
[ActionCategory("NGUI")]
[HutongGames.PlayMaker.Tooltip("Updates NGUI Label with provided parameters")]
public class NGUI_UpdateLabel : FsmStateAction
{
[RequiredField]
[CheckForComponent(typeof(UILabel))]
[HutongGames.PlayMaker.Tooltip("Game Object to update.")]