/// <summary> /// 激活 /// </summary> public void OnInteractiveEnable() { EventHandGrabObject.AddListener(OnGrabObject, Core.ExecutionPriority.High); EventHandReleaseObject.AddListener(OnIdleObject, Core.ExecutionPriority.High); coroutineUpdate = StartCoroutine(OnUpdate()); }
private void Start() { //EventCameraZoom.AddListener((float lerp) => //{ // Debug.Log("缩放:" + lerp); //}); //EventCameraRotate.AddListener((Vector3 lerp) => //{ // Debug.Log("旋转向量值:" + lerp); //}); //EventHandGrip.AddListener((int handIndex) => //{ // Debug.Log("握拳:" + handIndex); //}); //EventHandIdle.AddListener((int handIndex) => //{ // Debug.Log("释放:" + handIndex); //}); //Test(); //var result = IsContains(1, OperatePlatform.Mouse); //Debug.Log("result:" + result); EventHandGrabObject.AddListener((go, handIndex) => { //Debug.Log("抓取手:" + handIndex + " 物体:" + go); }); //EventHandRayTarget.AddListener((hit, handIndex) => //{ // Debug.Log("手:" + handIndex + " 射线点:" + hit.collider.gameObject); //}); EventHandRayTargetEnter.AddListener(key, (handIndex) => { //Debug.Log("手:" + handIndex + "物体移入:" + key); }); EventHandRayTargetExit.AddListener(key, (handIndex) => { //Debug.Log("手:" + handIndex + "物体移出:" + key); }); EventHandReleaseObject.AddListener((go, handIndex) => { //Debug.Log("释放手:" + handIndex + " 物体:" + go); }); }
void Register() { //Events.EventHandReleaseObject.AddListener(Events.EventLevel.B, OnReleaseObject); //MCKinect.Events.KinectEventHandReleaseObject.AddListener(MCKinect.Events.EventLevel.B, OnReleaseObject); //Events.EventHandGrabObject.AddListener(Events.EventLevel.B, OnGrabObject); EventHandReleaseObject.AddListener(OnReleaseObject); EventHandGrabObject.AddListener(OnGrabObject); if (panel != null) { panel.onEnter.AddListener(OnPanelEnter); panel.onExit.AddListener(OnPanelExit); } }
void ontest() { gameObject.AddGrabObject(onGrab); gameObject.RemoveGrabObject(onGrab); gameObject.RemoveGrabObjectAll(); gameObject.AddReleaseObject(OnRelease); gameObject.RemoveReleaseObject(OnRelease); gameObject.RemoveReleaseObjectAll(); gameObject.AddRayTargetEnter(OnTargetEnter); gameObject.RemoveRayTargetEnter(OnTargetEnter); gameObject.RemoveRayTargetEnter(); gameObject.AddRayTargetExit(OnTargetExit); gameObject.RemoveRayTargetExit(); gameObject.RemoveRayTargetExit(OnTargetExit); EventHandRay.AddListener(onRay); EventHandRay.RemoveListener(onRay); EventHandRays.AddListener(OnRays); EventHandRays.RemoveListener(OnRays); EventHandStart.AddListener(onstart); EventHandStart.RemoveListener(onstart); EventHandStop.AddListener(onstop); EventHandStop.RemoveListener(onstop); EventHandUIRay.AddListener(onRay); EventHandUIRay.RemoveListener(onRay); EventCameraZoom.AddListener(onzoom); EventCameraZoom.RemoveListener(onzoom); EventCameraRotate.AddListener(onrotate); EventCameraRotate.RemoveListener(onrotate); EventHandGrabObject.AddListener(ongrabobject); EventHandGrabObject.RemoveListener(ongrabobject); EventHandReleaseObject.AddListener(onreleaseobject); EventHandReleaseObject.RemoveListener(onreleaseobject); EventHandGrabObjectKey.AddListener(gameObject, onGrab); EventHandGrabObjectKey.RemoveListener(gameObject, onGrab); EventHandReleaseObjectKey.AddListener(gameObject, OnRelease); EventHandReleaseObjectKey.RemoveListener(gameObject, OnRelease); EventHandRayTarget.AddListener(onraytarget); EventHandRayTarget.RemoveListener(onraytarget); EventHandRayTargetEnter.AddListener(gameObject, OnTargetEnter); EventHandRayTargetEnter.RemoveListener(gameObject, OnTargetEnter); EventHandRayTargetExit.AddListener(gameObject, OnTargetExit); EventHandRayTargetExit.RemoveListener(gameObject, OnTargetExit); EventHandUIRayEnter.AddListener(gameObject, onuienter); EventHandUIRayEnter.RemoveListener(gameObject, onuienter); EventHandUIRayExit.AddListener(gameObject, onuiexit); EventHandUIRayExit.RemoveListener(gameObject, onuiexit); EventHandUIRay.AddListener(onRay); EventHandUIRay.RemoveListener(onRay); }
void Awake() { EventHandGrabObject.AddListener(OnGrab, Core.ExecutionPriority.High); EventHandReleaseObject.AddListener(OnIdle, Core.ExecutionPriority.High); initDeskHeight = deskHeight; }
void Start() { EventHandGrabObject.AddListener(OnGrab, Core.ExecutionPriority.High); EventHandReleaseObject.AddListener(OnIdle, Core.ExecutionPriority.High); }
void Awake() { //if (limitObj == null) limitObj = gameObject.transform.parent.gameObject; EventHandGrabObject.AddListener(OnGrab, Core.ExecutionPriority.High); EventHandReleaseObject.AddListener(OnIdle, Core.ExecutionPriority.High); }