当前位置: 首页>>代码示例>>C#>>正文


C# UIDrawCall.UpdateGeometry方法代码示例

本文整理汇总了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;
 }
开发者ID:floatyears,项目名称:Decrypt,代码行数:59,代码来源:UIPanel.cs

示例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;
	}
开发者ID:BGCX261,项目名称:zjh-dev-svn-to-git,代码行数:43,代码来源:UIPanel.cs

示例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;
	}
开发者ID:fengqk,项目名称:Art,代码行数:59,代码来源:UIPanel.cs


注:本文中的UIDrawCall.UpdateGeometry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。