Class KaijuAgentsManager
Manager KaijuAgents.
Inherited Members
Namespace: KaijuSolutions.Agents
Syntax
public class KaijuAgentsManager : KaijuBehaviour
Properties
Agents
All KaijuAgents.
Declaration
public static IReadOnlyCollection<KaijuAgent> Agents { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<KaijuAgent> |
AgentsCount
The number of KaijuAgents.
Declaration
public static int AgentsCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
EditorAgentColor
What color KaijuAgent visualizations should be in the editor.
Declaration
public static Color EditorAgentColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
EditorLabelOffset
The offset for label placement in the editor.
Declaration
public static float EditorLabelOffset { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Instance
The singleton manager instance.
Declaration
public static KaijuAgentsManager Instance { get; }
Property Value
| Type | Description |
|---|---|
| KaijuAgentsManager |
Methods
AddIdentifier(KaijuAgent, UInt32)
Add an identifier to an KaijuAgent. There is no use for manually calling this.
Declaration
public static void AddIdentifier(KaijuAgent agent, uint identifier)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent. |
| System.UInt32 | identifier | The identifier. |
EditorLabel(Vector3, String, Color)
Add a label of text in the scene view in the editor.
Declaration
public static void EditorLabel(Vector3 position, string text, Color color)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position to set it at. |
| System.String | text | The label itself |
| Color | color | The color for the text. |
EditorLoadColor(String, Color)
Load a color from preferences in the editor.
Declaration
public static Color EditorLoadColor(string key, Color fallback)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The color key to retrieve. |
| Color | fallback | The fallback color if this is a default value. |
Returns
| Type | Description |
|---|---|
| Color | The color loaded from preferences. |
EditorResetAgentColor()
Reset the KaijuAgent color in the editor.
Declaration
public static void EditorResetAgentColor()
EditorResetColor(String)
Reset a color to preferences in the editor.
Declaration
public static void EditorResetColor(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The color key to reset. |
EditorResetLabelOffset()
Reset the offset for label placement in the editor.
Declaration
public static void EditorResetLabelOffset()
EditorSaveColor(String, Color)
Save a color to preferences in the editor.
Declaration
public static void EditorSaveColor(string key, Color color)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The color key to save. |
| Color | color | The color to set. |
EditorValidateIdentifiers(KaijuAgent)
Validate the identifiers of an KaijuAgent in the editor. There is no use for manually calling this.
Declaration
public static void EditorValidateIdentifiers(KaijuAgent agent)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent. |
GetCached<T>(ICollection<Type>)
Get a cached KaijuAgent to spawn.
Declaration
public static T GetCached<T>(ICollection<Type> components = null)
where T : KaijuAgent
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.ICollection<System.Type> | components | All components which must be found on the KaijuAgent. This will check in children as well. |
Returns
| Type | Description |
|---|---|
| T | A cached KaijuAgent if one is found, otherwise NULL. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of KaijuAgent. |
IdentifiedAgents(ICollection<KaijuAgent>, IEnumerable<UInt32>)
Get all KaijuAgents which have any of the given identifiers. The KaijuAgents are added to the identified parameter.
Declaration
public static void IdentifiedAgents(ICollection<KaijuAgent> identified, IEnumerable<uint> identifiers)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.ICollection<KaijuAgent> | identified | Updated to contain all KaijuAgents which were identified. |
| System.Collections.Generic.IEnumerable<System.UInt32> | identifiers | The identifiers. |
IdentifiedAgents(IEnumerable<UInt32>)
Get all KaijuAgents which have any of the given identifiers.
Declaration
public static HashSet<KaijuAgent> IdentifiedAgents(IEnumerable<uint> identifiers)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.UInt32> | identifiers | The identifiers. |
Returns
| Type | Description |
|---|---|
| HashSet<KaijuAgent> | All KaijuAgents which have any of the given identifier. |
IdentifiedAgents(UInt32)
Get all KaijuAgents with a given identifier.
Declaration
public static IReadOnlyCollection<KaijuAgent> IdentifiedAgents(uint identifier)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | identifier | The identifier. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<KaijuAgent> | All KaijuAgents with a given identifier. |
Register(KaijuAgent)
Register an KaijuAgent for movement.
Declaration
public static void Register(KaijuAgent agent)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent to register. |
RemoveIdentifier(KaijuAgent, UInt32)
Remove an identifier from an KaijuAgent. There is no use for manually calling this.
Declaration
public static void RemoveIdentifier(KaijuAgent agent, uint identifier)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent. |
| System.UInt32 | identifier | The identifier. |
Unregister(KaijuAgent, Boolean)
Unregister an KaijuAgent for movement.
Declaration
public static void Unregister(KaijuAgent agent, bool cache = true)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent to unregister. |
| System.Boolean | cache | If this KaijuAgent should be cached. |
Operators
Implicit(KaijuAgentsManager to Int16)
Implicit conversion to a short integer based AgentsCount.
Declaration
public static implicit operator short (KaijuAgentsManager m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgentsManager | m | The KaijuAgent manager. |
Returns
| Type | Description |
|---|---|
| System.Int16 |
Implicit(KaijuAgentsManager to Int32)
Implicit conversion to an integer based AgentsCount.
Declaration
public static implicit operator int (KaijuAgentsManager m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgentsManager | m | The KaijuAgent manager. |
Returns
| Type | Description |
|---|---|
| System.Int32 |
Implicit(KaijuAgentsManager to Int64)
Implicit conversion to a long integer based AgentsCount.
Declaration
public static implicit operator long (KaijuAgentsManager m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgentsManager | m | The KaijuAgent manager. |
Returns
| Type | Description |
|---|---|
| System.Int64 |
Implicit(KaijuAgentsManager to Nullable<Int16>)
Implicit conversion to a nullable short integer based AgentsCount.
Declaration
public static implicit operator short? (KaijuAgentsManager m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgentsManager | m | The KaijuAgent manager. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Int16> |
Implicit(KaijuAgentsManager to Nullable<Int32>)
Implicit conversion to a nullable integer based AgentsCount.
Declaration
public static implicit operator int? (KaijuAgentsManager m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgentsManager | m | The KaijuAgent manager. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Int32> |
Implicit(KaijuAgentsManager to Nullable<Int64>)
Implicit conversion to a nullable long integer based AgentsCount.
Declaration
public static implicit operator long? (KaijuAgentsManager m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgentsManager | m | The KaijuAgent manager. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Int64> |
Implicit(KaijuAgentsManager to Nullable<UInt16>)
Implicit conversion to a nullable unsigned short integer based AgentsCount.
Declaration
public static implicit operator ushort? (KaijuAgentsManager m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgentsManager | m | The KaijuAgent manager. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.UInt16> |
Implicit(KaijuAgentsManager to Nullable<UInt32>)
Implicit conversion to a nullable unsigned integer based AgentsCount.
Declaration
public static implicit operator uint? (KaijuAgentsManager m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgentsManager | m | The KaijuAgent manager. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.UInt32> |
Implicit(KaijuAgentsManager to Nullable<UInt64>)
Implicit conversion to a nullable unsigned long integer based AgentsCount.
Declaration
public static implicit operator ulong? (KaijuAgentsManager m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgentsManager | m | The KaijuAgent manager. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.UInt64> |
Implicit(KaijuAgentsManager to UInt16)
Implicit conversion to an unsigned short integer based AgentsCount.
Declaration
public static implicit operator ushort (KaijuAgentsManager m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgentsManager | m | The KaijuAgent manager. |
Returns
| Type | Description |
|---|---|
| System.UInt16 |
Implicit(KaijuAgentsManager to UInt32)
Implicit conversion to an unsigned integer based AgentsCount.
Declaration
public static implicit operator uint (KaijuAgentsManager m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgentsManager | m | The KaijuAgent manager. |
Returns
| Type | Description |
|---|---|
| System.UInt32 |
Implicit(KaijuAgentsManager to UInt64)
Implicit conversion to an unsigned long integer based AgentsCount.
Declaration
public static implicit operator ulong (KaijuAgentsManager m)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgentsManager | m | The KaijuAgent manager. |
Returns
| Type | Description |
|---|---|
| System.UInt64 |