diff --git a/Assets/Scripts/Core/DisplayObject.cs b/Assets/Scripts/Core/DisplayObject.cs index 11c79c62..5130b2d7 100644 --- a/Assets/Scripts/Core/DisplayObject.cs +++ b/Assets/Scripts/Core/DisplayObject.cs @@ -1764,7 +1764,7 @@ virtual protected bool SetLayer(int value, bool fromParent) return true; } - internal void _SetLayerDirect(int value) + virtual internal void _SetLayerDirect(int value) { if (_paintingMode > 0) paintingGraphics.gameObject.layer = value; diff --git a/Assets/Scripts/Core/GoWrapper.cs b/Assets/Scripts/Core/GoWrapper.cs index 077790d6..5b69c101 100644 --- a/Assets/Scripts/Core/GoWrapper.cs +++ b/Assets/Scripts/Core/GoWrapper.cs @@ -119,6 +119,24 @@ public void SetWrapTarget(GameObject target, bool cloneMaterial) } } + override internal void _SetLayerDirect(int value) + { + if (_paintingMode > 0) + paintingGraphics.gameObject.layer = value; + else + { + gameObject.layer = value; + if (_wrapTarget != null)//这个if是为了在GoWrapper里使用模糊效果 + { + _wrapTarget.layer = value; + foreach (Transform tf in _wrapTarget.GetComponentsInChildren(true)) + { + tf.gameObject.layer = value; + } + } + } + } + /// /// GoWrapper will cache all renderers of your gameobject on constructor. /// If your gameobject change laterly, call this function to update the cache.