'전체 글'에 해당되는 글 1801건
world, screen, viewport
Unity3D 2019. 4. 23. 11:09https://answers.unity.com/questions/168156/screen-vs-viewport-what-is-the-difference.html
http://blog.projectmw.net/unitys-screen-point-viewport-point-and-world-point
'Unity3D' 카테고리의 다른 글
Tower Defense Template (분해) (0) | 2019.05.03 |
---|---|
LayerMask (0) | 2019.05.01 |
Quaternion.LookRotation (0) | 2019.04.23 |
(unity) find child recursively (1) | 2019.04.21 |
Orthographic size (0) | 2019.04.17 |
Quaternion.LookRotation
Unity3D 2019. 4. 23. 10:55the direction can be described as the normalized difference between two points.
- Vector3 direction = (target.position - your.position).normalized;
- Quaternion look = Quaternion.LookRotation(direction);
- transform.rotation = look;
https://answers.unity.com/questions/1142832/character-facing-direction-of-movement-movement-us.html
'Unity3D' 카테고리의 다른 글
LayerMask (0) | 2019.05.01 |
---|---|
world, screen, viewport (0) | 2019.04.23 |
(unity) find child recursively (1) | 2019.04.21 |
Orthographic size (0) | 2019.04.17 |
How Unity Supports Cross Platform Feature (0) | 2019.03.20 |
(unity) find child recursively
Unity3D 2019. 4. 21. 18:58
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public static class GameUtils
{
//HOW TO USE
//var cube = this.transform.FirstChildOrDefault(x => x.name == "deeply_nested_cube");
public static Transform FirstChildOrDefault(this Transform parent, Func<Transform, bool> query)
{
if (parent.childCount == 0)
{
return null;
}
Transform result = null;
for (int i = 0; i < parent.childCount; i++)
{
var child = parent.GetChild(i);
if (query(child))
{
return child;
}
result = FirstChildOrDefault(child, query);
}
return result;
}
public static Transform SearchHierarchyForBone(Transform current, string name)
{
//sb.Append(current.name + "\n");
// check if the current bone is the bone we're looking for, if so return it
return current;
// search through child bones for the bone we're looking for
for (int i = 0; i < current.childCount; ++i)
{
// the recursive step; repeat the search one step deeper in the hierarchy
var child = current.GetChild(i);
Transform found = SearchHierarchyForBone(child, name);
// a transform was returned by the search above that is not null,
// it must be the bone we're looking for
if (found != null)
return found;
}
// bone with name was not found
return null;
}
}
|
'Unity3D' 카테고리의 다른 글
world, screen, viewport (0) | 2019.04.23 |
---|---|
Quaternion.LookRotation (0) | 2019.04.23 |
Orthographic size (0) | 2019.04.17 |
How Unity Supports Cross Platform Feature (0) | 2019.03.20 |
C# 컴파일 그리고 il2cpp (0) | 2019.03.07 |
왼손 좌표계, 오른손 좌표계
3D Game Programming/DirectX 2019. 4. 20. 01:36'3D Game Programming > DirectX' 카테고리의 다른 글
링크설정 (0) | 2019.04.20 |
---|---|
HR Failed d3dutil.cpp (0) | 2019.04.20 |
LNK2019 (0) | 2019.04.20 |
예제 프로그램과 웹 부록 (0) | 2019.04.20 |
Windows 데스크톱 마법사 (0) | 2019.04.20 |
링크설정
3D Game Programming/DirectX 2019. 4. 20. 01:21
'3D Game Programming > DirectX' 카테고리의 다른 글
왼손 좌표계, 오른손 좌표계 (0) | 2019.04.20 |
---|---|
HR Failed d3dutil.cpp (0) | 2019.04.20 |
LNK2019 (0) | 2019.04.20 |
예제 프로그램과 웹 부록 (0) | 2019.04.20 |
Windows 데스크톱 마법사 (0) | 2019.04.20 |