Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
NGUI 2D UI カメラの幅と高さにアクセスしようとしています。また、NGUI で作成したボタンの幅と高さにアクセスしようとしています。
別の方法は次のとおりです。
var uiPanel = NGUITools.GetRoot(gameObject).GetComponent<UIPanel>(); print(uiPanel.width"); print("uiPanel.height");
そして、オブジェクトが見つかるまで、すべてのシーン階層を介してオブジェクトを探すことを避けます。また、複数の UICameras を使用しているため、複数の UIRoots を使用している場合は、正しいものを取得してください。