FairyGUI.DisplayObject.LeavePaintingMode C# (CSharp) Method

LeavePaintingMode() public method

离开绘画模式
public LeavePaintingMode ( int requestorId ) : void
requestorId int
return void
        public void LeavePaintingMode(int requestorId)
        {
            if (_paintingMode == 0 || _disposed)
                return;

            _paintingMode ^= requestorId;
            if (_paintingMode == 0)
            {
                paintingGraphics.ClearMesh();
                paintingGraphics.enabled = false;

                if (this is Container)
                {
                    ((Container)this).SetChildrenLayer(this.layer);
                    ((Container)this).UpdateBatchingFlags();
                }
                else
                    this.InvalidateBatchingState();

                if (graphics != null)
                    this.gameObject.layer = paintingGraphics.gameObject.layer;
            }
        }

Usage Example

        public void Dispose()
        {
            if (!_target.isDisposed)
            {
                if ((_target is Image) || (_target is MovieClip))
                {
                    _target.graphics.materialKeywords = null;
                }
                else
                {
                    //恢复原来的材质
                    _target.paintingGraphics.material = _savedMaterial;
                    _target.LeavePaintingMode(1);
                }
            }

            if (_material != null)
            {
                Material.Destroy(_material);
            }

            _savedMaterial = null;
            _material      = null;
            _target        = null;
        }
All Usage Examples Of FairyGUI.DisplayObject::LeavePaintingMode