Class UnityExtensionMethods
Extension methods that do the actual snapshotting work
Inherited Members
Namespace: VISABConnector.Unity
Assembly: VISABConnector.Unity.dll
Syntax
public static class UnityExtensionMethods
Methods
| Improve this Doc View SourceCenterOn(Camera, GameObject)
Test method that centers the camera over the gameobject and makes it look at it. For testing purposes only.
Declaration
public static void CenterOn(this Camera cam, GameObject obj)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Camera | cam | |
UnityEngine.GameObject | obj |
FocusOn(Camera, GameObject, Single, Vector3)
Positions the camera over the gamobject
Declaration
public static void FocusOn(this Camera cam, GameObject focusedObject, float marginPercentage, Vector3 rotationAngle)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Camera | cam | The snapshot cam |
UnityEngine.GameObject | focusedObject | The game object to be snapped |
Single | marginPercentage | Adjusts the distance between object and camera |
UnityEngine.Vector3 | rotationAngle | The camera's rotation |
FocusOnAbsolute(Camera, GameObject, Single, Vector3)
Positions the camera exactly centered onto the according game object. But does not consider the object's bounds to determine the offset, rather the given parameter absoluteYOffset.
Declaration
public static void FocusOnAbsolute(this Camera cam, GameObject obj, float absoluteYOffset, Vector3 rotationAngle)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Camera | cam | The snapshot cam |
UnityEngine.GameObject | obj | The game object to be snapped |
Single | absoluteYOffset | The distance between object and camera |
UnityEngine.Vector3 | rotationAngle | The camera's rotation |
GetBoundsWithChildren(GameObject)
Returns the bounds of the gameobject including all of its children
Declaration
public static Bounds GetBoundsWithChildren(this GameObject gameObject)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.GameObject | gameObject | The gameobject that is supposed to be snapped |
Returns
Type | Description |
---|---|
UnityEngine.Bounds | The object's bounds |