Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
@unitycoder
unitycoder / PrintUnity3dType.cs
Created November 27, 2022 09:39 — forked from yin8086/PrintUnity3dType.cs
Unity3d Texture Type Descriptions.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestUnityConsole
{
class Program
{
@unitycoder
unitycoder / windows_hardening.cmd
Created November 21, 2022 18:25 — forked from mackwage/windows_hardening.cmd
Script to perform some hardening of Windows OS
:: Windows 10 Hardening Script
:: This is based mostly on my own personal research and testing. My objective is to secure/harden Windows 10 as much as possible while not impacting usability at all. (Think being able to run on this computer's of family members so secure them but not increase the chances of them having to call you to troubleshoot something related to it later on). References for virtually all settings can be found at the bottom. Just before the references section, you will always find several security settings commented out as they could lead to compatibility issues in common consumer setups but they're worth considering.
:: Obligatory 'views are my own'. :)
:: Thank you @jaredhaight for the Win Firewall config recommendations!
:: Thank you @ricardojba for the DLL Safe Order Search reg key!
:: Thank you @jessicaknotts for the help on testing Exploit Guard configs and checking privacy settings!
:: Best script I've found for Debloating Windows 10: https://github.com/Sycnex/Windows10Debloater
:
@unitycoder
unitycoder / StereographicProjectionBubble.shader
Created November 18, 2022 13:49 — forked from bgolus/StereographicProjectionBubble.shader
Modifying UVs using stereographic projection to create the illusion of a sphere.
Shader "Unlit/StereographicProjectionBubble"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_PanSpeed ("Pan Speed", Float) = 0.1
_Spherify ("Spherify", Range(0,1)) = 1
}
SubShader
{
@unitycoder
unitycoder / BlurImage.shader
Created November 15, 2022 20:12 — forked from nilpunch/BlurImage.shader
Blur for UI elements. Compatible with Built in RP, HDRP, URP and SRP.
Shader "UI/BlurImage"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
[Space(50)]
_BlurX ("X Blur", Range(0.0, 0.5)) = 0.001
_BlurY ("Y Blur", Range(0.0, 0.5)) = 0.001
@unitycoder
unitycoder / Worlds.cs
Created November 12, 2022 20:53 — forked from andrew-raphael-lukasik/Worlds.cs
(dots) code for world serialization and deserialization
// src: https://gist.github.com/andrew-raphael-lukasik/66d898be737734f26e607e6526d22901
using IO = System.IO;
using UnityEngine;
using Unity.Entities;
using Unity.Scenes;
using Unity.Entities.Serialization;
public static class Worlds
{
Shader "Name" {
Properties {
_Name ("display name", Range (min, max)) = number
_Name ("display name", Float) = number
_Name ("display name", Int) = number
_Name ("display name", Color) = (number,number,number,number)
_Name ("display name", Vector) = (number,number,number,number)
@unitycoder
unitycoder / MonoExtensions.cs
Created October 26, 2022 13:04 — forked from mstfmrt07/MonoExtensions.cs
A simple C# extension to easily create WaitForSeconds coroutines
using System.Collections;
using UnityEngine;
using UnityEngine.Events;
public static class MonoExtensions
{
public static Coroutine Wait(this MonoBehaviour mono, float delay, UnityAction action)
{
return mono.StartCoroutine(ExecuteAction(delay, action));
}
@unitycoder
unitycoder / HowToProfilerBuildTime.txt
Created October 9, 2022 11:42 — forked from phi-lira/HowToProfilerBuildTime.txt
How to profile build time for a Unity project
1) Enable Profiler in OnPreprocessBuild like following:
public void OnPreprocessBuild(BuildReport report)
{
Profiler.enabled = true;
Profiler.enableBinaryLog = true;
Profiler.logFile = "profilerlog.raw";
Debug.Log("Enabling Profiler");
}
2) Disable Profiler in OnPostProcessBuild
3) Now put Profiler.Begin/EndSample in the desired code.
@unitycoder
unitycoder / unity3d-assetstore-publisher-feed.php
Created October 3, 2022 11:00 — forked from jgraup/unity3d-assetstore-publisher-feed.php
PHP - Unity3D Asset Store Publisher Feed. You must supply your own secret key to use this, a key is generated per publisher at https://publisher.assetstore.unity3d.com/info.html
<?php
include_once ( 'unity3d-assetstore.php' );
// Doesn't matter what is used for the publisher name,
// the key still points to only one publisher.
$authArray = array (
'publisher' => '{PUBLISHER_NAME}'
'key' => '{PUBLISHER_KEY}',
);
@unitycoder
unitycoder / MakeGeometryDoubleSided.cs
Created September 22, 2022 10:53 — forked from kurtdekker/MakeGeometryDoubleSided.cs
Makes geometry double-sided by re-winding copies of each triangle to face the other way
using UnityEngine;
// @kurtdekker - quick double-siding mechanism.
//
// Place or add this Component to things with at
// least a MeshFilter on them.
//
// Presently only for single-submesh geometry.
[RequireComponent( typeof( MeshFilter))]