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 / Hilbert.cs
Created November 26, 2022 17:54
Unity Draw Hilbert Curve
// https://youtu.be/hPXJN4PkB28
using System.Collections;
using UnityEngine;
public class Hilbert : MonoBehaviour
{
int order = 5;
int N;
int width = 64;
@unitycoder
unitycoder / Online Courses.md
Created November 26, 2022 13:19
Online Courses Learning Tutorials Paid Premium
@unitycoder
unitycoder / Mirror.md
Last active January 18, 2023 09:38
Mirror Networking Unity Notes

Spawn scene object not found for xxx. Make sure that client and server use exactly the same project. This only happens if the hierarchy gets out of sync. , Could not spawn assetId=xxx scene=xxx netId=1

Check that server and client have same builds and same hierarchy??

Get list of users

Command Function System.Void asdf.Vehicle::Cmdchangeowner(Mirror.NetworkIdentity) called on AsdfVehicle without authority.

  • can use [Command(requiresAuthority=false)
@unitycoder
unitycoder / InverseTransformPoint.cs
Created November 23, 2022 19:49
Unity InverseTransformPoint From Another Thread
// https://forum.unity.com/threads/transform-inversetransformpoint-without-transform.954939/#post-6224040
public static Vector3 InverseTransformPoint(Vector3 transformPos, Quaternion transformRotation, Vector3 transformScale, Vector3 point)
{
Matrix4x4 matrix = Matrix4x4.TRS(transformPos, transformRotation, transformScale);
Matrix4x4 inverse = matrix.inverse;
return inverse.MultiplyPoint3x4(point);
//return inverse.MultiplyPoint(pos);
}
@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 / DetectImageShapes.cs
Created November 18, 2022 21:56
DetectImageShapes from Texture
// https://answers.unity.com/questions/1295599/order-points-from-array-based-on-8-connectivity-mo.html
using UnityEngine;
using System.Collections.Generic;
namespace B83.UA.ImageTools
{
public class DetectImageShapes : MonoBehaviour
{
public Texture2D texture;
@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 / AlphaBlendDepthOffset.shader
Created November 16, 2022 19:43
Particles AlphaBlendDepthOffset shader
// https://twitter.com/flogelz/status/1568539823643791360
Shader "Particles/AlphaBlendDepthOffset"
{
Properties
{
_TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
_MainTex ("Particle Texture", 2D) = "white" {}
_HeightTex ("Height Texture", 2D) = "white" {}
_InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0
_DepthOffset ("Depth Offset", Range(0,1)) = 0.0
@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