Skip to content

Instantly share code, notes, and snippets.

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

mika unitycoder

✅
‏‏‎
View GitHub Profile
@unitycoder
unitycoder / targa.txt
Created September 6, 2017 06:48
Unity Targa Files
24bit targa if no alpha,
32bit targa if have alpha
@unitycoder
unitycoder / unity-errors.txt
Last active May 27, 2022 08:41
Unity Errors
> Type '[UnityEngine.UI]UnityEngine.UI.InputField' has an extra field 'm_OnEndEdit' of type 'UnityEngine.UI.InputField+EndEditEvent' in the player and thus can't be serialized (expected 'm_OnValueChanged' of type
reimport project? update textmesh pro?
ERROR: "Assertion failed on expression: 'continueWhenFinished == NULL'"
CAUSE: StopAllCoroutines();
SOLUTION: ? for now, disable stopall..
@unitycoder
unitycoder / great-circle.cs
Created August 25, 2017 07:39
Fake Great Circle Arc (Path from Point to Point in Sphere Surface)
var x0 = new Vector3(0, 0, 0);
var start = player.gazeray.GetPoint(15);
var end = new Vector3(0, 0, -15);
Debug.DrawLine(start, end, Color.yellow);
// fake great circle path
float steps = 8;
for (int i = 0; i < steps; i++)
@unitycoder
unitycoder / unity-recompile-file-added.txt
Created August 17, 2017 04:15
Adding ,json or .txt file to project causes it to recompile
but no recompile on .bin
@unitycoder
unitycoder / optimization-tips-snippets.txt
Last active August 17, 2024 10:29
Optimization Tips c# Unity
access internal classes, by making your assemble definition named as:
Unity.InternalAPIEditorBridgeDev.001
Unity.InternalAPIEditorBridgeDev.002..
Get full internal access without reflection to any Unity package. Create an assembly reference file and point it to the assembly you want internal access to, now add your scripts into the same folder. The scripts will be compiled as part of the target assembly!
https://twitter.com/KarlJamesJones/status/1523992385071501313
textmeshpro not working, missing files, reinstall doesnt help
- check if some package has TMPRO included, remove that first, then install full TMPRO
@unitycoder
unitycoder / OpenVR-settings.md
Created July 14, 2017 15:32
OpenVR with Vive, manually edit Project Player Settings
@unitycoder
unitycoder / UnityDocsCopyScript.js
Last active May 20, 2021 12:19
UnityDocsCopyScript (GreaseMonkey)
// ==UserScript==
// @name UnityDocsCopyScript
// @namespace https://unitycoder.com
// @description Adds copy-button to unity Docs script examples > https://unitycoder.com/blog/2017/07/13/browser-plugin-add-copy-button-to-unity-scripting-docs/
// @include https://docs.unity3d.com/ScriptReference/*
// @include https://forum.unity3d.com/threads/*
// @include https://forum.unity.com/threads/*
// @version 3
// @grant none
// ==/UserScript==
@unitycoder
unitycoder / Internal Unity Stuff.txt
Last active July 12, 2017 09:30
Internal Unity Stuff Interesting
https://github.com/MattRix/UnityDecompiled/blob/82e03c823811032fd970ffc9a75246e95c626502/UnityEditor/UnityEditorInternal/InternalEditorUtility.cs
public static Color[] ReadScreenPixel(Vector2 pixelPos, int sizex, int sizey)
{
return InternalEditorUtility.INTERNAL_CALL_ReadScreenPixel(ref pixelPos, sizex, sizey);
}
internal class RenderThumbnailUtility
https://github.com/MattRix/UnityDecompiled/blob/753fde37d331b2100f93cc5f9eb343f1dcff5eee/UnityEditor/UnityEditor/RenderThumbnailUtility.cs
@unitycoder
unitycoder / xcopy-backup-drive.txt
Created June 25, 2017 06:22
XCopy Whole Driver To Another
xcopy d: x: /c/h/e/r/k/y/s
http://mintywhite.com/windows-7/7maintenance/transfer-entire-drives-directories-large-files-xcopy/