C# Класс HoloToolkit.Sharing.Utilities.Utils

Показать файл Открыть проект

Открытые методы

Метод Описание
ConnectCylinderBetweenPoints ( Transform endPointSpace, Vector3 a, Vector3 b, Transform cylTransform ) : void

Given two points and the transform that they are in, set position, rotation, and scale of a cylinder transform to connect it between the two points

GetChildRecursive ( Transform t, string name ) : Transform

walk hierarchy looking for named transform

IsInEditor ( ) : bool

helper for detecting if running in editor

Map ( float minA, float maxA, float minB, float maxB, float value ) : float

This takes a value, whose proportions are defined by minA and maxA, and scales it to a space defined by minB and maxB. For example, 5 in the space of 0 to 10 will map to 50 in the space of 0 to 100.

MapAndClamp ( float minA, float maxA, float minB, float maxB, float value ) : float

This wrapper performs a map, but sets the results upper and lower limit based on the upper and lower bounds of the new scale.

MoveObjectInFrontOfUser ( Transform stageTransform, Transform tran, Vector3 offset, float yawOffset ) : void

Position transform along the gaze direction and orient yaw to match, with the specified offset

SetLayerRecursively ( GameObject gameObject, int layer ) : void
SetMaterialRecursive ( Transform t, Material mat ) : void

Change material for every object in hierarchy

SetMaterialRecursiveForName ( Transform t, Material mat, string nameToTest ) : void

Change material for every object in hierarchy which has a name equal to nameToTest

Описание методов

ConnectCylinderBetweenPoints() публичный статический Метод

Given two points and the transform that they are in, set position, rotation, and scale of a cylinder transform to connect it between the two points
public static ConnectCylinderBetweenPoints ( Transform endPointSpace, Vector3 a, Vector3 b, Transform cylTransform ) : void
endPointSpace UnityEngine.Transform
a UnityEngine.Vector3 One end point in the space of endPointSpace
b UnityEngine.Vector3 Other end point in the space of endPointSpace
cylTransform UnityEngine.Transform transform for the cylinder primitive to connect
Результат void

GetChildRecursive() публичный статический Метод

walk hierarchy looking for named transform
public static GetChildRecursive ( Transform t, string name ) : Transform
t UnityEngine.Transform root transform to start searching from
name string name to look for
Результат UnityEngine.Transform

IsInEditor() публичный статический Метод

helper for detecting if running in editor
public static IsInEditor ( ) : bool
Результат bool

Map() публичный статический Метод

This takes a value, whose proportions are defined by minA and maxA, and scales it to a space defined by minB and maxB. For example, 5 in the space of 0 to 10 will map to 50 in the space of 0 to 100.
public static Map ( float minA, float maxA, float minB, float maxB, float value ) : float
minA float lower bound for the original scale
maxA float upper bound for the original scale
minB float lower bound for new scale
maxB float upper bound for new scale
value float the original scale value to convert to the new /// scale.
Результат float

MapAndClamp() публичный статический Метод

This wrapper performs a map, but sets the results upper and lower limit based on the upper and lower bounds of the new scale.
public static MapAndClamp ( float minA, float maxA, float minB, float maxB, float value ) : float
minA float lower bound for the original scale
maxA float upper bound for the original scale
minB float lower bound for new scale
maxB float upper bound for new scale
value float the original scale value to convert to the new /// scale.
Результат float

MoveObjectInFrontOfUser() публичный статический Метод

Position transform along the gaze direction and orient yaw to match, with the specified offset
public static MoveObjectInFrontOfUser ( Transform stageTransform, Transform tran, Vector3 offset, float yawOffset ) : void
stageTransform UnityEngine.Transform transform of higher-level space where 0,1,0 is up
tran UnityEngine.Transform transform to be repositioned
offset UnityEngine.Vector3 translation offset, Z is forward
yawOffset float yaw offset
Результат void

SetLayerRecursively() публичный статический Метод

public static SetLayerRecursively ( GameObject gameObject, int layer ) : void
gameObject UnityEngine.GameObject
layer int
Результат void

SetMaterialRecursive() публичный статический Метод

Change material for every object in hierarchy
public static SetMaterialRecursive ( Transform t, Material mat ) : void
t UnityEngine.Transform root transform to start looking for renderers
mat UnityEngine.Material material to set everything to
Результат void

SetMaterialRecursiveForName() публичный статический Метод

Change material for every object in hierarchy which has a name equal to nameToTest
public static SetMaterialRecursiveForName ( Transform t, Material mat, string nameToTest ) : void
t UnityEngine.Transform root transform to start looking for renderers
mat UnityEngine.Material material to set everything to
nameToTest string
Результат void