# 與場景互動 ###### tags: `lab` <!-- :::info :construction: 仍在撰寫中 :construction: ::: --> :::info 這裡的 code 都是自己寫的,請找個舒服的位置把他們貼上去 ::: ## 試製 pico 控制器腳本 (PicoVRcontroller) (VR SDK) ### Code <!-- :::spoiler --> {%gist JCxYIS/02877f8e3904695c51cd076f631efe9c %} <!-- ::: --> ### 使用說明 - 把 `PicoVRcontroller` 附到 Pico Prefab 的 `ControllerManager` 上  ### 與物件場景互動 - 要互動的物件,確定有 collider 後。將其腳本繼承 `IClickable` (之類的,用不到就把上面的部分 code 註解掉) - 或是繼承 `ITriggerManager`,集中管理事件 (目前僅有 Hover),但要記得把這份 code 貼到場景上喔 <!-- ### 使用 EventSystem (未驗證) - 據說貼在腳本上就好 ```csharp= ... using UnityEngine.EventSystems; ... public class XXXXX : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler { ... public void OnPointerEnter(PointerEventData eventData) { Debug.Log("OnPointerEnter"); isSelect = true; } public void OnPointerExit(PointerEventData eventData) { Debug.Log("OnPointerExit"); isSelect = false; } } ``` -->
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up