BaseRendererToGraphicsInterfaceAdapter< TRendererType > Class Template Referenceabstract

Abstract base class from which all Unity renderer to GraphicsInterface adapters are descended. This class implements all the various IGraphics interfaces: IGraphicsMaterialPropertyBlockInterface, IGraphicsColorInterface, IGraphicsTexureInterface, IGraphicsBounds, and IGraphicsViewable.

Detailed Description

Template Parameters
TRendererTypeDescendants specify which type of Unity Renderer component they are adapting, with this parameter. TRendererType must be a Renderer derived class, of some kind.
Type Constraints
TRendererType :Renderer 

Public Member Functions

void GetPropertyBlock (out MaterialPropertyBlock dest)
 Matches the form of the unity Renderer function of the same name.
 
virtual void GetPropertyBlock (out MaterialPropertyBlock dest, int matIndex)
 Finds and sets the reference of parameter dest, to the Property block found in the renderer's material (at the provided index).
 
virtual bool HasColor ()
 Returns weather or not the material(first material on renderer) actually has a color value that can be used.
 
virtual bool HasColor (int matIndex)
 Specifies if the material the renderer uses (at the provided index), has a _Color
 
virtual bool HasTexture ()
 Returns weather or not the material(first material on renderer) actually has a texture variable that can be used.
 
virtual bool HasTexture (int matIndex)
 Specifies if the material the renderer uses (at the provided index), has a _MainTexture
 
virtual void RebuildPropertyBlock ()
 This function is called when an enabled state is changed. It clears the current property block, and re-adds the assigned color and, if not null, the assigned texture.
 
void RebuildPropertyBlock (int matIndex)
 This function will be invoked wen the property block needs to be rebuilt. For example, if it contains a texture, and a texture is added
 
void SetPropertyBlock (MaterialPropertyBlock dest)
 Matches the form of the unity Renderer function of the same name. Caches and assigns the provided MaterialPropertyBlock to the rendererRef.
 
virtual void SetPropertyBlock (MaterialPropertyBlock dest, int matIndex)
 Matches the form of the unity Renderer function of the same name. Caches and assigns the provided MaterialPropertyBlock to the rendererRef.
 
virtual void ValidateViewableState ()
 Invoked OnEnable to ensure that all descendants of this object in the hierarchy (that implement IGraphicsViewable), are set the same "viewable" state as this object.
 

Public Attributes

bool boundsIncludesDecendants
 Specified weather the bounds accessor should encapsulate the bounds of IGraphicsBounds of this GameObject's scene hierarchy descendants.
 
Texture currentMainTexture
 Cashed reference to the texture used.
 
bool isViewableIncludesDecendants
 When true, isViewable will return true if this object or ANY descendant IGraphicsViewable has isViewable return true.
 

Protected Member Functions

abstract Bounds GetLocalBounds ()
 Abstract function used to provide the local bounds of this object.
 

Protected Attributes

Color currentColor
 Stores the current color that is assigned to the material property block.
 

Properties

virtual Bounds bounds [get]
 Returns the local bounds of this object as defined by the virtual GetLocalBounds function. If the boundsIncludesDecendants member is true, the returned bounds will encapsulate all IGraphicsBounds scene descendants of this object.
 
virtual Color color [get, set]
 returns the currentColor that is assigned to the material property block. when set, checks enabled status, and caches then assigns the color to the material property block.
 
virtual bool colorInterfaceEnabled [get, set]
 This overridable accessor simply get/sets the stored enabled/disabled state of the color adapter. If false, changes to this components color, will NOT affect the renderer.
 
virtual bool isViewable [get, set]
 Return true if the rendererRef is enabled. Not affected by weather or not the object is actually visible by any camera. Setting this value will set the state of the refererRef. When isViewableIncludesDecendants is true; the getter will return true if ANY descendant IGraphicsViewable, or this object isViewable. And the setter will set the rendererRef enabled state for ALL descendant IGraphicsViewable components.
 
virtual Texture mainTexture [get, set]
 Get accessor returns the cashed currentMainTexture reference, assigned by the user to this IGraphicsTexureInterface. Assignment of a different texture will also set the texture used by the material in the rendererRef.
 
TRendererType rendererRef [get, set]
 Accessor to the Renderer being adapted. If no renderer has been specified, it will attempt to find a renderer of type TRendererType, attached to this GameObject.
 
virtual bool textureInterfaceEnabled [get, set]
 Used to enable/disable use of the texture provided. Changing this value will force a rebuild of the property block used to display the texture.
 
- Properties inherited from IGraphicsColorInterface
Color color [get, set]
 Accessor that stores and retries the color itself.
 
bool colorInterfaceEnabled [get, set]
 When set to false, the color is not actually changed.
 
- Properties inherited from IGraphicsTexureInterface
Texture mainTexture [get, set]
 accessor used to store and retrieve the texture itself.
 
bool textureInterfaceEnabled [get, set]
 specifies weather or not the interface should affect changes to the display, or not.
 
- Properties inherited from IGraphicsBounds
Bounds bounds [get]
 local bounds of object.
 
Transform transform [get]
 reference to the Transform of this object. Used when providing the bounds relative to another transform in the hierarchy.
 
- Properties inherited from IGraphicsViewable
bool isViewable [get, set]
 Accessor used to set/get the current isViewable state.
 
+ Inheritance diagram for BaseRendererToGraphicsInterfaceAdapter< TRendererType >:
+ Collaboration diagram for BaseRendererToGraphicsInterfaceAdapter< TRendererType >: