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
- 듀얼쇼크4
- TextMeshPro 한글
- Unity
- TextMeshPro
- apk
- 유니티
- RenderStreaming
- 랜더스트리밍
- 구글플레이스토어
- AssetBundle
- Depth camera
- 에셋번들
- muilt controller
- Environment Reflections
- Android
- Rewired
- android app bundle
- unityhub
- WebGL
- Unity VisualStudio
- untiy
- webview
- Specular Highlights
- kinect v2
- 역직렬화 오류
- 반응형레이아웃
- AR
- DS4
- 커스텀쉐이더
- web3D
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;
}
}
Position UI to mouse position (Make Tooltip panel follow cursor)
I made a tooltip panel follow the cursor with void Update () { this.transform.position = Input.mousePosition; } in the Update function. The panel "lags" behind, moving to cursor position a...
stackoverflow.com
Comments