Skip to content

Instantly share code, notes, and snippets.

View hww's full-sized avatar

Valery (h2w) hww

View GitHub Profile
#if UNITY_EDITOR
using System.Reflection;
using UnityEngine;
using UnityEditor;
public class FontSwitcher : EditorWindow
{
[MenuItem("Font/Show Window")]
public static void ShowFontWindow()
{
@hww
hww / gist:c41d1d9d492c30c0c80dc2ddde8ab50b
Created October 6, 2022 19:34 — forked from KDawg/gist:10537524
Debug Unity3D OnGui Label Text With Background
// display a background texture banner
GUI.DrawTexture(new Rect(-30.0f, 384.0f, m_topScoreBanner.width, m_topScoreBanner.height), m_topScoreBanner);
Vector2 pivotPoint = new Vector2(Screen.width / 2, Screen.height / 2);
GUIStyle scoreStyle = new GUIStyle();
// DEBUG: create a background texture coloring the entire label background
Texture2D debugTex = new Texture2D(1,1);
debugTex.SetPixel(0,0,Color.grey);
debugTex.Apply();
@hww
hww / Draw.cs
Created September 26, 2022 17:37 — forked from nothke/Draw.cs
///
/// Draw lines at runtime
/// by Nothke
/// unlicensed, aka do whatever you want with it
/// made during Stugan 2016 :)
/// ..(it's midnight, and Robbie clicks A LOT, LOUDLY!)
///
/// Important:
/// - Should be called in OnPostRender() (after everything else has been drawn)
/// therefore the script that calls it must be attached to the camera
@hww
hww / DumpEditorTextures.cs
Created September 26, 2022 16:22 — forked from TarasOsiris/DumpEditorTextures.cs
Dump all Unity3d Editor GUI skin textures as images
using UnityEngine;
using System.IO;
using UnityEditor;
public static class DumpEditorTextures
{
const string AssetsFolder = "Assets";
const string TexturesDestFolderNamePro = "TexturesPro";
const string TexturesDestFolderNameNormal = "TexturesNormal";
static readonly string TexturesDestPathPro = Path.Combine(AssetsFolder, TexturesDestFolderNamePro);
@hww
hww / define-with-struct.rkt
Last active July 8, 2022 08:59
Define variables with name of structure fields. Use names instead positions as match-define
#lang racket/base
;; ----------------------------------------------------------------------------
;;
;; Valeriya P.
;; https://gist.github.com/hww
;; _______ ________ ________
;; | | | | | | | | |
;; | | | | | | | |
;; |___|___|________|________|
;;
@hww
hww / proceduarl-function-name.rkt
Last active June 26, 2022 16:05
Racket - Build the function name in the macro
#lang racket/base
(require (for-syntax racket/base))
(require (for-syntax racket/syntax racket/base syntax/parse))
(require racket/syntax)
;; ///////////////////////////////////////////////
;; In case if the argumens are anything but not ID
;; ///////////////////////////////////////////////
(define (get-1) 100)
@hww
hww / crc32.py
Last active August 19, 2022 12:33 — forked from aerosoul94/dc-disassemble.py
The Last of Us script disassembler
# Python
import os
import sys
def create_table(poly):
init=0
l=[0]*256
for i in range(256):
@hww
hww / POFile.cs
Last active July 30, 2019 07:54
Simple localization solution for Unity engine
using UnityEngine;
using System.IO;
using System.Collections.Generic;
using System;
/// <summary>
/// Simple localization solution for Unity engine.
/// Loading and parsing language.po.txt file from streaming assets folder.
///
/// Author: Valery https://github.com/hww
///
@hww
hww / NormalsVisualizer.cs
Created March 13, 2019 12:29 — forked from mandarinx/NormalsVisualizer.cs
Visualize mesh normals in Unity3D
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(MeshFilter))]
public class NormalsVisualizer : Editor {
private Mesh mesh;
void OnEnable() {
MeshFilter mf = target as MeshFilter;
@hww
hww / arcadia_demo
Created January 16, 2019 19:00 — forked from timsgardner/arcadia_demo
arcadia cube, vr demo
(let [ns 'clojure-west.demo]
(require ns)
(in-ns ns)
(use
'clojure.pprint
'clojure.repl
'clojure-west.freeze)
(require
;'[clojure-west.mesh :as mesh]
'[clojure-west.materials :as mat]