티스토리 뷰
게임오브젝트에 attach된 script를 찾을때 다음과 같이 하면 된다
private A_SpawnGrowItems _GrowItemManager;
private GameObject _gamemanager;
private void Awake()
{
// 게임오브젝트 찾고
_gamemanager = GameObject.Find("GameManager");
// attach된 스크립트 찾는다
_GrowItemManager = _gamemanager.GetComponent<A_SpawnGrowItems>();
}
'유니티' 카테고리의 다른 글
오브젝트의 position, rotation 고정시키기 (Rigidbody Freeze) (0) | 2021.05.13 |
---|---|
오브젝트가 특점지정으로 고개를 돌려 이동 (0) | 2021.05.06 |
2d에서 오브젝트를 특정 지점으로 이동시키기 (Vector2.MoveTowards ) (0) | 2021.04.16 |
GameObject.FindGameObjectsWithTag (0) | 2021.04.16 |
GetAxis, GetAxisRaw (0) | 2021.04.11 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- C
- db
- 이분탐색
- recursion
- 자료구조
- Stack
- graph
- 조합
- Unity
- two pointer
- priority queue
- back tracking
- Dijkstra
- binary search
- dfs
- greedy
- permutation
- Implementation
- Python
- MVC
- DP
- 재귀
- Spring
- Brute Force
- Kruskal
- CSS
- C++
- BFS
- floyd warshall
- Tree
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함