2017-12-14 2 views
1

스크립트에서 입자 렌더링 모드를 변경하려고하지만 stretched_billboard 모드를 선택할 수 없지만 편집기에서 변경할 수 있습니다.왜 스크립트에서 stretched_billboard 렌더링 모드를 선택할 수 없습니까?

ps = GetComponent<ParticleSystem>(); 
psr = GetComponent<ParticleSystemRenderer>(); 
psr.renderMode = ParticleSystemRenderMode.Stretch; 

psr.renderMode = ParticleSystemRenderMode.StretchedBillboard; 

StretchedBillboard 옵션이없는 잘 작동합니다.

미리 감사드립니다.

답변

0

나는 StretchedBillboard이 기본 렌더러 모델 (Billboard)과 카메라에 적용된 0이 아닌 비율 조정의 조합이라고 생각합니다. 따라서 코드를 통해이 두 값을 조합하여 코드를 재현 할 수 있어야합니다.

사실, 빌보드는 빌보드 모드로 설명 뻗어, 설명서를보고 있지만, 적용 스케일링 :

enter image description here

ParticleSystemRenderer'sAPIs 보면, 얼마 cameraVelocityScale 속성 (이있다 입자는 카메라의 속도에 따라 늘어납니다.). 적절한 예제를 제공해야하는 snippet도 있습니다.

나는 이것이 당신을 도울 수 있기를 바랍니다.

+0

감사합니다. –

관련 문제