카테고리 없음

0812 유니티(버츄얼 카메라 Body변경)

버스창문 2025. 8. 12. 17:12

저 부분을 바꾸는 방법

public class Test : MonoBehaviour
{
    public CinemachineVirtualCamera vc;
    private void Start()
    {
        vc.AddCinemachineComponent<Cinemachine3rdPersonFollow>();
    }
}

Add하면 알아서 저게 다른걸로 바뀐다

vc.DestroyCinemachineComponent<Cinemachine3rdPersonFollow>();


Destroy도 있다

Body의 경우에는 DoNothing으로 바뀐다

이 세놈

옆에 메뉴를 바꿨을때 아래 옵션이 새로 생기는애들

얘네는 따로 컴포넌트로서 동작하기때문에, Destroy라던가, Add라던가

저 아래 옵션을 쓰려면 Get을 해야하는 것들

저 옵션에 있는 애들은 그냥 다 있다

바꾸려면 Add

굳이 Destroy를 선행해야할 필요는 없다