• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UIDrawCall类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中UIDrawCall的典型用法代码示例。如果您正苦于以下问题:C# UIDrawCall类的具体用法?C# UIDrawCall怎么用?C# UIDrawCall使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UIDrawCall类属于命名空间,在下文中一共展示了UIDrawCall类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: switch

 public Material this[UIDrawCall.Clipping clipping]
 {
     get
     {
         UIMaterial.ClippingFlags clippingFlag = (UIMaterial.ClippingFlags)((int)UIDrawCall.Clipping.HardClip << (int)(clipping & (UIDrawCall.Clipping.HardClip | UIDrawCall.Clipping.AlphaClip | UIDrawCall.Clipping.SoftClip)));
         if ((clippingFlag & this.madeMats) != clippingFlag)
         {
             return this.MakeMaterial(clipping);
         }
         switch (clipping)
         {
             case UIDrawCall.Clipping.None:
             {
                 return this.matNone;
             }
             case UIDrawCall.Clipping.HardClip:
             {
                 return this.matHardClip;
             }
             case UIDrawCall.Clipping.AlphaClip:
             {
                 return this.matAlphaClip;
             }
             case UIDrawCall.Clipping.SoftClip:
             {
                 return this.matSoftClip;
             }
         }
         throw new NotImplementedException();
     }
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:31,代码来源:UIMaterial.cs


示例2: Delete

 private void Delete(ref UIDrawCall.Iterator iter)
 {
     if (iter.Has)
     {
         UIDrawCall current = iter.Current;
         if (object.ReferenceEquals(current, this.mDrawCalls))
         {
             this.mDrawCalls = iter.Next.Current;
         }
         iter = iter.Next;
         current.LinkedList__Remove();
         UIPanel uIPanel = this;
         uIPanel.mDrawCallCount = uIPanel.mDrawCallCount - 1;
         NGUITools.DestroyImmediate(current.gameObject);
     }
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:16,代码来源:UIPanel.cs


示例3: SubmitDrawCall

	/// <summary>
	/// Submit the draw call using the current geometry.
	/// </summary>

	void SubmitDrawCall (UIDrawCall dc)
	{
		drawCalls.Add(dc);
		dc.Set(mVerts, generateNormals ? mNorms : null, generateNormals ? mTans : null, mUvs, mCols);
		mVerts.Clear();
		mNorms.Clear();
		mTans.Clear();
		mUvs.Clear();
		mCols.Clear();
	}
开发者ID:githubsdk,项目名称:nlearn,代码行数:14,代码来源:UIPanel.cs


示例4: Fill

	/// <summary>
	/// Fill the geometry for the specified draw call.
	/// </summary>

	static bool Fill (UIDrawCall dc)
	{
		if (dc != null)
		{
			dc.isDirty = false;

			for (int i = 0; i < UIWidget.list.size; )
			{
				UIWidget w = UIWidget.list[i];

				if (w == null)
				{
					UIWidget.list.RemoveAt(i);
					continue;
				}

				if (w.renderQueue == dc.renderQueue)
				{
					if (w.isVisible && w.hasVertices)
					{
						if (dc.panel.generateNormals) w.WriteToBuffers(mVerts, mUvs, mCols, mNorms, mTans);
						else w.WriteToBuffers(mVerts, mUvs, mCols, null, null);
					}
					else
					{
						w.renderQueue = -1;
					}
				}
				++i;
			}

			if (mVerts.size != 0)
			{
				dc.Set(mVerts, dc.panel.generateNormals ? mNorms : null, dc.panel.generateNormals ? mTans : null, mUvs, mCols);
				mVerts.Clear();
				mNorms.Clear();
				mTans.Clear();
				mUvs.Clear();
				mCols.Clear();
				return true;
			}
		}
		return false;
	}
开发者ID:trustmeimajedi,项目名称:Unity-SDK,代码行数:48,代码来源:UIPanel.cs


示例5: SubmitDrawCall

	/// <summary>
	/// Submit the draw call using the current geometry.
	/// </summary>

	void SubmitDrawCall (UIDrawCall dc)
	{
		dc.clipping = clipping;
		dc.alwaysOnScreen = alwaysOnScreen && (clipping == UIDrawCall.Clipping.None || clipping == UIDrawCall.Clipping.ConstrainButDontClip);
		dc.Set(mVerts, generateNormals ? mNorms : null, generateNormals ? mTans : null, mUvs, mCols);
		mVerts.Clear();
		mNorms.Clear();
		mTans.Clear();
		mUvs.Clear();
		mCols.Clear();
	}
开发者ID:hoangwin,项目名称:2-ca-rs-tim-berman,代码行数:15,代码来源:UIPanel.cs


示例6: LinkedList__Insert

 internal void LinkedList__Insert(ref UIDrawCall list)
 {
     this.mHasPrev = false;
     this.mHasNext = list;
     this.mNext = list;
     this.mPrev = null;
     if (this.mHasNext)
     {
         list.mHasPrev = true;
         list.mPrev = this;
     }
     list = this;
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:13,代码来源:UIDrawCall.cs


示例7: SubmitDrawCall

 private void SubmitDrawCall(UIDrawCall dc)
 {
     dc.clipping = this.clipping;
     dc.Set(mVerts, !this.generateNormals ? null : mNorms, !this.generateNormals ? null : mTans, mUvs, mCols);
     mVerts.Clear();
     mNorms.Clear();
     mTans.Clear();
     mUvs.Clear();
     mCols.Clear();
 }
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:10,代码来源:UIPanel.cs


示例8: Fill

 private static bool Fill(UIDrawCall dc)
 {
     if (dc != null)
     {
         dc.isDirty = false;
         int index = 0;
         while (index < UIWidget.list.size)
         {
             UIWidget widget = UIWidget.list[index];
             if (widget == null)
             {
                 UIWidget.list.RemoveAt(index);
             }
             else
             {
                 if (widget.drawCall == dc)
                 {
                     if (widget.isVisible && widget.hasVertices)
                     {
                         if (dc.manager.generateNormals)
                         {
                             widget.WriteToBuffers(mVerts, mUvs, mCols, mNorms, mTans);
                         }
                         else
                         {
                             widget.WriteToBuffers(mVerts, mUvs, mCols, null, null);
                         }
                     }
                     else
                     {
                         widget.drawCall = null;
                     }
                 }
                 index++;
             }
         }
         if (mVerts.size != 0)
         {
             dc.Set(mVerts, !dc.manager.generateNormals ? null : mNorms, !dc.manager.generateNormals ? null : mTans, mUvs, mCols);
             mVerts.Clear();
             mNorms.Clear();
             mTans.Clear();
             mUvs.Clear();
             mCols.Clear();
             return true;
         }
     }
     return false;
 }
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:49,代码来源:UIPanel.cs


示例9: 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


示例10: Destroy

 public static void Destroy(UIDrawCall dc)
 {
     if (dc)
     {
         dc.onRender = null;
         if (Application.isPlaying)
         {
             if (UIDrawCall.mActiveList.Remove(dc))
             {
                 NGUITools.SetActive(dc.gameObject, false);
                 UIDrawCall.mInactiveList.Add(dc);
             }
         }
         else
         {
             UIDrawCall.mActiveList.Remove(dc);
             NGUITools.DestroyImmediate(dc.gameObject);
         }
     }
 }
开发者ID:floatyears,项目名称:Decrypt,代码行数:20,代码来源:UIDrawCall.cs


示例11: MakeMaterial

 private Material MakeMaterial(UIDrawCall.Clipping clipping)
 {
     Material material;
     Material material1;
     Shader clippingShader;
     Material material2;
     bool flag = (int)this.madeMats == 0;
     switch (clipping)
     {
         case UIDrawCall.Clipping.None:
         {
             clippingShader = this.key.shader;
             material1 = this.matNone;
             Material material3 = UIMaterial.CreateMaterial(clippingShader);
             material2 = material3;
             this.matNone = material3;
             material = material2;
             UIMaterial uIMaterial = this;
             uIMaterial.madeMats = uIMaterial.madeMats | UIMaterial.ClippingFlags.None;
             break;
         }
         case UIDrawCall.Clipping.HardClip:
         {
             clippingShader = UIMaterial.GetClippingShader(this.key.shader, UIDrawCall.Clipping.HardClip);
             material1 = this.matHardClip;
             Material material4 = UIMaterial.CreateMaterial(clippingShader);
             material2 = material4;
             this.matHardClip = material4;
             material = material2;
             UIMaterial uIMaterial1 = this;
             uIMaterial1.madeMats = uIMaterial1.madeMats | UIMaterial.ClippingFlags.HardClip;
             break;
         }
         case UIDrawCall.Clipping.AlphaClip:
         {
             clippingShader = UIMaterial.GetClippingShader(this.key.shader, UIDrawCall.Clipping.AlphaClip);
             material1 = this.matAlphaClip;
             Material material5 = UIMaterial.CreateMaterial(clippingShader);
             material2 = material5;
             this.matAlphaClip = material5;
             material = material2;
             UIMaterial uIMaterial2 = this;
             uIMaterial2.madeMats = uIMaterial2.madeMats | UIMaterial.ClippingFlags.AlphaClip;
             break;
         }
         case UIDrawCall.Clipping.SoftClip:
         {
             clippingShader = UIMaterial.GetClippingShader(this.key.shader, UIDrawCall.Clipping.SoftClip);
             material1 = this.matSoftClip;
             Material material6 = UIMaterial.CreateMaterial(clippingShader);
             material2 = material6;
             this.matSoftClip = material6;
             material = material2;
             UIMaterial uIMaterial3 = this;
             uIMaterial3.madeMats = uIMaterial3.madeMats | UIMaterial.ClippingFlags.SoftClip;
             break;
         }
         default:
         {
             throw new NotImplementedException();
         }
     }
     UIMaterial.g.generatedMaterials.Add(material, this);
     if (!flag)
     {
         material.CopyPropertiesFromMaterial(this.matFirst);
     }
     else
     {
         this.matFirst = material;
         material.CopyPropertiesFromMaterial(this.key);
     }
     if (material1)
     {
         UnityEngine.Object.DestroyImmediate(material1);
     }
     return material;
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:78,代码来源:UIMaterial.cs


示例12: 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


示例13: Destroy

	/// <summary>
	/// Destroy the specified draw call.
	/// </summary>

	static public void Destroy (UIDrawCall dc)
	{
		if (Application.isPlaying) NGUITools.SetActive(dc.gameObject, false);
		else NGUITools.DestroyImmediate(dc.gameObject);
	}
开发者ID:Jetblacktsunami,项目名称:TreasureCove,代码行数:9,代码来源:UIDrawCall.cs


示例14: LinkedList__Remove

 internal void LinkedList__Remove()
 {
     if (this.mHasPrev)
     {
         this.mPrev.mHasNext = this.mHasNext;
         this.mPrev.mNext = this.mNext;
     }
     if (this.mHasNext)
     {
         this.mNext.mHasPrev = this.mHasPrev;
         this.mNext.mPrev = this.mPrev;
     }
     int num = 0;
     bool flag = (bool)num;
     this.mHasPrev = (bool)num;
     this.mHasNext = flag;
     object obj = null;
     UIDrawCall uIDrawCall = (UIDrawCall)obj;
     this.mPrev = (UIDrawCall)obj;
     this.mNext = uIDrawCall;
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:21,代码来源:UIDrawCall.cs


示例15: DestroyDrawCall

	/// <summary>
	/// Destroy the specified draw call.
	/// NOTE: Future optimization can be caching these at run-time instead of destroying them.
	/// </summary>

	static void DestroyDrawCall (UIDrawCall dc, int index)
	{
		if (dc != null)
		{
			//Debug.Log("Destroyed DC " + dc.material.name + " as " + dc.renderQueue);
			UIDrawCall.list.RemoveAt(index);
			NGUITools.DestroyImmediate(dc.gameObject);
		}
	}
开发者ID:TomMulvaney,项目名称:JoyGatsby_Runner,代码行数:14,代码来源:UIPanel.cs


示例16: Create

 public static UIMaterial Create(Material key, bool manageKeyDestruction, UIDrawCall.Clipping useAsClipping)
 {
     UIMaterial uIMaterial;
     if (!manageKeyDestruction)
     {
         return UIMaterial.Create(key);
     }
     if (!key)
     {
         return null;
     }
     if (UIMaterial.g.keyedMaterials.TryGetValue(key, out uIMaterial))
     {
         throw new InvalidOperationException("That material is registered and cannot be used with manageKeyDestruction");
     }
     if (UIMaterial.g.generatedMaterials.TryGetValue(key, out uIMaterial))
     {
         return uIMaterial;
     }
     uIMaterial = ScriptableObject.CreateInstance<UIMaterial>();
     uIMaterial.key = key;
     int num = UIMaterial.g.hashCodeIterator + 1;
     UIMaterial.g.hashCodeIterator = num;
     uIMaterial.hashCode = num;
     if (uIMaterial.hashCode == 2147483647)
     {
         UIMaterial.g.hashCodeIterator = -2147483648;
     }
     UIMaterial.g.generatedMaterials.Add(key, uIMaterial);
     uIMaterial.matFirst = key;
     switch (useAsClipping)
     {
         case UIDrawCall.Clipping.None:
         {
             uIMaterial.matNone = key;
             break;
         }
         case UIDrawCall.Clipping.HardClip:
         {
             uIMaterial.matHardClip = key;
             break;
         }
         case UIDrawCall.Clipping.AlphaClip:
         {
             uIMaterial.matAlphaClip = key;
             break;
         }
         case UIDrawCall.Clipping.SoftClip:
         {
             uIMaterial.matSoftClip = key;
             break;
         }
         default:
         {
             throw new NotImplementedException();
         }
     }
     uIMaterial.madeMats = (UIMaterial.ClippingFlags)((int)UIDrawCall.Clipping.HardClip << (int)(useAsClipping & (UIDrawCall.Clipping.HardClip | UIDrawCall.Clipping.AlphaClip | UIDrawCall.Clipping.SoftClip)));
     return uIMaterial;
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:60,代码来源:UIMaterial.cs


示例17: GetClippingShader

 private static Shader GetClippingShader(Shader original, UIDrawCall.Clipping clipping)
 {
     if (!original)
     {
         return null;
     }
     string str = original.name;
     switch (clipping)
     {
         case UIDrawCall.Clipping.None:
         {
             string str1 = str.Replace(" (HardClip)", string.Empty).Replace(" (AlphaClip)", string.Empty).Replace(" (SoftClip)", string.Empty);
             if (str1 == str)
             {
                 return original;
             }
             str = str1;
             break;
         }
         case UIDrawCall.Clipping.HardClip:
         {
             if (!UIMaterial.ShaderNameDecor(ref str, " (AlphaClip)", " (SoftClip)", " (HardClip)"))
             {
                 return original;
             }
             break;
         }
         case UIDrawCall.Clipping.AlphaClip:
         {
             if (!UIMaterial.ShaderNameDecor(ref str, " (SoftClip)", " (HardClip)", " (AlphaClip)"))
             {
                 return original;
             }
             break;
         }
         case UIDrawCall.Clipping.SoftClip:
         {
             if (!UIMaterial.ShaderNameDecor(ref str, " (HardClip)", " (AlphaClip)", " (SoftClip)"))
             {
                 return original;
             }
             break;
         }
         default:
         {
             throw new NotImplementedException();
         }
     }
     Shader shader = Shader.Find(str);
     if (!shader)
     {
         throw new MissingReferenceException(string.Concat("Theres no shader named ", str));
     }
     return shader;
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:55,代码来源:UIMaterial.cs


示例18: 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.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(mVerts, mUvs, mCols, mNorms, mTans);
						else w.WriteToBuffers(mVerts, mUvs, mCols, null, null);
					}
					else w.drawCall = null;
				}
				++i;
			}

			if (mVerts.size != 0)
			{
				dc.Set(mVerts, generateNormals ? mNorms : null, generateNormals ? mTans : null, mUvs, mCols);
				mVerts.Clear();
				mNorms.Clear();
				mTans.Clear();
				mUvs.Clear();
				mCols.Clear();
				return true;
			}
		}
		return false;
	}
开发者ID:githubsdk,项目名称:nlearn,代码行数:48,代码来源:UIPanel.cs


示例19: FastGet

 private Material FastGet(UIDrawCall.Clipping clipping)
 {
     switch (clipping)
     {
         case UIDrawCall.Clipping.None:
         {
             return this.matNone;
         }
         case UIDrawCall.Clipping.HardClip:
         {
             return this.matHardClip;
         }
         case UIDrawCall.Clipping.AlphaClip:
         {
             return this.matAlphaClip;
         }
         case UIDrawCall.Clipping.SoftClip:
         {
             return this.matSoftClip;
         }
     }
     throw new NotImplementedException();
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:23,代码来源:UIMaterial.cs


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UIEdgeInsets类代码示例发布时间:2022-05-24
下一篇:
C# UIDatePicker类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap