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 / AutoSave.cs
Created November 3, 2015 19:28
Auto Save the current open Unity 3D level every 30 seconds
/* Created by Chris Figueroa - @Kinifi
* Create a script called AutoSave.cs
*/
using UnityEngine;
using UnityEditor;
using System.Collections;
public class AutoSave : EditorWindow {
are they getting this error? UnityEditor.Scripting.Compilers.MicrosoftCSharpCompiler.FillNETCoreCompilerOptions (WSASDK wsaSDK, System.Collections.Generic.List`1 arguments, System.String& argsPrefix) (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/MicrosoftCSharpCompiler.cs:186)
UnityEditor.Scripting.Compilers.MicrosoftCSharpCompiler.StartCompiler () (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/MicrosoftCSharpCompiler.cs:303)
UnityEditor.Scripting.Compilers.ScriptCompilerBase.BeginCompiling () (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/ScriptCompilerBase.cs:47)
​[11:50]
Error building Player because scripts had compiler errors
public bool getBool(string key)
{
//make the key not case sensitive
key = lowerCaseValue(key);
//check if the key exists
if (m_GameData.ContainsKey(key))
{
bool returnedBool = (bool)m_GameData[key];
using UnityEngine;
using System.Collections;
using Steamworks;
public class SubmitToLeaderboard : MonoBehaviour {
//the enum to select
public Leaderboard mLeaderboardToSubmit;
// Default to Global Leaderboards.
private ELeaderboardDataRequest m_eRequestType = ELeaderboardDataRequest.k_ELeaderboardDataRequestGlobal;
using UnityEngine;
using System.Collections;
public class Movement : MonoBehaviour {
//the Axis of the joystick
private float horAxis, vertAxis;
//components
private Rigidbody _rigid;
@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
*
*/
@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 / 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 / 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 / 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" />