浏览代码

战斗表现

zhaoyang 2 年之前
父节点
当前提交
46b35e0cb1
共有 1 个文件被更改,包括 7 次插入7 次删除
  1. 7 7
      GameClient/Assets/Game/HotUpdate/DressUp/DressUpUtil.cs

+ 7 - 7
GameClient/Assets/Game/HotUpdate/DressUp/DressUpUtil.cs

@@ -229,10 +229,10 @@ namespace GFGGame
             TryRemoveAnimationObj(parentObj, aniObjName);
             string ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType);
             GameObject gameObject = AddSpriteObj(res, ext, spritObjName, parentObj, sortingOrder, needSetMask);
-            // if (itemCfg.subType == (int)ConstDressUpItemType.BEI_JING)
-            // {
-            //     gameObject.layer = 3;//设置bg层
-            // }
+            if (itemCfg.subType == (int)ConstDressUpItemType.BEI_JING)
+            {
+                gameObject.layer = LayerMask.NameToLayer("Bg"); ;//设置bg层
+            }
             if (itemCfg.isAni > 0 && showAni)
             {
                 AddAnimationObj(res, aniObjName, parentObj, sortingOrder);
@@ -450,13 +450,13 @@ namespace GFGGame
         public static NTexture GetPrintscreenNTexture(Camera camera)
         {
             Rect rect = new Rect(0, 0, UnityEngine.Screen.width, UnityEngine.Screen.height);
-            RenderTexture render = new RenderTexture((int)rect.width, (int)rect.height, 0);//创建一个RenderTexture对象 
+            RenderTexture render = new RenderTexture((int)rect.width, (int)rect.height, -1);//创建一个RenderTexture对象 
 
             // camera.gameObject.SetActive(true);//启用截图相机
             camera.targetTexture = render;//设置截图相机的targetTexture为render
             camera.Render();//手动开启截图相机的渲染
-            RenderTexture.active = render;//激活RenderTexture
 
+            RenderTexture.active = render;//激活RenderTexture
             Texture2D tex = new Texture2D((int)rect.width, (int)rect.height, TextureFormat.ARGB32, false);//新建一个Texture2D对象
             tex.ReadPixels(rect, 0, 0);//读取像素
             tex.Apply();//保存像素信息
@@ -464,7 +464,7 @@ namespace GFGGame
             camera.targetTexture = null;//重置截图相机的targetTexture
             RenderTexture.active = null;//关闭RenderTexture的激活状态
             Object.Destroy(render);//删除RenderTexture对象
-            // camera.gameObject.SetActive(false);
+            // camera.gameObject.SetActive(true);
 
             return new NTexture(tex);