Skip to content

Instantly share code, notes, and snippets.

@nin-jat
nin-jat / ConsoleManager.cs
Last active April 8, 2016 09:38
Unity Custom Console
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.Collections.Generic;
// This script can easily be modified to work as a chat box.
// Created by Tom Parker A.K.A. Those45Ninjas.
//
// It works by keeping track of each 'line' in a list. Then remove a few
// lines from the list if there are too many lines. After every Update
@nin-jat
nin-jat / TileCoord.cs
Last active July 5, 2016 09:01
A TileCoord struct similar to a Vector2 but using integers instead. it's quite useful code for tile based projects and should be easy to adopt for your projects.
// This script was written by Tom Parker.
// I created it for one project and ever since I have used this
// script in every game that uses a tile system of any kind.
// I found it so useful that I decided that you might like it.
// Please feel free to fork it, Make it better or improve it.
// If you use it in a project I would love to hear about it.
// tom.parker1235@gmail.com, Twitter: @Those45Ninjas
using System;
using UnityEngine;
using System.Collections.Generic;
using System;
public class HandheldItem : MonoBehaviour
{
internal SteamVR_TrackedController controller;
internal float pickupRadius;
public bool Highlighted = false;

The code behind This unity inspector.

Sorry for the missing comments, I'll add them later Ha, lol, that's not going to happen

Song: Like It's Over by Jia Wolf.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
public enum Direction { Up, Front, Right, Back, Left, Down };
[Serializable]
public struct VoxPos: IEquatable<VoxPos>, IEqualityComparer<VoxPos> {
rem iterate over each mkv file in the mkv subdirectory
rem and run the ffmpeg command to convert it.
for %%f in (mkv\*.mkv) do (
ffmpeg -n -i mkv\%%~nf.mkv %%~nf.mp4
)
pause
@nin-jat
nin-jat / record.bat
Last active January 6, 2018 04:00
Desktop time lapses without dealing with thousands of images or ridiculously large files.
@echo off
rem This simple batch script will record your desktop at 4 frames every second
rem and stuff it into a 60 fps video.
rem Essentially, desktop time lapses without dealing with thousands of images
rem or ridiculously large files.
rem You will have to modify this script if you don't have a 1440p display as
rem your primary display.
/*
Original author: Christopher Mark Jones
https://www.cjonesdev.com/blog/unity-blender-and-instancing-models
Slightly modified by me, works with unity 2018.2
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
@nin-jat
nin-jat / ControllerMenu.cs
Created January 10, 2019 12:51
vive radial menus
// Created by Tom Parker (Those45Ninjas).
// This code was used in https://www.youtube.com/watch?v=n7lzkyXVxJ8
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.Events;
using UnityEngine.UI;
public class ControllerMenu : MonoBehaviour
{
@nin-jat
nin-jat / Cat.cs
Last active November 16, 2022 20:14
This shows a cat in your console.
/// <summary>
/// This program draws a cute cat on your console.
/// View more at the gist over here.
/// https://gist.github.com/Those45Ninjas/7a18755b07aff61c4f37c1c27de449c6
///
/// This cute cat was sourced from textart4u.
/// http://textart4u.blogspot.com/2013/02/cute-cat-face-ascii-text-art.html
///
/// Code written by Those45Ninjas
/// </summary>