Skip to content

Instantly share code, notes, and snippets.

View monry's full-sized avatar

Tetsuya Mori monry

View GitHub Profile
@monry
monry / monry.json
Last active July 30, 2022 13:46
Karabiner-Elements 用設定
{
"title": "Customized by @monry",
"rules": [
{
"description": "capslock キーを IME のトグルに割り当て",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "caps_lock",
@monry
monry / .npmignore
Created March 28, 2020 03:15
A .npmignore template that should be placed directly under Assets/ when developing a UPM-compatible package.
.npmignore
yarn-debug.log*
yarn-error.log*
Examples/
Examples.meta
Tests/
Tests.meta
using UnityEditor.AddressableAssets;
using UnityEditor.AddressableAssets.Settings;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
namespace PretendLand.Common.Editor
{
public class BuildAddressablesBeforeBuildPlayer : IPreprocessBuildWithReport
{
int IOrderedCallback.callbackOrder => 1;
@monry
monry / publish-upm-package.yml
Created February 19, 2020 05:51
GitHub Actions Workflow / Publish Unity Package to UPM Registry
name: Publish UPM Package
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
@monry
monry / ScenesInBuildConfigurator.cs
Last active February 12, 2020 13:48
Editor script to automatically add scenes to Scenes in Build
using System.Linq;
using UnityEditor;
namespace Foo
{
[InitializeOnLoad]
public static class ScenesInBuildConfigurator
{
private static string SceneName { get; } = "Bar";
@monry
monry / double_shift_unity_quick_search.json
Created September 6, 2019 02:12
左 Shift 二回で Quick Search を起動する
{
"title": "Launch Quick Search in Unity",
"rules": [
{
"description": "Double tap 'left_shift' to show Quick Search in Unity",
"manipulators": [
{
"type": "basic",
"from": { "key_code": "left_shift" },
"to": [
#!/bin/bash
mkdir -p scripts
curl -Lo scripts/first-aid-for-upm.sh https://gist.github.com/monry/9765f64ed0e73aed5d794c6ca6d2b389/raw/a3db343f841044d3d2bfd9988171c81689f1cb77/first-aid-for-upm.sh
chmod a+x scripts/first-aid-for-upm.sh
cat package.json | jq '.scripts.postinstall |= . + " && ./scripts/first-aid-for-upm.sh"' | jq -M . > package.json.tmp
mv package.json.tmp package.json
@monry
monry / first-aid-for-upm.sh
Last active August 28, 2019 07:09
First aid for Unity Package Manager for KidsStar
#!/bin/bash
cat package.json | jq -M 'del(.dependencies."@umm/unirx") | del(.dependencies."@umm/zenject")' | jq -M . > package.json.tmp
mv package.json.tmp package.json
rm -Rf Assets/Modules/umm@{unirx,zenject}
find Assets -name "*.asmdef" | xargs gsed -i 's/"umm@unirx"/"UniRx"/'
find Assets -name "*.asmdef" | xargs gsed -i 's/"umm@unirx-Async"/"UniRx.Async"/'
@monry
monry / SignalExtensions.cs
Last active July 9, 2019 08:02
Connect signal messages fired by SignalBus
using System;
using Zenject;
namespace ExtraZenject
{
public static class SignalExtensions
{
public static DeclareSignalIdRequireHandlerAsyncTickPriorityCopyBinder ConnectSignal<TFrom, TTo>(this DiContainer container) where TTo : new()
{
return container.ConnectSignal<TFrom, TTo>(_ => new TTo());
@monry
monry / upm
Created June 12, 2019 05:44
Command line interface for Unity Package Manager
#!/bin/bash