Skip to content

Instantly share code, notes, and snippets.

View babon's full-sized avatar

Dmitry babon

View GitHub Profile
@babon
babon / ExtensionlessTexture2DToPNG.cs
Created July 28, 2020 05:42
Convert unity texture without extension as png
[ContextMenuItem("Yo", "Yo")]
public Texture2D tex;
public void Yo()
{
Texture2D DeCompress(Texture2D source)
{
RenderTexture renderTex = RenderTexture.GetTemporary(
source.width,
source.height,
0,
@unitycoder
unitycoder / DrawBounds.cs
Last active February 12, 2025 04:14
Draw Bounds with Debug.DrawLine , Draw Box, Draw Runtime Gizmos
void DrawBounds(Bounds b, float delay=0)
{
// bottom
var p1 = new Vector3(b.min.x, b.min.y, b.min.z);
var p2 = new Vector3(b.max.x, b.min.y, b.min.z);
var p3 = new Vector3(b.max.x, b.min.y, b.max.z);
var p4 = new Vector3(b.min.x, b.min.y, b.max.z);
Debug.DrawLine(p1, p2, Color.blue, delay);
Debug.DrawLine(p2, p3, Color.red, delay);
@omgwtfgames
omgwtfgames / A set of Unity3D extension methods
Last active March 2, 2024 17:44
Some useful extension method for Unity3D
A collection of useful C# extension methods for the Unity engine.
using UnityEngine;
using System.Collections;
using System.Security.Cryptography;
using System.Text;
public class EncryptedPlayerPrefs {
// Encrypted PlayerPrefs
// Written by Sven Magnus
// MD5 code by Matthew Wegner (from [url]http://www.unifycommunity.com/wiki/index.php?title=MD5[/url])