本文整理汇总了C#中UIDrawCall类的典型用法代码示例。如果您正苦于以下问题:C# UIDrawCall类的具体用法?C# UIDrawCall怎么用?C# UIDrawCall使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIDrawCall类属于命名空间,在下文中一共展示了UIDrawCall类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}
示例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);
}
}
示例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();
}
示例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;
}
示例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();
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
}