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


C# dfRenderData.IsValid方法代码示例

本文整理汇总了C#中dfRenderData.IsValid方法的典型用法代码示例。如果您正苦于以下问题:C# dfRenderData.IsValid方法的具体用法?C# dfRenderData.IsValid怎么用?C# dfRenderData.IsValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dfRenderData的用法示例。


在下文中一共展示了dfRenderData.IsValid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: processRenderData

    private bool processRenderData( ref dfRenderData buffer, dfRenderData controlData, ref Bounds bounds, ref Rect screenRect, uint checksum, dfTriangleClippingRegion clipInfo, ref bool wasClipped )
    {
        wasClipped = false;

        // This shouldn't happen in practice, but need to make certain
        if( controlData == null || controlData.Material == null || !controlData.IsValid() )
            return false;

        // A new draw call is needed every time the current Material, Texture, or Shader
        // changes. If the control returned a buffer that is not empty and uses a
        // different Material, need to grab a new draw call buffer from the object pool.
        bool needNewDrawcall = false;
        if( buffer == null )
        {
            needNewDrawcall = true;
        }
        else
        {
            if( !Material.Equals( controlData.Material, buffer.Material ) )
            {
                needNewDrawcall = true;
            }
            else if( !textureEqual( controlData.Material.mainTexture, buffer.Material.mainTexture ) )
            {
                needNewDrawcall = true;
            }
            else if( !shaderEqual( buffer.Shader, controlData.Shader ) )
            {
                needNewDrawcall = true;
            }
            else if( !this.clipInfo.IsEmpty && drawCallBuffers.Count == 1 )
            {
                needNewDrawcall = true;
            }
        }

        if( needNewDrawcall )
        {
            buffer = getDrawCallBuffer( controlData.Material );
            buffer.Material = controlData.Material;
            buffer.Material.mainTexture = controlData.Material.mainTexture;
            buffer.Material.shader = controlData.Shader ?? controlData.Material.shader;
        }

        if( !Application.isPlaying || clipType == dfClippingMethod.Software )
        {

            // Ensure that the control's render data is properly clipped to the
            // current clipping region
            if( clipInfo.PerformClipping( buffer, ref bounds, checksum, controlData ) )
            {
                return true;
            }

            // If PerformClipping() returns FALSE, then the control was outside of
            // the active clipping region
            wasClipped = true;

        }
        else
        {
            if( clipRect.IsEmpty() || screenRect.Intersects( clipRect ) )
            {
                buffer.Merge( controlData );
            }
            else
            {
                // Control was not inside of the active clipping rectangle
                wasClipped = true;
            }
        }

        return false;
    }
开发者ID:zc1415926,项目名称:Unity-SelectCharacter-Scene,代码行数:74,代码来源:dfRenderGroup.cs


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