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 / TMP_IntegerText.cs
Created Sep 4, 2019
Show integer values on TextMesh Pro texts without any garbage
View TMP_IntegerText.cs
using TMPro;
public static class TMP_IntegerText
{
private static readonly char[] arr = new char[20];
public static void SetText( this TMP_Text text, sbyte number )
{
SetText( text, (int) number );
}
@yasirkula
yasirkula / OpenShaderInNotepad.cs
Created Aug 3, 2019
An editor script for Unity 3D to open shaders in Notepad++ or the default text editor
View OpenShaderInNotepad.cs
using System.Diagnostics;
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine;
public class OpenShaderInNotepad
{
private const string NPP1 = @"C:\Program Files\Notepad++\notepad++.exe";
private const string NPP2 = @"C:\Program Files (x86)\Notepad++\notepad++.exe";
@yasirkula
yasirkula / ScreenshotCapture.cs
Created Jul 31, 2019
Quickly capture a screenshot in Unity
View ScreenshotCapture.cs
using System;
using System.IO;
using UnityEngine;
public static class ScreenshotCapture
{
// Saves the screenshot to desktop
public static void Capture()
{
string saveDirectory = Environment.GetFolderPath( Environment.SpecialFolder.DesktopDirectory );
@yasirkula
yasirkula / PluginJARExtractor.cs
Created Jul 26, 2019
Extract .jar from .aar for Unity Android native plugins
View PluginJARExtractor.cs
using System.Collections.Generic;
using System.Text;
using System;
using System.IO;
using System.IO.Compression;
using UnityEditor;
using UnityEngine;
namespace PluginExtractorNamespace
{
@yasirkula
yasirkula / content.js
Last active Jun 11, 2019
Restore fullscreen button on embedded YouTube videos (Chrome Extension)
View content.js
var checkDocument = function( doc )
{
var frames = doc.getElementsByTagName( "iframe" );
for( var i = 0, l = frames.length; i < l; i++ )
checkIframe( frames[i] );
};
var checkIframe = function(iframe)
{
if( iframe.src.indexOf( "https://www.youtube" ) == 0 )
@yasirkula
yasirkula / SimpleArchive.cs
Created May 22, 2019
Tar-like archive in pure C# (.NET 2.0 compatible)
View SimpleArchive.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace SimplePatchToolCore
{
public class SimpleArchive
{
// Archive Structure
@yasirkula
yasirkula / HorizontalCamera.cs
Created Jul 12, 2018
A script to fix the horizontal FOV/orthographic size of a camera to a specified value in Unity
View HorizontalCamera.cs
using UnityEngine;
[ExecuteInEditMode]
public class HorizontalCamera : MonoBehaviour
{
private Camera m_camera;
private float lastAspect;
[SerializeField]
private float m_fieldOfView = 60f;
@yasirkula
yasirkula / GradientGraphic.cs
Created May 17, 2018
Create 4-color gradient UI graphics in Unity
View GradientGraphic.cs
using UnityEngine;
using UnityEngine.UI;
public class GradientGraphic : MaskableGraphic
{
[Header( "-> The Real Deal <- <- <-" )]
public Color32 topLeftColor = Color.white;
public Color32 topRightColor = Color.white;
public Color32 bottomLeftColor = Color.white;
public Color32 bottomRightColor = Color.white;
@yasirkula
yasirkula / CircleGraphic.cs
Last active Jun 4, 2019
Create circles/ellipses in Unity UI system in one of three modes: FillInside, FillOutside and Edge.
View CircleGraphic.cs
using UnityEngine;
using UnityEngine.UI;
public class CircleGraphic : MaskableGraphic
{
public enum Mode { FillInside = 0, FillOutside = 1, Edge = 2 };
[Header( "-> The Real Deal <- <- <-" )]
[SerializeField]
private int detail = 64;
@yasirkula
yasirkula / DeviceOrientationManager.cs
Created Feb 8, 2018
Easily enable/disable auto screen orientation in Unity and receive callback upon orientation change. See the comments section below for instructions.
View DeviceOrientationManager.cs
using UnityEngine;
public class DeviceOrientationManager : MonoBehaviour
{
private const float ORIENTATION_CHECK_INTERVAL = 0.5f;
private float nextOrientationCheckTime;
private static ScreenOrientation m_currentOrientation;
public static ScreenOrientation CurrentOrientation
You can’t perform that action at this time.