Skip to content

Instantly share code, notes, and snippets.

View n0mimono's full-sized avatar

Ryota Yokote n0mimono

View GitHub Profile
public struct UnityVersion
{
public int stream;
public int number;
public int minor;
public string phase;
public int revision;
public UnityVersion(string unityVersion)
{
@n0mimono
n0mimono / AppDelegate.swift
Last active October 23, 2020 05:28
Unity-as-a-Library Sample Code
import UIKit
import UnityFramework
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
func unityFramewokLoad() -> UnityFramework? {
let bundlePath = "\(Bundle.main.bundlePath)/Frameworks/UnityFramework.framework"
let bundle = Bundle(path: bundlePath)
if let bundle = bundle, !bundle.isLoaded {
@n0mimono
n0mimono / index.html
Created May 3, 2020 14:34
mini pubsub
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/style.css" type="text/css">
<title>---</title>
# ref: https://qiita.com/shippokun/items/9070fc58f69d8c063e44
# list
diskutil list
# erase data
diskutil unMountDisk /dev/disk2
#diskutil eraseDisk MS-DOS boot /dev/disk2
# burn image
@n0mimono
n0mimono / NumberingAssetRenamer.cs
Last active November 12, 2019 09:53
ゲーム開発中とかによくあるファイル名が連番としてアセットをいい感じに一括リネームしたいときに役立つやつ
using System;
using System.Linq;
using System.IO;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
@n0mimono
n0mimono / 00_AnimationProcessor.md
Last active April 15, 2019 13:05 — forked from keijiro/00_AnimationProcessor.md
[Unity] アニメーションのインポート設定を自動化する

アニメーションのインポート設定を自動化する

Unity のアニメーションのインポート設定(下画像)には様々な項目がありますが、これを手動でひとつひとつ設定していくのは、かなりしんどいです。お決まりの設定がある場合には、スクリプトで自動化してしまうのがよいでしょう。この文書では、その自動化の方法を紹介します。

Animation Clip Settings

スクリプトからオプションを変更する

これらのインポート設定は ModelImporter.clipAnimationsModelImporterClipAnimation の配列として格納されています。これを舐める形で変更していけば、一括でお好みの設定を適用できます。

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Copy Link P</title>
<link rel="stylesheet" type="text/css" href="../styles/popup.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/css/materialize.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/js/materialize.min.js"></script>
import * as React from 'react'
import { Dispatch } from 'redux'
import { connect } from 'react-redux'
import { AppState, history } from '../store'
import * as Common from '../modules/common'
const Menu: React.SFC<Common.PageProps> = (props) => {
let key = Common.PathIndeces.indexOf(props.path)
@n0mimono
n0mimono / Home.tsx
Last active June 9, 2018 15:00
Example: React + Redux + Router + TypeScript
import * as React from 'react'
import { Dispatch } from 'redux'
import { connect } from 'react-redux'
import { AppState } from '../store'
import * as Home from '../modules/home'
// container component
type Props = Home.State & Home.Actions
@n0mimono
n0mimono / YtlClient.cs
Created February 12, 2018 06:22
Unity script example for YouTube Live Streaming
using System.Collections;
using System.Collections.Generic;
using System;
using UnityEngine;
using UnityEngine.Networking;
using SimpleJSON;
namespace YouTubeLive {
public class Chat {
public class Msg {