Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
public class VRCCamController : MonoBehaviour
{
[SerializeField]
private Sprite sprite;
[SerializeField]
[Range(.1f, 10f)]
@kmnk
kmnk / SampleBehaviour.cs
Created January 5, 2018 11:09
TwitterKit for Unity API test
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
public class SampleBehaviour : MonoBehaviour
{
using UnityEngine;
using System;
using UniRx;
using Zenject;
public class TapCounterInstaller : MonoInstaller<TapCounterInstaller>
{
public override void InstallBindings()
{
// TapCounterInstaller.cs
using UnityEngine;
using System;
using UniRx;
using Zenject;
public class TapCounterInstaller : MonoInstaller<TapCounterInstaller>
{
public override void InstallBindings()
@kmnk
kmnk / brook.part.js
Created December 11, 2012 08:10
brook.part.js (has no htmltemplate namespace)
Namespace('brook').define(function(ns){
var VERSION = "0.01";
var Promise = function(next){
this.next = next || function(next,val){ return next(val); };
};
(function(proto){
proto.concat = function(after){
var _before = this;
var next = function(n,val){
return _before.subscribe( after.ready(n),val);
@kmnk
kmnk / brook.js
Created December 11, 2012 08:08
brook.js by CoffeeScript
var __indexOf = Array.prototype.indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
Namespace('brook').define(function(ns) {
var Promise, VERSION, promise;
VERSION = '0.01';
Promise = (function() {
function Promise(next) {
this.next = next || function(next, val) {
return next(val);
@kmnk
kmnk / brook.coffee
Created December 11, 2012 08:07
brook.coffee
Namespace('brook')
.define (ns) ->
VERSION = '0.01'
class Promise
constructor : (next) ->
@next = next or (next, val) -> next(val)
concat : (after) ->
_before = @
@kmnk
kmnk / namespace.js
Created December 11, 2012 05:03
namespace.js by CoffeeScript
var Namespace;
Namespace = (function() {
var NamespaceDefinition, NamespaceObject, NamespaceObjectFactory, Procedure, createNamespace, createProcedure, merge, _assertValidFQN;
merge = function(target, source) {
var key, val;
for (key in source) {
val = source[key];
target[key] = val;
}
@kmnk
kmnk / namespace.coffee
Created December 11, 2012 05:02
namespace.coffee
Namespace = ( ->
merge = (target, source) ->
for key, val of source
if source.hasOwnProperty key then target[key] = val
target
_assertValidFQN = (fqn) ->
unless ///^[a-z0-9_.]+///.test fqn then throw 'invalid namespace'
class Procedure
@kmnk
kmnk / compiledsample.js
Created December 9, 2012 17:36
Compiled Sample CoffeeScript
Namespace('sample.widget').use('sample.rect.ui createRectModel').define(function(ns) {
var registerElement;
registerElement = function(element, dataset) {
var rectModel;
rectModel = ns.createRectModel(element, dataset.classOn, dataset.classOff);
return element.addEventListener('click', function(event) {
rectModel.notify('toggle').run();
return rectModel.notify('move').run();
});
};