Skip to content

Instantly share code, notes, and snippets.

View SGTMcClain's full-sized avatar
🎯
Focusing

Nathan McClain SGTMcClain

🎯
Focusing
View GitHub Profile
@SGTMcClain
SGTMcClain / StartGame.cs
Created December 12, 2020 22:43
For use with buttons in unity to start and scenes
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class StartGame : MonoBehaviour
{
public Button startButton;
public Button mainMenuButton;
@SGTMcClain
SGTMcClain / .gitignore
Created October 8, 2020 03:53
Unity3D .gitignore
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
@SGTMcClain
SGTMcClain / .gitattributes
Last active October 8, 2020 03:52
Unity3D .gitattributes
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
@SGTMcClain
SGTMcClain / Jenkinsfile
Last active May 16, 2024 02:03
Find Jenkins Build cause
#!/usr/bin/env groovy
import hudson.model.*
import hudson.EnvVars
import groovy.json.JsonSlurperClassic
import groovy.json.JsonBuilder
import groovy.json.JsonOutput
import java.net.URL
@SGTMcClain
SGTMcClain / PlayerMovement.cs
Created April 2, 2020 00:36
My Movement script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
[SerializeField]
private float speed = 5;
private Rigidbody2D rbody2D;
@SGTMcClain
SGTMcClain / FlyCamera.cs
Created March 21, 2019 13:56 — forked from RyanBreaker/FlyCamera.cs
Unity Script to give camera WASD + mouse control
using UnityEngine;
using System.Collections;
public class FlyCamera : MonoBehaviour
{
/*
Writen by Windexglow 11-13-10. Use it, edit it, steal it I don't care.
Converted to C# 27-02-13 - no credit wanted.
Reformatted and cleaned by Ryan Breaker 23-6-18
@SGTMcClain
SGTMcClain / income_tax_v2.php
Created February 17, 2019 21:36
income_tax_v2.php
<?php
define('TAX_BRACKETS', array(10, 15, 25, 28, 33, 35, 39.6));
define('SINGLE_RANGES', array(0, 9275, 37650, 91150, 190150, 413350, 415050));
define('JOINT_RANGES', array(0, 18550, 75300, 151900, 231450, 413350, 466950));
define('SEPERATE_RANGES', array(0, 9275, 37650, 75950, 115725, 206675, 233475));
define('HEAD_RANGES', array(0, 13250, 50400, 130150, 210800, 413350, 441000));
define('TAX_RATES',
array(
'Single' => array (
@SGTMcClain
SGTMcClain / BankingProcedure_Extra.cs
Created February 11, 2019 20:06
Unity Banking Procedure with I/O
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
using UnityEngine;
public class BankingProcedure_Extra : MonoBehaviour {
// setup global variables
public double initialDeposit = 5000;
@SGTMcClain
SGTMcClain / IOScript.cs
Created February 11, 2019 20:05
Unity Simple IO
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
public class IOScript : MonoBehaviour {
// Use this for initialization
void Start () {
StreamWriter writer = new StreamWriter("Files/MyFile.txt");
@SGTMcClain
SGTMcClain / Base64FolderToBinary.java
Created June 26, 2017 17:18
Taking a folder of base 64 files and converting them back to BLOBs
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.apache.tomcat.util.codec.binary.Base64;