跳到主要内容

GoWrapper

命名空间:FairyGUI
源码:Assets/Scripts/Core/GoWrapper.cs (行 11)

public class GoWrapper : DisplayObject

GoWrapper is class for wrapping common gameobject into UI display list.

继承:EventDispatcher → DisplayObject → GoWrapper

继承成员​

DisplayObject

onPaint, _contentRect, _flags, _paintingInfo, _paintingMode, _vertexMatrix, gOwner, id, name, CreateGameObject, DestroyGameObject, EnsureSizeCorrect, EnterPaintingMode, GetBounds, GetScreenShot, GlobalToLocal, HitTest, InvalidateBatchingState, LeavePaintingMode, LocalToGlobal, LocalToWorld, OnSizeChanged, RemoveFromParent, SetGameObject, SetPosition, SetScale, SetSize, SetXY, TransformPoint, TransformRect, TransformRectPoint, WorldToLocal, alpha, blendMode, cacheAsBitmap, cachedTransform, cursor, filter, focalLength, focusable, focused, gameObject, graphics, grayed, height, home, isDisposed, layer, location, material, onAddedToStage, onClickLink, onClick, onFocusIn, onFocusOut, onKeyDown, onMouseWheel, onRemovedFromStage, onRightClick, onRollOut, onRollOver, onTouchBegin, onTouchEnd, onTouchMove, paintingGraphics, paintingMode, parent, perspective, pivot, pixelPerfect, position, renderingOrder, rotationX, rotationY, rotation, scaleX, scaleY, scale, shader, size, skew, stage, tabStop, topmost, touchDisabled, touchable, visible, width, worldSpaceContainer, xy, x, y, z

EventDispatcher

AddCapture, AddEventListener, BroadcastEvent, BubbleEvent, DispatchEvent, RemoveCapture, RemoveEventListener, RemoveEventListeners, hasEventListeners, isDispatching

构造函数​

GoWrapper()​

public GoWrapper();

源码:Core/GoWrapper.cs (行 39)

GoWrapper(GameObject)​

public GoWrapper(GameObject go);
参数类型说明
goGameObject包装对象。

源码:Core/GoWrapper.cs (行 51)

事件​

onUpdate​

public event Action<UpdateContext> onUpdate;

源码:Core/GoWrapper.cs (行 16)

字段​

_canvas​

protected Canvas _canvas;

源码:Core/GoWrapper.cs (行 23)

_cloneMaterial​

protected bool _cloneMaterial;

源码:Core/GoWrapper.cs (行 24)

_materialsBackup​

protected Dictionary<Material, Material> _materialsBackup;

源码:Core/GoWrapper.cs (行 22)

_renderers​

protected List<RendererInfo> _renderers;

源码:Core/GoWrapper.cs (行 21)

_shouldCloneMaterial​

protected bool _shouldCloneMaterial;

源码:Core/GoWrapper.cs (行 25)

_wrapTarget​

protected GameObject _wrapTarget;

源码:Core/GoWrapper.cs (行 20)

customCloneMaterials​

public Action<Dictionary<Material, Material>> customCloneMaterials;

源码:Core/GoWrapper.cs (行 17)

customRecoverMaterials​

public Action customRecoverMaterials;

源码:Core/GoWrapper.cs (行 18)

helperTransformList​

protected static List<Transform> helperTransformList;

源码:Core/GoWrapper.cs (行 34)

supportStencil​

public bool supportStencil;

源码:Core/GoWrapper.cs (行 14)

方法​

AddToBatch(List<BatchElement>, bool)​

public override BatchElement AddToBatch(List<BatchElement> batchElements, bool force);
参数类型说明
batchElementsList<BatchElement>
forcebool

源码:Core/GoWrapper.cs (行 285)

ApplyClipping(UpdateContext)​

virtual protected void ApplyClipping(UpdateContext context);
参数类型说明
contextUpdateContext

源码:Core/GoWrapper.cs (行 334)

CacheRenderers()​

public void CacheRenderers();

GoWrapper will cache all renderers of your gameobject on constructor. If your gameobject change laterly, call this function to update the cache. GoWrapper会在构造函数里查询你的gameobject所有的Renderer并保存。如果你的gameobject 后续发生了改变,调用这个函数通知GoWrapper重新查询和保存。

源码:Core/GoWrapper.cs (行 136)

Dispose()​

public override void Dispose();

源码:Core/GoWrapper.cs (行 378)

SetGoLayers(int)​

protected void SetGoLayers(int layer);
参数类型说明
layerint

源码:Core/GoWrapper.cs (行 308)

SetLayer(int, bool)​

override protected bool SetLayer(int value, bool fromParent);
参数类型说明
valueint
fromParentbool

源码:Core/GoWrapper.cs (行 297)

SetRenderingOrder(UpdateContext, bool)​

public override void SetRenderingOrder(UpdateContext context, bool inBatch);
参数类型说明
contextUpdateContext
inBatchbool

源码:Core/GoWrapper.cs (行 261)

SetWrapTarget(GameObject, bool)​

public void SetWrapTarget(GameObject target, bool cloneMaterial);

设置包装对象。注意如果原来有包装对象,设置新的包装对象后,原来的包装对象只会被删除引用,但不会被销毁。

参数类型说明
targetGameObject
cloneMaterialbool如果true,则复制材质,否则直接使用sharedMaterial。

源码:Core/GoWrapper.cs (行 77)

Update(UpdateContext)​

override public void Update(UpdateContext context);
参数类型说明
contextUpdateContext

源码:Core/GoWrapper.cs (行 320)

setWrapTarget(GameObject, bool)​

public void setWrapTarget(GameObject target, bool cloneMaterial);
参数类型说明
targetGameObject
cloneMaterialbool

源码:Core/GoWrapper.cs (行 66)

属性​

wrapTarget​

public GameObject wrapTarget { get; set; }

设置包装对象。注意如果原来有包装对象,设置新的包装对象后,原来的包装对象只会被删除引用,但不会被销毁。 对象包含的所有材质不会被复制,如果材质已经是公用的,这可能影响到其他对象。如果希望自动复制,改为使用SetWrapTarget(target, true)设置。

源码:Core/GoWrapper.cs (行 60)