Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
✅
‏‏‎

mika unitycoder

✅
‏‏‎
View GitHub Profile
@unitycoder
unitycoder / applesucks.md
Created October 11, 2021 07:21
Apple ID Reset Security Questions: We don't have enough information to reset your security questions

If you forgot your security questions, and account gets locked (after too many failed logins)

Contact Apple Support

  • They wont help, unless your id is logged into some device
  • Only help you get is that "Good thing is that every 24hrs you can try to guess your security questions again!"

Do it YourSelf

  • Login into that account using iphone/ipad, it wont ask security questions!
  • Then try to login again on website, it will send 2FA code to that phone where you just logged in!
  • Bam!
@unitycoder
unitycoder / CrossSectionArea.cs
Created October 13, 2021 05:13
How do I get the cross sectional surface area of my geometry mesh in meters
// https://forum.unity.com/threads/how-do-i-get-the-cross-sectional-surface-area-of-my-geometry-mesh-in-meters.461278/#post-7567135
private static Dictionary<GameObject, Vector3[]> vertecesDict = new Dictionary<GameObject, Vector3[]>();
 
    public static float CrossSectionArea(GameObject g, Vector3 normal)
    {
     
        Vector3[] verteces;
        if (!vertecesDict.TryGetValue(g, out verteces))
        {
            MeshFilter[] meshes = g.GetComponentsInChildren<MeshFilter>();
@unitycoder
unitycoder / GetTTS.cs
Last active October 14, 2021 05:37
TTS google download audioclip
// https://forum.unity.com/threads/need-text-to-speech-help.867853/
// https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=en&q=
public IEnumerator GetTTS()
{
Debug.Log(TSSwords);
// Remove the "spaces" in excess
Regex rgx = new Regex ("\\s+");
// Replace the "spaces" with "% 20" for the link Can be interpreted
result = rgx.Replace (ITCwords, "%20");
Debug.Log(result);                            
@unitycoder
unitycoder / Billboard Y Rotation Only.shader
Created October 16, 2021 19:48
Cylindrical Billboard Shader - Shader for Billboard with Rotation Restricted to the Y Axis
// https://forum.unity.com/threads/cylindrical-billboard-shader-shader-for-billboard-with-rotation-restricted-to-the-y-axis.498406/
// Source: https://en.wikibooks.org/wiki/Cg_Programming/Unity/Billboards
// Source: http://www.unity3d-france.com/unity/phpBB3/viewtopic.php?t=12304
Shader "Custom/Billboard Y Rotation Only"
{
    Properties
    {
        _MainTex ("Texture Image", 2D) = "white" {}
        _ScaleX ("Scale X", Float) = 1.0
        _ScaleY ("Scale Y", Float) = 1.0
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 / shaderBasicsCheatSheet.shader
Created October 17, 2021 19:27 — forked from enesser/shaderBasicsCheatSheet.shader
Shader Basics Cheat Sheet (Unity)
// *****************
// Types of Shaders:
// * Surface Shader:
// lit shaders that affect lighting of an object
// * Unlit Shader:
// vertex and fragment shader, control vertex properties
// * Image Effect Shader:
@unitycoder
unitycoder / cheatsheet.shader
Created October 17, 2021 19:27 — forked from lonewolfwilliams/cheatsheet.shader
A cheatsheet and or boilerplate for CG / shaderlab in Unity
Shader "Unlit/ScreenFade"
{
Properties
{
//https://docs.unity3d.com/Manual/SL-Properties.html
//[HideInInspector]
//[NoScaleOffset]
//[Normal]
//[HDR]
//[Gamma]
@unitycoder
unitycoder / Unity Fragment Shader Cheat Sheet .cs
Created October 17, 2021 19:27 — forked from quizcanners/Unity Fragment Shader Cheat Sheet .cs
To keep snippets of code for Shaders. Just some stuff that I often use but also often forget because brain=poo
//https://docs.unity3d.com/Manual/SL-UnityShaderVariables.html
//https://github.com/TwoTailsGames/Unity-Built-in-Shaders/blob/master/CGIncludes/UnityCG.cginc - Most interesting stuff ;)
//https://github.com/TwoTailsGames/Unity-Built-in-Shaders/tree/master/CGIncludes
//https://docs.unity3d.com/Manual/SL-Shader.html
//http://developer.download.nvidia.com/CgTutorial/cg_tutorial_appendix_e.html
//https://unity3d.com/how-to/shader-profiling-and-optimization-tips
//https://docs.unity3d.com/Manual/SL-UnityShaderVariables.html
//http://www.deepskycolors.com/archive/2010/04/21/formulas-for-Photoshop-blending-modes.html
//http://www.iquilezles.org/blog/
//https://www.youtube.com/channel/UCcAlTqd9zID6aNX3TzwxJXg
@unitycoder
unitycoder / FeatheredPlaneShader.cs
Created October 18, 2021 09:03
AR Foundation Samples with Offset (to not z fight with regular AR planes)
// https://forum.unity.com/threads/ar-occlusion-environment-arplane-flickering-how-to-fix-it.1006303/#post-6531179
Shader "Unlit/FeatheredPlaneShader"
{
    Properties
    {
        _MainTex ("Texture", 2D) = "white" {}
        _TexTintColor("Texture Tint Color", Color) = (1,1,1,1)
        _PlaneColor("Plane Color", Color) = (1,1,1,1)
    }
    SubShader
@unitycoder
unitycoder / Shader paint
Created October 18, 2021 10:42 — forked from eXponenta/Shader paint
Unity Shader for Drawing on RenderTexture with Brush texture
Shader "Region28/MaskedPaint"
{
Properties
{
_MainTex ("Main Texture", 2D) = "white" {}
//_Mask("Mask Texture", 2D) = "white" {}
_Brush("Brush Texture", 2D) = "white" {}
[HideInInspector]_BrushPos("Mask Position", Vector) = (0.5,0.5,0.0,0.0)
_BrushSize("Mask Size", Range(0, 10)) = 1.0
_BrushRotation("Rotation", Range(0, 360)) = 0