Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/11320156 to your computer and use it in GitHub Desktop.
Save tsubaki/11320156 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
public class InputTest : MonoBehaviour
{
void Update()
{
if( Input.GetKeyDown(KeyCode.LeftArrow) )
{
GetComponent<Handler>().param.Value += 1;
}
}
}
#pragma strict
function Start () {
var handle : Handler = GetComponent(Handler);
ChangeParam(handle.param.Value);
handle.param.action += ChangeParam;
}
function OnDestroy()
{
var handle : Handler = GetComponent(Handler);
handle.param.action -= ChangeParam;
}
function ChangeParam( t : int)
{
Debug.Log("js:" + t);
}
using UnityEngine;
using System.Collections;
// Pluginsフォルダに配置
public class Handler : MonoBehaviour {
public NotificationObject<int> param = new NotificationObject<int>(0);
void OnDestroy()
{
param.Dispose();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment