Skip to content

Instantly share code, notes, and snippets.

@atesija
atesija / coroutine.snippet
Last active October 16, 2017 00:43
Some useful Visual Studio snippets for Unity
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>coroutine</Title>
<Shortcut>co</Shortcut>
<Description>Code snippet for Unity coroutine function</Description>
<Author>Anthony Tesija</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
@atesija
atesija / FPSDisplay.cs
Created January 8, 2017 19:01
A modified version of Dave Hampson's FPSDisplay found here http://wiki.unity3d.com/index.php/FramesPerSecond. This version lets you change the color and size of text from the inspector.
using UnityEngine;
using System.Collections;
public class FPSDisplay : MonoBehaviour
{
public Color _textColor;
[Tooltip("This is the ratio to the height of the screen that the fps coutner will take up")]
[Range(0.0f, 0.2f)]
public float _fontSize = 0.1f;
@atesija
atesija / ScreenshotUtility.cs
Last active July 14, 2020 08:53
Simple Unity screenshot on timer script
using UnityEngine;
using System.Collections;
public class ScreenshotUtility : MonoBehaviour
{
[Tooltip("The filepath to the save location for the screenshots")]
public string _filepath;
[Tooltip("Scales the image by the amount specified (0 for no scaling)")]
public int _screenshotResolutionScaleFactor = 0;