Skip to content

Instantly share code, notes, and snippets.

View samsheffield's full-sized avatar
🏠
Homing from work

Sam Sheffield samsheffield

🏠
Homing from work
View GitHub Profile
@Matthew-J-Spencer
Matthew-J-Spencer / Dragger.cs
Created January 25, 2021 13:23
A simple drag and drop script for Unity. Follow along: https://youtu.be/Tv82HIvKcZQ
using UnityEngine;
public class Dragger : MonoBehaviour {
private Vector3 _dragOffset;
private Camera _cam;
[SerializeField] private float _speed = 10;
void Awake() {
@didichanoch
didichanoch / sample-discord-coc.md
Last active May 19, 2023 17:23 — forked from annalee/sample-slack-coc.md
A sample code of conduct for discord servers.

[DISCORD SERVER] Code of Conduct

Welcome!

[BRIEF DESCRIPTION OF THE DISCORD SERVER AND ITS PURPOSE]

The current admins are:

  • [NAMES]
@Bradshaw
Bradshaw / VectorExtensions.cs
Last active February 8, 2020 10:50
Quickly convert between various Vector2s and Vector3s
using UnityEngine;
public static class VectorExtensions {
public static Vector2 xy(this Vector3 v3)
{
return new Vector2(v3.x, v3.y);
}
public static Vector2 xz(this Vector3 v3)
{
@unitycoder
unitycoder / UITextTypeWriter.cs
Last active April 11, 2024 08:11
Type out UI text one character at a time
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
// attach to UI Text component (with the full text already there)
public class UITextTypeWriter.cs : MonoBehaviour
{
Text txt;
///
/// Simple pooling for Unity.
/// Author: Martin "quill18" Glaude (quill18@quill18.com)
/// Latest Version: https://gist.github.com/quill18/5a7cfffae68892621267
/// License: CC0 (http://creativecommons.org/publicdomain/zero/1.0/)
/// UPDATES:
/// 2015-04-16: Changed Pool to use a Stack generic.
///
/// Usage:
///