组件截图时报空

RequestorId++;   //此时是1025
PainterBg bg = PainterBg.CreateInstance();         //创建某个界面组件当背景
bg.AddChild(com);                                                //添加我传入的某个组件作为子物体
com.Center();                                                         //居中对齐
 
//下面是按照示例代码写的
DisplayObject com_Shot = bg.displayObject;       
com_Shot.EnterPaintingMode(RequestorId, null);
yield return null;
//断点调试此时的com_Shot.paintingGraphics.texture报空
tex = (RenderTexture)com_Shot.paintingGraphics.texture.nativeTexture;
ComTexDic.Add(com.name,tex);
com_Shot.LeavePaintingMode(RequestorId);
已邀请:

谷主

赞同来自:

看教程 对于requestid的要求。

要回复问题请先登录注册