Skip to main content

GoWrapper

Namespace:FairyGUI
Source:Assets/Scripts/Core/GoWrapper.cs (line 11)

public class GoWrapper : DisplayObject

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

Inheritance:EventDispatcher → DisplayObject → GoWrapper

Inherited members​

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

Constructors​

GoWrapper()​

public GoWrapper();

Source:Core/GoWrapper.cs (line 39)

GoWrapper(GameObject)​

public GoWrapper(GameObject go);
ParameterTypeDescription
goGameObject包装对象。

Source:Core/GoWrapper.cs (line 51)

Events​

onUpdate​

public event Action<UpdateContext> onUpdate;

Source:Core/GoWrapper.cs (line 16)

Fields​

_canvas​

protected Canvas _canvas;

Source:Core/GoWrapper.cs (line 23)

_cloneMaterial​

protected bool _cloneMaterial;

Source:Core/GoWrapper.cs (line 24)

_materialsBackup​

protected Dictionary<Material, Material> _materialsBackup;

Source:Core/GoWrapper.cs (line 22)

_renderers​

protected List<RendererInfo> _renderers;

Source:Core/GoWrapper.cs (line 21)

_shouldCloneMaterial​

protected bool _shouldCloneMaterial;

Source:Core/GoWrapper.cs (line 25)

_wrapTarget​

protected GameObject _wrapTarget;

Source:Core/GoWrapper.cs (line 20)

customCloneMaterials​

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

Source:Core/GoWrapper.cs (line 17)

customRecoverMaterials​

public Action customRecoverMaterials;

Source:Core/GoWrapper.cs (line 18)

helperTransformList​

protected static List<Transform> helperTransformList;

Source:Core/GoWrapper.cs (line 34)

supportStencil​

public bool supportStencil;

Source:Core/GoWrapper.cs (line 14)

Methods​

AddToBatch(List<BatchElement>, bool)​

public override BatchElement AddToBatch(List<BatchElement> batchElements, bool force);
ParameterTypeDescription
batchElementsList<BatchElement>
forcebool

Source:Core/GoWrapper.cs (line 285)

ApplyClipping(UpdateContext)​

virtual protected void ApplyClipping(UpdateContext context);
ParameterTypeDescription
contextUpdateContext

Source:Core/GoWrapper.cs (line 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重新查询和保存。

Source:Core/GoWrapper.cs (line 136)

Dispose()​

public override void Dispose();

Source:Core/GoWrapper.cs (line 378)

SetGoLayers(int)​

protected void SetGoLayers(int layer);
ParameterTypeDescription
layerint

Source:Core/GoWrapper.cs (line 308)

SetLayer(int, bool)​

override protected bool SetLayer(int value, bool fromParent);
ParameterTypeDescription
valueint
fromParentbool

Source:Core/GoWrapper.cs (line 297)

SetRenderingOrder(UpdateContext, bool)​

public override void SetRenderingOrder(UpdateContext context, bool inBatch);
ParameterTypeDescription
contextUpdateContext
inBatchbool

Source:Core/GoWrapper.cs (line 261)

SetWrapTarget(GameObject, bool)​

public void SetWrapTarget(GameObject target, bool cloneMaterial);

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

ParameterTypeDescription
targetGameObject
cloneMaterialbool如果true,则复制材质,否则直接使用sharedMaterial。

Source:Core/GoWrapper.cs (line 77)

Update(UpdateContext)​

override public void Update(UpdateContext context);
ParameterTypeDescription
contextUpdateContext

Source:Core/GoWrapper.cs (line 320)

setWrapTarget(GameObject, bool)​

public void setWrapTarget(GameObject target, bool cloneMaterial);
ParameterTypeDescription
targetGameObject
cloneMaterialbool

Source:Core/GoWrapper.cs (line 66)

Properties​

wrapTarget​

public GameObject wrapTarget { get; set; }

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

Source:Core/GoWrapper.cs (line 60)