Show / Hide Table of Contents

Class UnityExtensionMethods

Extension methods that do the actual snapshotting work

Inheritance
Object
UnityExtensionMethods
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: VISABConnector.Unity
Assembly: VISABConnector.Unity.dll
Syntax
public static class UnityExtensionMethods

Methods

| Improve this Doc View Source

CenterOn(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
| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX