Skip to content

Instantly share code, notes, and snippets.

View mukaschultze's full-sized avatar
¯\_(ツ)_/¯

Samuel Schultze mukaschultze

¯\_(ツ)_/¯
View GitHub Profile
@mukaschultze
mukaschultze / URLParameters.cs
Created January 11, 2022 03:26
Unity URL Parameters (WebGL)
/* * * * *
* URLParameters.cs
* ----------------
*
* This singleton script provides easy access to any URL components in a Web-build.
* Since Unity is about to deprecate the old "Application.ExternalEval" api we can
* no longer inject our javascript into the browser. We now need to use a jslib file
* which holds the javascript part. This script, when imported in a project, will
* automatically extract a jslib file into the Plugins folder named: "URLParameters.jslib".
*
@mukaschultze
mukaschultze / Clipboard.cs
Created January 11, 2022 03:25
Unity Clipboard
using UnityEngine;
#if UNITY_WEBGL && !UNITY_EDITOR
using System.Runtime.InteropServices;
#endif
public static class Clipboard {
public static string ClipboardText {
get { return clipboard_read_text(); }
set { clipboard_write_text(value); }
@mukaschultze
mukaschultze / rxjs-hooks.ts
Created September 5, 2021 19:39
RxJS hooks for React
import { useEffect, useRef, useState } from "react";
import { BehaviorSubject, Observable, PartialObserver, Subject } from "rxjs";
function useConstant<T>(factory: () => T): T {
const ref = useRef<{ value: T }>();
if (!ref.current) {
ref.current = { value: factory() };
}
@mukaschultze
mukaschultze / plot.py
Created July 24, 2020 21:53
Plot Graph
import re
import numpy as np
from matplotlib import pyplot as plt
replacements = {
'sin' : 'np.sin',
'cos' : 'np.cos',
'exp': 'np.exp',
'sqrt': 'np.sqrt',
@mukaschultze
mukaschultze / PreviewBackgroundColor.cs
Last active May 6, 2020 22:09
Change Unity preview background to a nicer color!
using UnityEditor;
using UnityEngine;
namespace EnhancedHierarchy {
[InitializeOnLoad]
static class PreviewBackgroundColor {
private static readonly Color backgroundColor = new Color(1f, 0f, 1f); // Change this color
static PreviewBackgroundColor() {
@mukaschultze
mukaschultze / RemoveDefaultBG.cs
Created May 5, 2020 17:56
Remove left side tint in the Unity hierarchy window
using UnityEditor;
using UnityEngine;
namespace EnhancedHierarchy {
[InitializeOnLoad]
static class RemoveDefaultBG {
static RemoveDefaultBG() {
After.Frames(1, () => {
var s = ReflectionHelper.FindType("UnityEditor.SceneVisibilityHierarchyGUI");
var t = s.GetNestedType("Styles", ReflectionHelper.FULL_BINDING);
@mukaschultze
mukaschultze / ObjectPool.cs
Last active May 4, 2020 20:40
Unity - Object Pool
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Object = UnityEngine.Object;
public class ObjectPool<T> where T : Component {
public List<T> objects { get; private set; }
public T objReference { get; private set; }
@mukaschultze
mukaschultze / AssetStoreToolsCallbacks.cs
Last active January 18, 2020 07:01
AssetStoreToolsCallbacks (self contained)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using UnityEditor;
public class AssetStoreToolsCallbacks {
public static Action<object, string> afterAssetsUploaded = (sender, err) => { };
public static Action<object, string> afterAssetsBundleUploaded = (sender, err) => { };
@mukaschultze
mukaschultze / RequiredLayers.cs
Created January 17, 2020 22:56
RequiredLayers
using System.Linq;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
public static class RequiredLayers {
private const string MENU_ITEM = "Your Asset/Sync Layers";
private const string ALREADY_ASKED_KEY = "AssetAddLayersAsked";
private static readonly string[] requiredLayers = new [] {

Artigo Metodologia de Pesquisa em SI

Título

Relato de desenvolvimento de emulador NES usando Rust Relato do uso da linguagem Rust no desenvolvimento de um emulador de NES

Autores

Samuel M. Schultze [email protected]

Manual de estilo