Skip to content

Instantly share code, notes, and snippets.

View listopad's full-sized avatar
🎯
Focusing

Artem listopad

🎯
Focusing
View GitHub Profile
anonymous
anonymous / Messenger.cs
Created February 10, 2014 20:35
Messenger for Unity3D
using System;
using System.Collections.Generic;
public delegate void Callback();
public delegate void Callback<T>(T arg1);
public delegate void Callback<T, U>(T arg1, U arg2);
public delegate void Callback<T, U, V>(T arg1, U arg2, V arg3);
public enum MessengerMode {
DONT_REQUIRE_LISTENER,
@frarees
frarees / MinMaxSliderAttribute.cs
Last active July 8, 2024 17:26
MinMaxSlider for Unity
// https://frarees.github.io/default-gist-license
using System;
using UnityEngine;
[AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = false)]
public class MinMaxSliderAttribute : PropertyAttribute
{
public float Min { get; set; }
public float Max { get; set; }
@adamcoulombe
adamcoulombe / updateAllLinkedSmartObjectsInFolder.jsx
Created February 27, 2015 20:34
Photoshop Script: Update all Linked Smart Objects in a Folder of PSD files
var folderPath = "/c/Users/Adam/Projects/myproject"
//var inputFolder = Folder.selectDialog ("Select the folder that contains the files for export:");
var inputFolder = Folder(folderPath);
var files = inputFolder.getFiles (/\.(psd)$/i);
for (var i = 0; i < files.length; i++) {
var f = files[i];
var doc = app.open (f);
@FullStackForger
FullStackForger / EventLogger
Created April 15, 2015 19:42
Registers custom handles for one custom or all UI events ( Unity3d )
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using System.Collections;
// inspired by: https://github.com/AyARL/UnityGUIExamples/blob/master/EventTrigger/Assets/TriggerSetup.cs
// gist: https://gist.github.com/rusticode/05b306f11aa4a33bb113
[RequireComponent(typeof(RectTransform))]
@rickyah
rickyah / MonoBehaviourSingleton.cs
Created June 3, 2015 08:59
MonoBehaviour Singleton
using System;
using UnityEngine;
/// <summary>
/// This is a generic Singleton implementation for Monobehaviours.
/// Create a derived class where the type T is the script you want to "Singletonize"
/// Upon loading it will call DontDestroyOnLoad on the gameobject where this script is contained
/// so it persists upon scene changes.
/// </summary>
/// <remarks>
@larryhou
larryhou / ExportTool.cs
Last active March 31, 2023 11:07
Command-line building tool for Unity project
using UnityEditor;
using System.Collections.Generic;
// Put this memu command script into Assets/Editor/
class ExportTool
{
static void ExportXcodeProject ()
{
EditorUserBuildSettings.SwitchActiveBuildTarget (BuildTarget.iOS);
@mpost
mpost / android-cli.bat
Created July 29, 2016 14:47
Register windows context menu entry to adb install apk from explorer
@ECHO OFF
ECHO Running "adb install -r %1"
adb install -r %1
PAUSE
@robsonbramos
robsonbramos / SlideTween.cs
Last active August 8, 2020 19:11
Simple inspector to use along with DOTween for implementing sliding GUI elements in Unity 5.
using UnityEngine;
using System.Collections;
using DG.Tweening;
// BOA
public class SlideTween : MonoBehaviour
{
public enum Position { OutsideTop, OutsideBottom, OutsideLeft, OutsideRight, Center, InsideTop, InsideBottom, InsideLeft, InsideRight };
public Position enterPoint;
public Position targetPoint;
@reidscarboro
reidscarboro / LoadingDots.cs
Created May 10, 2017 13:29
Bouncing loading dots in Unity using DoTween
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
public class LoadingDots : MonoBehaviour {
//the total time of the animation
public float repeatTime = 1;
//the time for a dot to bounce up and come back down
@robsonbramos
robsonbramos / UISlideTween.cs
Last active June 23, 2020 11:45
Inspector editor to quick set DOTween UI animation in Unity
using System.Collections;
using DG.Tweening;
using UnityEngine;
using UnityEditor;
public class UISlideTween : MonoBehaviour
{
[HideInInspector]
public Vector3 enterPosition, enterScale, targetPosition, targetScale, exitPosition, exitScale;
[HideInInspector]