Skip to content

Instantly share code, notes, and snippets.

View ababilinski's full-sized avatar
🤠

Adrian Babilinski ababilinski

🤠
View GitHub Profile
@ababilinski
ababilinski / WebCameraShader.shader
Created February 12, 2024 16:30
Web Camera Shader With Rotate Property
//Shader to rotate an image from a Unity WebCameraTexture.
Shader "Custom/Web Camera Shader"
{
Properties
{
_MainTex ( "Main Texture", 2D ) = "white" {}
_RotationDegrees ( "Rotation Degrees", Float) = 0
}
@ababilinski
ababilinski / convert-json-to-csv.ipynb
Last active March 13, 2024 20:46
convert-json-to-csv
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ababilinski
ababilinski / PlayParticlesInEditorExtension.cs
Last active May 9, 2024 07:49
Play particles in editor without having the simulation selected.
/* LICENSE
Copyright (c) 2021 Adrian Babilinski
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
@ababilinski
ababilinski / EditorGuiUtility.cs
Created July 24, 2020 17:27
A script for drawing horizontal lines inside of the Unity Editor
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
public static class EditorGuiUtility
{
public static void DrawUILine(Color color, int thickness = 2, int padding = 10)
{
Rect r = EditorGUILayout.GetControlRect(GUILayout.Height(padding+thickness));
@ababilinski
ababilinski / SingletonScriptableObject.cs
Last active March 17, 2021 16:16
Abstract class for making reload-proof singletons out of Uniy3D ScriptableObjects
using System.Linq;
using UnityEngine;
/// <summary>
/// Abstract class for making reload-proof singletons out of ScriptableObjects
/// Returns the asset created on editor, null if there is none
/// Based on https://www.youtube.com/watch?v=VBA1QCoEAX4
/// </summary>
/// <typeparam name="T">Type of the singleton</typeparam>
@ababilinski
ababilinski / ResizeTool.cs
Last active March 17, 2021 15:52
A method that allows for fast GPU resizing in the Unity Engine.
/* LICENSE
Copyright (c) 2019 Adrian Babilinski
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: