Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
3.07k stars 1.15k forks source link

Disabling planes should be collider + renderer and not gameobject [Bug] #610

Closed yosun closed 4 years ago

yosun commented 4 years ago

Describe the bug For performance issues, plane.gameObject.SetActive(value); should be replaced with

plane.gameObject.GetComponent<Renderer>().enabled = value; 
plane.gameObject.GetComponent<Collider>().enabled = value; 

https://github.com/Unity-Technologies/arfoundation-samples/blob/2.1/Assets/Scripts/PlaneDetectionController.cs#L57

To Reproduce See https://github.com/Unity-Technologies/arfoundation-samples/blob/2.1/Assets/Scripts/PlaneDetectionController.cs#L57

tdmowrer commented 4 years ago

This particular sample exists because someone specifically asked how to do this. This is just sample code; you can modify it as you see fit in your own usage.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.