Skip to content

Instantly share code, notes, and snippets.

View MatthewMaker's full-sized avatar

Matt "Trip" Maker MatthewMaker

View GitHub Profile
@tsubaki
tsubaki / JsonSplitSprite.cs
Last active March 21, 2021 22:16
Json(exported with texture packer) -> unity 2d Multiple sprite . (request minijson https://gist.github.com/darktable/1411710)
// --
// The MIT License
//
// Copyright (c) 2013 tatsuhiko yamamura
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
@AngryAnt
AngryAnt / ConstructorIsh.cs
Created October 16, 2013 20:56
For when you really want that one line for instantiation and initialisation.
class MyBehaviour : MonoBehaviour
{
public MyBehaviour Init (int some, float parameters)
{
//...
return this;
}
}
@bylatt
bylatt / optimize-ssd.md
Last active April 4, 2018 20:36 — forked from ummels/os-x-enable-trim.md
Optimize non-Apple SSDs on OS X.

Optimize non-Apple SSDs on OS X. (Run the following commands in the terminal.)

Enable TRIM support

Check IOAHCIBlockStorage version:

open /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/version.plist
#!/bin/bash
# We need the TAB character for SED (Mac OS X sed does not understand \t)
TAB="$(printf '\t')"
function abort {
echo "$(tput setaf 1)$1$(tput sgr0)"
exit 1
}
@AngryAnt
AngryAnt / TerriblyHackyLog.cs
Created August 7, 2013 18:04
Abusing reflection and the internal Unity player build error function to get stacktrace-less error logs. Not recommended for anything sane.
using UnityEngine;
using System.Reflection;
public class TerriblyHackyLog : MonoBehaviour
{
void Start ()
{
Log ("Aaaaarrrrgh!");
}
@michaelbartnett
michaelbartnett / LICENSE.txt
Last active October 17, 2022 10:29
Tuple implementation for use with Unity3d
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@N-Carter
N-Carter / .gitignore
Last active December 17, 2015 05:18
Unity .gitignore
Builds
Debugging Output
Screenshots
Source Material
Temp
*.csproj
*.pidb
*.sln
*.unityproj
*.userprefs
@N-Carter
N-Carter / Player.cs
Created May 10, 2013 08:51
Player script from Pacing, demonstrating multitouch.
using UnityEngine;
using System.Collections;
public class Player : MonoBehaviour
{
[SerializeField] protected Hint m_HintPrefab;
[SerializeField] protected Footfall m_FootfallPrefab;
[SerializeField] protected Material m_FootfallMaterial;
[SerializeField] protected EndlessTiles m_EndlessTiles;
[SerializeField] protected GUIText m_LivesText;
@N-Carter
N-Carter / SuperChaseCamera.cs
Created April 4, 2013 09:37
Chase camera that works in any orientation
using UnityEngine;
using System.Collections;
public class SuperChaseCamera : MonoBehaviour
{
public Transform m_Target;
public Vector3 m_TargetOffset = new Vector3(0.0f, 1.0f, 0.0f);
public Vector3 m_ChasingOffset = new Vector3(0.0f, 1.0f, -10.0f);
public Vector3 m_LeadingOffset = new Vector3(0.0f, 1.0f, 20.0f);
public float m_NormalisingFactor = 0.1f;
@capyvara
capyvara / gist:5230032
Last active May 18, 2018 19:25
Process the Unity generated Xcode project to allow dSYM generation on Release but keeping the distribution size the same, only tested in a clean generated project.
// Adjust dSYM generation
var xcodeProjectPath = Path.Combine(xcodeProjectDir, "Unity-iPhone.xcodeproj");
var pbxPath = Path.Combine(xcodeProjectPath, "project.pbxproj");
var sb = new System.Text.StringBuilder();
var xcodeProjectLines = File.ReadAllLines(pbxPath);
foreach (var line in xcodeProjectLines)
{
// Remove from OTHER_LDFLAGS