1
私は団結でプレハブパネルをインスタンス化していると私はそれがこのような別のパネルに親の設定だ:それは非常識なサイズでありますインスタンス化するときしかしインスタンス化のプレハブが
GameObject notificationPanel = (GameObject) Resources.Load("NotificationWindow");
Text notificationText = notificationPanel.GetComponentInChildren<Text>();
if (notificationType == NotificationType.Warning)
{
notificationText.color = Color.red;
}
notificationText.text = text;
GameObject newNotificationWindow =
(GameObject) Instantiate(notificationPanel, new Vector3(0, 0, 0), Quaternion.identity);
newNotificationWindow.transform.SetParent(Settings.NotificationHolder.transform);
、親パネルを持っていますセルの内部の固定サイズのレイアウトグループなぜそれに影響しないのですか?新しいパネルは私の画面の約10倍です。階層ビューでは、新しいパネルがその親の下に正しく表示されます。また、 'z'の位置は約3900?
newNotificationWindow.transform.SetParent(Settings.NotificationHolder.transform, false);
が「偽」worldPositionStaysパラメータを表し、これはUIスケール:
あなたのプレハブは正しいですか?また、あなたのnewNotificationの親が正しく設定されていますか? – Cabrra
私の質問を完全に読んで@カブラですか?はい、どちらも正しいです。 – PetqImaQkaputka