Class ObjectTypeSetScriptableObject<TType, TEntry, TObject>
Object type set stored as a scriptable object.
Inheritance
System.Object
ObjectTypeSetScriptableObject<TType, TEntry, TObject>
Syntax
public abstract class ObjectTypeSetScriptableObject<TType, TEntry, TObject> : DataSetScriptableObject<TType, OpenObjectTypeSet<TType, TEntry, TObject>>, IVersioned, IObjectTypeSet<TType, TObject>, IDataSet<TType>, IDataSet, IPreparable where TType : IObjectType<TEntry, TObject> where TEntry : IObjectTypeEntry<TObject> where TObject : UnityEngine.Object
Type Parameters
Name |
Description |
TType |
The type of the object type.
|
TEntry |
The type of the entries.
|
TObject |
The type of the object in the entries.
|
Methods
AddNewEntry(String)
Declaration
public void AddNewEntry(string typeId)
Parameters
Type |
Name |
Description |
System.String |
typeId |
|
Clean()
Declaration
GetEntryCount(String)
Declaration
public int GetEntryCount(string typeId)
Parameters
Type |
Name |
Description |
System.String |
typeId |
|
Returns
Type |
Description |
System.Int32 |
|
GetObject(String, Int32)
Declaration
public TObject GetObject(string typeId, int entryIndex)
Parameters
Type |
Name |
Description |
System.String |
typeId |
|
System.Int32 |
entryIndex |
|
Returns
GetRandomEntry(String, System.Random)
Gets a random entry of the given type.
Declaration
protected TEntry GetRandomEntry(string typeName, System.Random random)
Parameters
Type |
Name |
Description |
System.String |
typeName |
The type's name.
|
System.Random |
random |
The random instance used.
|
Returns
Type |
Description |
TEntry |
A random entry.
|
GetRandomObject(String, System.Random)
Gets the object for a random entry of the given type.
Declaration
public TObject GetRandomObject(string typeName, System.Random random)
Parameters
Type |
Name |
Description |
System.String |
typeName |
The type's name.
|
System.Random |
random |
The random instance used.
|
Returns
Type |
Description |
TObject |
A random object.
|
GetWeight(String, Int32)
Declaration
public float GetWeight(string typeId, int entryIndex)
Parameters
Type |
Name |
Description |
System.String |
typeId |
|
System.Int32 |
entryIndex |
|
Returns
Type |
Description |
System.Single |
|
IsWeightEnabled(String)
Declaration
public bool IsWeightEnabled(string typeId)
Parameters
Type |
Name |
Description |
System.String |
typeId |
|
Returns
Type |
Description |
System.Boolean |
|
MoveEntry(String, Int32, Int32)
Declaration
public void MoveEntry(string typeId, int oldIndex, int newIndex)
Parameters
Type |
Name |
Description |
System.String |
typeId |
|
System.Int32 |
oldIndex |
|
System.Int32 |
newIndex |
|
Prepare()
Declaration
public virtual void Prepare()
RemoveEntry(String, Int32)
Declaration
public void RemoveEntry(string typeId, int entryIndex)
Parameters
Type |
Name |
Description |
System.String |
typeId |
|
System.Int32 |
entryIndex |
|
SetObject(String, Int32, TObject)
Declaration
public void SetObject(string typeId, int entryIndex, TObject obj)
Parameters
Type |
Name |
Description |
System.String |
typeId |
|
System.Int32 |
entryIndex |
|
TObject |
obj |
|
SetWeight(String, Int32, Single)
Declaration
public void SetWeight(string typeId, int entryIndex, float weight)
Parameters
Type |
Name |
Description |
System.String |
typeId |
|
System.Int32 |
entryIndex |
|
System.Single |
weight |
|
SetWeightEnabled(String, Boolean)
Declaration
public void SetWeightEnabled(string typeId, bool enabled)
Parameters
Type |
Name |
Description |
System.String |
typeId |
|
System.Boolean |
enabled |
|
Events
OnEntryRemoved
Declaration
public event Action<string, int, TObject> OnEntryRemoved
Event Type
Type |
Description |
Action<System.String, System.Int32, TObject> |
|
OnEntrySet
Declaration
public event Action<string, int, TObject, TObject> OnEntrySet
Event Type
Type |
Description |
Action<System.String, System.Int32, TObject, TObject> |
|
Implements