本文整理汇总了C#中UIDrawCall.UpdateGeometry方法的典型用法代码示例。如果您正苦于以下问题:C# UIDrawCall.UpdateGeometry方法的具体用法?C# UIDrawCall.UpdateGeometry怎么用?C# UIDrawCall.UpdateGeometry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIDrawCall
的用法示例。
在下文中一共展示了UIDrawCall.UpdateGeometry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillDrawCall
private bool FillDrawCall(UIDrawCall dc)
{
if (dc != null)
{
dc.isDirty = false;
int num = 0;
int i = 0;
while (i < this.widgets.Count)
{
UIWidget uIWidget = this.widgets[i];
if (uIWidget == null)
{
this.widgets.RemoveAt(i);
}
else
{
if (uIWidget.drawCall == dc)
{
if (uIWidget.isVisible && uIWidget.hasVertices)
{
num++;
if (this.generateNormals)
{
uIWidget.WriteToBuffers(dc.verts, dc.uvs, dc.cols, dc.norms, dc.tans);
}
else
{
uIWidget.WriteToBuffers(dc.verts, dc.uvs, dc.cols, null, null);
}
if (uIWidget.mOnRender != null)
{
if (this.mOnRender == null)
{
this.mOnRender = uIWidget.mOnRender;
}
else
{
this.mOnRender = (UIDrawCall.OnRenderCallback)Delegate.Combine(this.mOnRender, uIWidget.mOnRender);
}
}
}
else
{
uIWidget.drawCall = null;
}
}
i++;
}
}
if (dc.verts.size != 0)
{
dc.UpdateGeometry(num);
dc.onRender = this.mOnRender;
this.mOnRender = null;
return true;
}
}
return false;
}
示例2: FillDrawCall
/// <summary>
/// Fill the geometry for the specified draw call.
/// </summary>
bool FillDrawCall (UIDrawCall dc)
{
if (dc != null)
{
dc.isDirty = false;
for (int i = 0; i < widgets.Count; )
{
UIWidget w = widgets[i];
if (w == null)
{
#if UNITY_EDITOR
Debug.LogError("This should never happen");
#endif
widgets.RemoveAt(i);
continue;
}
if (w.drawCall == dc)
{
if (w.isVisible && w.hasVertices)
{
if (generateNormals) w.WriteToBuffers(dc.verts, dc.uvs, dc.cols, dc.norms, dc.tans);
else w.WriteToBuffers(dc.verts, dc.uvs, dc.cols, null, null);
}
else w.drawCall = null;
}
++i;
}
if (dc.verts.size != 0)
{
dc.UpdateGeometry();
return true;
}
}
return false;
}
示例3: FillDrawCall
/// <summary>
/// Fill the geometry for the specified draw call.
/// </summary>
bool FillDrawCall (UIDrawCall dc)
{
if (dc != null)
{
dc.isDirty = false;
if (dc.mUIParticleData != null)
{
dc.mUIParticleData.Destroy();
dc.mUIParticleData = null;
}
for (int i = 0; i < widgets.size; )
{
UIWidget w = widgets[i];
if (w == null)
{
#if UNITY_EDITOR
Debug.LogError("This should never happen");
#endif
widgets.RemoveAt(i);
continue;
}
if (w.drawCall == dc)
{
if (w.isVisible && w.hasVertices)
{
if (generateNormals) w.WriteToBuffers(dc.verts, dc.uvs, dc.cols, dc.norms, dc.tans);
else w.WriteToBuffers(dc.verts, dc.uvs, dc.cols, null, null);
}
else if (w.isVisible && w.modelGameObject != null) //wym
{
if (dc.mUIParticleData != null)
dc.mUIParticleData.Destroy();
dc.mUIParticleData = new UIParticleData(w);
dc.mUIParticleData.RebuildMaterials();
}
else w.drawCall = null;
}
++i;
}
if (dc.verts.size != 0)
{
dc.UpdateGeometry();
return true;
}
if (dc.mUIParticleData != null)
{
return true;
}
}
return false;
}