[英]How to equally distribute points to a LineRenderer's width curve as I'm "drawing" the line?
[英]I'm getting warning on LineRenderer SetWidth that it's obsolete how should i fix it?
lineRenderer.SetWidth(startWidth, endWidth);
lineRenderer.SetVertexCount(linePoints.Count);
在兩行上都發出相同的警告:
'LineRenderer.SetVertexCount(int)'已過時:'SetVertexCount已棄用。 請改用numPositions屬性。”
和
'LineRenderer.SetWidth(float,float)'已過時:'SetWidth已棄用。 請改用startWidth,endWidth或widthCurve屬性。
然后我嘗試了這個:
lineRenderer.startWidth(startWidth, endWidth);
但是然后在startWidth屬性上得到錯誤:
'LineRenderer.startWidth'不能像方法一樣使用。
LineRenderer
某些功能已更改為屬性,並且也已重命名以避免混淆。 您設置屬性時不能將其稱為函數。 對於lineRenderer.SetVertexCount
,您可以使用lineRenderer.positionCount
進行設置。
lineRenderer.startWidth = startWidth;
lineRenderer.endWidth = endWidth;
lineRenderer.positionCount = linePoints.Count;
只需執行編譯器的建議即可。
IE瀏覽器:
lineRenderer.startWidth = startWidth;
lineRenderer.endWidth = endWidth;
lineRenderer.positionCount = linePoints.Count;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.