我写了一个脚本,在改变对象的localScale后,我想获取边界值,但是渲染器没有改变边界值,如何解决这个问题?
脚本:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Test
{
public class TestSize : MonoBehaviour
{
public GameObject obj;
public Renderer objRenderer;
void Start()
{
obj.transform.localScale = new Vector3(4, 4, 4);
Debug.Log(objRenderer.bounds.extents.x);
}
}
你确定不会变?一切都为我改变