Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- apk
- DS4
- RenderStreaming
- kinect v2
- TextMeshPro
- 랜더스트리밍
- 듀얼쇼크4
- muilt controller
- Unity
- Specular Highlights
- 에셋번들
- 역직렬화 오류
- web3D
- Android
- 유니티
- 반응형레이아웃
- AssetBundle
- AR
- untiy
- android app bundle
- Unity VisualStudio
- 커스텀쉐이더
- Depth camera
- Rewired
- 구글플레이스토어
- TextMeshPro 한글
- WebGL
- Environment Reflections
- unityhub
- webview
Archives
- Today
- Total
기억저장고
Mouse Pointer Free Aspect에서도 동작 본문
Free Aspect에서도 동작함
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class InputManager : MonoBehaviour
{
public RectTransform pointerRectTrf;
public Canvas parentCanvas;
//Mouse Pointer 만들기
private void Update()
{
UpdateMousePos();
}
private void UpdateMousePos()
{
Vector2 movePos;
RectTransformUtility.ScreenPointToLocalPointInRectangle(
parentCanvas.transform as RectTransform,
Input.mousePosition, parentCanvas.worldCamera,
out movePos);
Vector3 mousePos = parentCanvas.transform.TransformPoint(movePos);
//Set fake mouse Cursor
pointerRectTrf.transform.position = mousePos;
}
}
Comments