Skip to content

Instantly share code, notes, and snippets.

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

mika unitycoder

✅
‏‏‎
View GitHub Profile
@unitycoder
unitycoder / ScreenshotTool.cs
Created October 8, 2020 11:57
Screenshot Script (with timestamp)
if (Input.GetKeyDown(KeyCode.P))
{
// check screenshots folder
var outputFolder = Path.Combine(Application.dataPath, "Screenshots");
if (Directory.Exists(outputFolder) == false)
{
Directory.CreateDirectory(outputFolder);
}
DateTime foo = DateTime.UtcNow;
@unitycoder
unitycoder / GetRandomCharacters.cs
Created September 23, 2020 21:36
GetRandomCharacters
static Random random = new Random();
static readonly string chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 -";
static string GetRandomCharacters(int len)
{
string str = "";
for (int i = 0; i < len; i++)
{
str += chars[random.Next(len)];
}
@unitycoder
unitycoder / LookTowardsPlayerOneAxis.cs
Last active September 6, 2026 16:12
rotate towards player in one axis
using UnityEngine;
public class LookTowardsPlayerOneAxis : MonoBehaviour
{
public Transform target;
void LateUpdate()
{
// note Y position is set to current
Vector3 targetPos = new Vector3(target.position.x, transform.position.y, target.position.z);
// look away
transform.LookAt(2 * transform.position - targetPos);
@unitycoder
unitycoder / after-effects.md
Last active March 13, 2024 15:57
After Effects Notes

rotoscope remove bg

  • double click your video clip in timeline, it opens as layer, then can rotobrush there
@unitycoder
unitycoder / ascii.txt
Last active April 9, 2023 12:49
ascii art
▓▓▓▓▓▒▒▒▒▒░░░░░ YES ░░░░░▒▒▒▒▒▓▓▓▓▓
@unitycoder
unitycoder / UnityFeaturesHistory.md
Last active September 10, 2020 09:24
Unity Features History

Unity3D versions highlight

Unity 4

  • 2D. Added Sprite, SpriteRenderer, 2d Physics, 2d Mode button in scene view, Sprite packing
  • New UI system. New Rect Tools, New Animation Window.
  • Mecanim.
  • BlendShapes.
  • Culling rewritten. Much faster, Umbra has been optimized.
  • Image Effects Package.
@unitycoder
unitycoder / PlayerData.cs
Last active July 30, 2021 01:28
Unity JSON
// adjustable player values
public class PlayerData
{
public float speed;
public override string ToString()
{
return "speed: "+ speed;
}
@unitycoder
unitycoder / 3DTextShader.shader
Last active September 3, 2024 11:08
Old TextMesh component, Dont draw on top of all things
// http://answers.unity.com/answers/1211896/view.html
// Usage: Add Text Mesh, Add font to text mesh (important, so that you can see where the font texture atlas is)
// Assign this material-shader to textmesh, assign font atlas texture to material
Shader "GUI/3D Text Shader" {
Properties {
_MainTex ("Font Texture", 2D) = "white" {}
_Color ("Text Color", Color) = (1,1,1,1)
}
SubShader {
@unitycoder
unitycoder / UnwantedProcessTempTest.json
Last active August 24, 2020 16:31
UnwantedProcessTempTest.json
[
{
"Name": "OVRServer_x64",
"Exe": "OVRServer_x64.txt",
"DefaultPath": "",
"Description": "Oculus Desktop",
"Url": ""
},
{
"Name": "pageant",