Skip to content

Instantly share code, notes, and snippets.

View samizzo's full-sized avatar

Sam Izzo / bananaboy samizzo

View GitHub Profile
@samizzo
samizzo / asset-sale.js
Created November 17, 2019 11:14 — forked from LeLocTai/asset-sale.js
For use in Unity Asset Store sale page dev console
(async function get() {
const publisher_id = 20835;
const period = 48; //months
function nextMon(current) {
let mon = --current[1];
let year = current[0];
if (mon < 1) {
year--;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class ReadOnlyAttribute : PropertyAttribute
{
}
#if UNITY_EDITOR
@samizzo
samizzo / LevelEditor.cs
Last active September 25, 2018 12:12
DrawLevel and ProcessMouse code
private void DrawLevel()
{
var selectedChords = m_selectedLevel.GetChords(m_selectedX, m_selectedY);
EditorGUILayout.BeginVertical(GUILayout.Width(24));
for (var y = 0; y < LevelData.Y_SIZE; y++)
{
EditorGUILayout.BeginHorizontal();
for (var x = 0; x < LevelData.X_SIZE; x++)
{
@samizzo
samizzo / VisualStudioProjectCustomisation.cs
Last active August 9, 2018 01:53
A small class to add JSON files to the Visual Studio project that Unity auto-generates.
#if ENABLE_VSTU
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using UnityEditor;
using SyntaxTree.VisualStudio.Unity.Bridge;
@samizzo
samizzo / StandaloneInputModuleEx.cs
Last active June 13, 2018 12:04
A StandaloneInputModule that only shows the mouse cursor if the mouse is active.
using UnityEngine;
using UnityEngine.EventSystems;
/// <summary>
/// A StandaloneInputModule replacement that only shows the mouse cursor if the mouse is active.
/// If keyboard or controller input is detected, the cursor is disabled. If mouse input is
/// detected, the cursor is enabled.
///
/// This also has an optional setting to disable clearing the input focus when clicking on
/// an empty part of the screen.
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System;
using System.IO;
public static class CopyFilesBuildPostProcessor
{
private const string PathToCopy = "PathToFiles";
[PostProcessBuild]
public static void OnPostProcessBuild(BuildTarget buildTarget, string pathToBuildProject)
{
if (buildTarget != BuildTarget.iOS)
return;
StripMethods(pathToBuiltProject);
}
private static string[] s_stripList =
#define BINKGL_LIST \
/* ret, name, params */ \
GLE(void, LinkProgram, GLuint program) \
GLE(void, GetProgramiv, GLuint program, GLenum pname, GLint *params) \
GLE(GLuint, CreateShader, GLenum type) \
GLE(void, ShaderSource, GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length) \
GLE(void, CompileShader, GLuint shader) \
GLE(void, GetShaderiv, GLuint shader, GLenum pname, GLint *params) \
GLE(void, GetShaderInfoLog, GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog) \
GLE(void, DeleteShader, GLuint shader) \