Skip to content

Instantly share code, notes, and snippets.

🐤

Süleyman Yasir KULA yasirkula

🐤
Block or report user

Report or block yasirkula

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@yasirkula
yasirkula / MultiScreenshotCapture.cs
Last active May 21, 2020
Capture multiple screenshots with different resolutions simultaneously in Unity 3D
View MultiScreenshotCapture.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using UnityEditor;
using UnityEngine;
namespace MultiScreenshotCaptureNamespace
{
internal static class ReflectionExtensions
@yasirkula
yasirkula / UnitypackageExtractor.cs
Last active Mar 19, 2020
Extract a .unitypackage to any directory (even outside the project folder) from within Unity
View UnitypackageExtractor.cs
//#define OPEN_ASSET_STORE_CACHE_AS_INITIAL_PATH
#define STOP_EXTRACTION_WHEN_WINDOW_CLOSED
using System;
using System.IO;
using System.IO.Compression;
using System.Text;
using System.Threading;
using UnityEditor;
using UnityEngine;
@yasirkula
yasirkula / SlicedFilledImage.cs
Last active May 29, 2020
Combining UI Image's Sliced+Filled features together in Unity
View SlicedFilledImage.cs
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
#if UNITY_2017_4 || UNITY_2018_2_OR_NEWER
using UnityEngine.U2D;
#endif
using Sprites = UnityEngine.Sprites;
#if UNITY_EDITOR
@yasirkula
yasirkula / ScriptedAnimations.cs
Last active Feb 6, 2020
GC-free animation system for simple animations like scaling/moving objects or fading a UI element in Unity
View ScriptedAnimations.cs
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace ScriptedAnim
{
// Hide from Add Component menu
[AddComponentMenu( "" )]
public class ScriptedAnimations : MonoBehaviour
{
@yasirkula
yasirkula / DirectoryComparer.cs
Last active Mar 17, 2020
Compare the contents of two directories and apply any changes to the target directory to synchronize these two directories
View DirectoryComparer.cs
#define COMPARE_FILE_CONTENTS
#if COMPARE_FILE_CONTENTS
#define USE_THREADS
#endif
using System;
using System.Collections.Generic;
using System.IO;
#if USE_THREADS
using System.Threading;
@yasirkula
yasirkula / UIToggler.cs
Last active Jan 11, 2020
Quickly toggle the visibility of UI layer (canvases) in Unity's Scene view
View UIToggler.cs
using UnityEditor;
using UnityEngine;
public class UIToggler
{
private const int UI_LAYER = 1 << 5;
[InitializeOnLoadMethod]
private static void Init()
{
@yasirkula
yasirkula / EmptyParentCreator.cs
Last active Oct 21, 2019
Group the selected objects under a new parent object in Hierarchy (Unity 3D)
View EmptyParentCreator.cs
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public static class EmptyParentCreator
{
[MenuItem( "GameObject/Create Empty Parent", priority = 0 )]
private static void CreateEmptyParent( MenuCommand command )
{
// This happens when this button is clicked via hierarchy's right click context menu
@yasirkula
yasirkula / BetterWaitForSeconds.cs
Created Oct 13, 2019
WaitForSeconds manager that reuses instances to avoid GC in Unity
View BetterWaitForSeconds.cs
using System.Collections.Generic;
using UnityEngine;
public static class BetterWaitForSeconds
{
private class WaitForSeconds : CustomYieldInstruction
{
private float waitUntil;
public override bool keepWaiting
{
@yasirkula
yasirkula / HierarchyFolderObject.cs
Last active Feb 6, 2020
Create folder objects in Hierarchy that automatically detach all their children while building the game (for Unity3D)
View HierarchyFolderObject.cs
#define ENABLE_LOGGING // Logs the folder objects that were flattened to the console
//#define SIMULATE_BUILD_BEHAVIOUR_ON_PLAY_MODE // Simulates Execution.AtBuildTime when entering Play Mode in the Editor, as well
#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine.SceneManagement;
using System.Collections.Generic;
using System.Reflection;
#endif
@yasirkula
yasirkula / CameraFollow.cs
Created Sep 21, 2019
A camera follow script with numerous parameters for Unity
View CameraFollow.cs
using UnityEngine;
[ExecuteInEditMode]
public class CameraFollow : MonoBehaviour
{
[Tooltip( "Object to follow" )]
public Transform Target;
[Tooltip( "Target distance to the followed object" )]
public Vector3 DistanceToTarget = new Vector3( 0f, 3f, -5f );
You can’t perform that action at this time.