【3Dゲームエンジン】Unity質問スレッド21at GAMEDEV
【3Dゲームエンジン】Unity質問スレッド21 - 暇つぶし2ch728:名前は開発中のものです。
15/12/22 23:37:31.20 J2VSDia0.net
>>708
ようわからんが ヒエラルキー上の親はtransform.parentですよ。
なんでCanvasの直接の子なら
RectTransform rect = transform.parent.GetComponent<RectTransform>();
Debug.Log(" width :" + rect.rect.width);
それ以外なら
RectTransform rect;
void Start () {
rect = GameObject.Find("Canvas").GetComponent<RectTransform>();
Debug.Log(" width :" + rect.rect.width);
}
とかにしておけばいいんじゃないか。


次ページ
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch