Skip to content

Instantly share code, notes, and snippets.

@nukadelic
nukadelic / Tween.cs
Created Feb 27, 2022
Unity Tweener for MonoBehaviours
View Tween.cs
using System.Collections.Generic;
using UnityEngine;
#region global component extension functions
public static class TweenEx
{
/// <summary> Main tweener fucntion </summary>
public static Tween tween( this Component comp, float duration = 1f, Tween.EaseType ease = default, float delay = 0f, bool autoStart = true )
{
@nukadelic
nukadelic / ContextMenuEditor.cs
Created Sep 29, 2021
Unity Context Menu Editor Window
View ContextMenuEditor.cs
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Reflection;
public class ContextMenuEditor : EditorWindow
{
[MenuItem("Tools/Edit Context Menu")] static void Init() => GetWindow<ContextMenuEditor>().Show();
System.Type UnityEditorMenuClass;
@nukadelic
nukadelic / FibonacciSphere.cs
Last active Mar 15, 2022
Fibonacci Sphere ( Unity3D )
View FibonacciSphere.cs
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class FibonacciSphere : MonoBehaviour
{
[Range(0,500)] public int count = 200;
[Range(0,2f)] public float radius = 1f;
@nukadelic
nukadelic / DisableXR.cs
Created Dec 15, 2020
Unity Disable / Enable XR On Enter play mode via mono behaviour script
View DisableXR.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
[ExecuteInEditMode]
public class DisableXR : MonoBehaviour
{
@nukadelic
nukadelic / EditorSceneGUIOverlay.cs
Last active Sep 17, 2020
EditorSceneGUIOverlay
View EditorSceneGUIOverlay.cs
#if UNITY_EDITOR
using System.Reflection;
using UnityEditor;
using System.Linq;
using UnityEngine;
public class EditorSceneGUIOverlay : Editor
@nukadelic
nukadelic / EditorFontSize.cs
Last active Apr 22, 2022
Unity Editor Font Size Changer -- EditorStyles
View EditorFontSize.cs
#if UNITY_EDITOR
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Reflection;
public class EditorFontSize : EditorWindow
{
[MenuItem("Window/Editor Font Size")]
@nukadelic
nukadelic / index.php
Created Mar 19, 2020
PHP CDN - Upload file , list all files , delete file
View index.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport'/>
<meta name="viewport" content="width=device-width"/>
<title>PHP CDN</title>
@nukadelic
nukadelic / tensorflow_to_barracuda.py
Last active Jan 6, 2020
Modfied barracuda converter ( tensorflow-pb to unity-nn ) [ 0.3.2 ]
View tensorflow_to_barracuda.py
from __future__ import print_function
import numpy as np
import struct # convert from Python values and C structs
import tensorflow as tf
import re
import barracuda
from barracuda import Struct
from google.protobuf import descriptor
from google.protobuf.json_format import MessageToJson
@nukadelic
nukadelic / Dynamical Uniform Boundedness Conjecture brute force.js
Last active Nov 13, 2020
Dynamical Uniform Boundedness Conjecture brute force
View Dynamical Uniform Boundedness Conjecture brute force.js
// as seen on : https://www.youtube.com/watch?v=N92w4e-hrA4
// using : https://github.com/infusion/Fraction.js/blob/master/fraction.min.js
function makeLoop( z, c, loop_limit = 7, max_value = 1000000 )
{
var loop = [ z ];
var calc_func = ( vz, vc ) => vz.mul( vz ).add( vc );
@nukadelic
nukadelic / MLAgentsFileConfigEditor.cs
Last active Sep 25, 2019
Unity ML Agents File Config Editor
View MLAgentsFileConfigEditor.cs
// Download the DLL here:
// https://www.nuget.org/packages/YamlDotNet/
// at "Download package ( ... KB )"
// browse for the lib > .Net35 folder copy paste the dll into your unity assets folder
// Note this script file must be located inside a folder named "Editor"
using System;
using System.Text;
using System.IO;