Skip to content

Instantly share code, notes, and snippets.

View kinifi's full-sized avatar

Christopher Figueroa kinifi

  • Apple
  • Sunnyvale, California
View GitHub Profile
@kinifi
kinifi / BuildPostProcessor.cs
Created October 19, 2017 23:25
Adds iOS Frameworks to Xcode project (on each Unity build).
//
// http://www.twitter.com/kinifi
//
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
@kinifi
kinifi / gist:63422d27ecab470fd0c8d1001e592357
Created July 5, 2017 19:24
Always on Top Code for OSX in Swift
Swift 3.0
window.level = Int(CGWindowLevelForKey(.floatingWindow))
window.level = Int(CGWindowLevelForKey(.maximumWindow))
@kinifi
kinifi / playercontroller.cs
Created April 20, 2017 21:10
a 2D free movement playercontroller
/*
* playermovement.cs - attaches rigidbody onto gameobject in editor via RequireComponent, checks inputAxis via Input Axis Names (defaults to Horizontal, Vertical).
* Intention is to move a 2D sprite across the screen via Rigidbody2D
* All properties are private with defaults values. If you need to change a property use the methods to adjust them
* Note: This does not attach a collider or check colliders in anyway. That should be handled separately.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@kinifi
kinifi / gist:6b9f69edcc0e9c12831935afd9698e29
Created February 27, 2017 00:49
general method to run commands
private void RunScript(string scriptPath, string arguments)
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = Path.GetFullPath(scriptPath);
startInfo.UseShellExecute = true;
startInfo.CreateNoWindow = false;
if (!string.IsNullOrEmpty(arguments))
startInfo.Arguments = arguments;
@kinifi
kinifi / ignore.conf
Created January 18, 2017 02:52
a ignore file for your unity project on plasticscm
/SteamBuildUploader/ContentBuilder/content
/SteamBuildUploader/ContentBuilder/builder
/.vs
/Library/
/Temp/
/Obj/
/Build/
/Builds/
/Assets/AssetStoreTools*
@kinifi
kinifi / index.html
Created November 26, 2016 21:31
Minecraft Overviewer has a google API key error. Here is how to fix it
<!DOCTYPE html>
<html>
<head>
<title>{title}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Minecraft-Overviewer {version}" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
@kinifi
kinifi / ignore.conf
Created October 19, 2016 23:35
Plastic SCM Ignore for Unity 3D Projects
/SteamBuildUploader/ContentBuilder/content
/SteamBuildUploader/ContentBuilder/builder
/.vs
/Library/
/Temp/
/Obj/
/Build/
/Builds/
/Assets/AssetStoreTools*
@kinifi
kinifi / NewInspector.cs
Last active September 9, 2016 18:17
How to override an inspector and change how it looks in the Editor along with opening a Editor Extension
/*
* 1. Must be located in a "Editor" Folder in your Assets folder
* 2. Must have a script that is in the "typeof(SCRIPT HERE)" line that exists
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
@kinifi
kinifi / EditorExtensionWindow.cs
Created September 8, 2016 23:33
Boilerplate for creating a unity window extension. Must be located in a folder called "Editor"
/*
* Must be located in a folder called "Editor"
* Note: the %l is the shortcut for opening this window in unity. % = Alt/CMD button
*/
using UnityEngine;
using UnityEditor;
using System;
using System.IO;
using System.Collections;
@kinifi
kinifi / GameManager.cs
Last active September 2, 2019 02:24
This is the standard singleton I use for basic data in Unity games.
/*
* Game Manager
* This is how we will save our persistent data such as:
* Logged in save data from a json file and assigning variables which we access in game
* With this Singleton we can store data we need for later use
* Example on how to use: GameManager.Instance.[Variable Name / Method Name]
* Methods and Variables must be public
* Note: A new singleton should be created per platform for achievements string literals and specific achievement methods
*
*/