Last active
August 29, 2015 14:00
-
-
Save tsubaki/11320156 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class InputTest : MonoBehaviour | |
{ | |
void Update() | |
{ | |
if( Input.GetKeyDown(KeyCode.LeftArrow) ) | |
{ | |
GetComponent<Handler>().param.Value += 1; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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