일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 쓰는 법
- tutorial
- 유니티 그래픽 최적화
- 에러
- 익명 타입
- 리깅
- Effective C#
- NavMesh
- 애님
- Final IK
- 튜토리얼
- c#
- 2판
- 속성
- 파이널 IK
- 애니메이션
- 쉐이더
- unity
- 프로퍼티
- 유니티
- 깃허브
- 오류
- 메모리
- github
- 리팩토링
- 유니티 그래픽스 최적화 스타트업
- error
- 최적화
- shader
- 사용법
- Today
- Total
참치김밥은 최고의 한식이다
[Unity] RectTransform left, right, top, bottom 값 수정 및 가져오기 본문
public static class RectTransformUtils
{
public static void SetLeft(this RectTransform rt, float left)
{
rt.offsetMin = new Vector2(left, rt.offsetMin.y);
}
public static void SetRight(this RectTransform rt, float right)
{
rt.offsetMax = new Vector2(-right, rt.offsetMax.y);
}
public static void SetTop(this RectTransform rt, float top)
{
rt.offsetMax = new Vector2(rt.offsetMax.x, -top);
}
public static void SetBottom(this RectTransform rt, float bottom)
{
rt.offsetMin = new Vector2(rt.offsetMin.x, bottom);
}
public static float GetLeft(this RectTransform rt)
{
return rt.offsetMin.x;
}
public static float GetBottom(this RectTransform rt)
{
return rt.offsetMin.y;
}
}
'Unity' 카테고리의 다른 글
[Unity] Final IK Tutorial 정리 - Aim IK Redirecting Animation (0) | 2023.06.19 |
---|---|
[Unity] Final IK Tutorials 정리 - Custom IK Rigs (0) | 2023.06.19 |
[Unity] 코드가 이상할 때, 코드 호출 타이밍 이상할 때 (한 번이라도 보면 후회 안함) (0) | 2023.06.14 |
[Unity] C# CSV 무결성 오류 해결 방법 (0) | 2023.06.07 |
[Unity] 다사다난했던 CSV 읽기 쓰기 (2) | 2023.06.02 |