Class Utils
Utility methods
Inheritance
Namespace: TofAr.V0
Assembly: TofArAssembly.dll
Syntax
public static class Utils
Methods
DirectoryContainsNoSymlinks(String)
Check directory for no symbolic links
Declaration
public static bool DirectoryContainsNoSymlinks(string folder)
Parameters
Type | Name | Description |
---|---|---|
System.String | folder | Directory path |
Returns
Type | Description |
---|---|
System.Boolean | If true, directory does not contain any symbolic links |
FillArray<T>(T[], T)
Set fillValue to all elements of the array
Declaration
public static bool FillArray<T>(T[] array, T fillValue)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | Array |
T | fillValue | Value to fill with |
Returns
Type | Description |
---|---|
System.Boolean | Returns true on success |
Type Parameters
Name | Description |
---|---|
T | Data type of array elements |
FindFirstActiveGameObjectThatImplements<T>()
Search for GameObjects that implement components of type T in the scene and get the first component found
Declaration
public static T FindFirstActiveGameObjectThatImplements<T>()
where T : class
Returns
Type | Description |
---|---|
T | Component if found, null if not found |
Type Parameters
Name | Description |
---|---|
T | Class of the component to search for |
FormatException(Exception)
Get formatted Exception message
Declaration
public static string FormatException(Exception exception)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | exception | Exception |
Returns
Type | Description |
---|---|
System.String | Message |
GetUnixTimestampAsNanoSeconds()
Get elapsed time from 1970/1/1 00:00:00 (Unix's StartDate) until now
Declaration
public static long GetUnixTimestampAsNanoSeconds()
Returns
Type | Description |
---|---|
System.Int64 | Elapsed time until now |
MapEuler(Vector3)
Map -180°~+180°euler angle to 0°~360°
Declaration
public static Vector3 MapEuler(Vector3 input)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | input | -180°~+180°euler angle |
Returns
Type | Description |
---|---|
UnityEngine.Vector3 | 0°~360°euler angle |
PathIsSymlink(String)
Check if path is a symbolic link
Declaration
public static bool PathIsSymlink(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Path to check |
Returns
Type | Description |
---|---|
System.Boolean | If true, path is a symbolic link |