Skip to content

Instantly share code, notes, and snippets.

View gekidoslair's full-sized avatar

Mike Wuetherick gekidoslair

View GitHub Profile
@gekidoslair
gekidoslair / UnityGuidRegenerator.cs
Created January 11, 2017 04:50 — forked from ZimM-LostPolygon/UnityGuidRegenerator.cs
Unity asset GUIDs regenerator
// Drop into Assets/Editor, use "Tools/Regenerate asset GUIDs"
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using UnityEditor;
namespace UnityGuidRegenerator {
public class UnityGuidRegeneratorMenu {
using UnityEngine;
using System.Collections;
public class RoamBetweenPoints : MonoBehaviour {
public Transform[] targets;
public LayerMask groundLayer;
private Transform target;
private NavMeshAgent agent;
///
/// Simple pooling for Unity.
/// Author: Martin "quill18" Glaude (quill18@quill18.com)
/// Latest Version: https://gist.github.com/quill18/5a7cfffae68892621267
/// License: CC0 (http://creativecommons.org/publicdomain/zero/1.0/)
/// UPDATES:
/// 2015-04-16: Changed Pool to use a Stack generic.
///
/// Usage:
///
@gekidoslair
gekidoslair / TriggerEditor.cs
Created November 25, 2017 21:03 — forked from bzgeb/TriggerEditor.cs
Template for Custom Inspector Script in Unity3d
using UnityEngine;
using UnityEditor;
[CustomEditor (typeof(Trigger))]
[CanEditMultipleObjects()]
public class TriggerEditor : Editor
{
private SerializedObject obj;
private SerializedProperty radius;
@gekidoslair
gekidoslair / ConsoleCallStackHelper.cs
Created May 28, 2018 19:09 — forked from sabresaurus/ConsoleCallStackHelper.cs
Jump to file/line in the Unity console window callstack via this helper window
// MIT License
//
// Copyright (c) 2018 Sabresaurus
//
// 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:
@gekidoslair
gekidoslair / UsingJsonDotNetInUnity.cs
Created April 15, 2019 02:15 — forked from onionmk2/UsingJsonDotNetInUnity.cs
Json.Net ( Newtonsoft.Json ) in Unity
using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
using UnityEngine;
public class UsingJsonDotNetInUnity : MonoBehaviour
{
private void Awake()
{
@gekidoslair
gekidoslair / photon-pun-cheatsheet.md
Created July 3, 2020 17:51 — forked from ssshake/isWrit
Photon PUN Cheat Sheet

Photon Methods

public class Blank : Photon.PunBehaviour

instead of mono behavior, use this to receive photon callbacks in your script.

public override void OnLeftRoom()

An example of overriding a punbehavior callback

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
/// <summary>
/// A simple free camera to be added to a Unity game object.
///
/// Keys:
@gekidoslair
gekidoslair / SetShadowQuality.cs
Last active March 10, 2021 06:05 — forked from Nobuyuki-Kobayashi/SetShadowQuality.cs
Configure Unity's built in Shadow Settings from script at runtime QualitySettings.shadowCascade4Split
//
// QualitySettings/Shadows内のShadow Distance/Shadow Cascades/Cascade splitsをシーンから設定する.
//
//
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace UnityChan
{
PHP script that uses Unity Publisher API for PHP (https://github.com/LostPolygon/Unity-Publisher-API-PHP) to retrieve new asset sales, put them into a MySQL database, and notify about the sales via e-mail.
Data is inserted into `sales` table, which can be created from sales_table.sql file. Just set up the credentials and put this script on cron with whatever interval you want. Delete the email notification part if you don't need it.
Requires PHP 5.4, php_json extension, and remote socket access.
Also, I know it's ugly, but it does the job and served me well for over a year.