修复了选曲的问题 优化了ui
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class loadtopandbottomPrefab: MonoBehaviour
|
||||
{
|
||||
[Header("father obj")]
|
||||
public GameObject top_and_bottom_Panel;
|
||||
public GameObject gameobject_to_Instantiate_below;
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (top_and_bottom_Panel != null && gameobject_to_Instantiate_below != null)
|
||||
{
|
||||
GameObject instantiated = Instantiate(top_and_bottom_Panel, gameobject_to_Instantiate_below.transform);
|
||||
Canvas canvas = instantiated.GetComponent<Canvas>();
|
||||
if (canvas != null)
|
||||
{
|
||||
Camera cam = Camera.main;
|
||||
if (cam == null)
|
||||
{
|
||||
cam = FindObjectOfType<Camera>();
|
||||
}
|
||||
canvas.worldCamera = cam;
|
||||
cam = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user