Class ObjectRepository<T>
This repository implementation manages the storage of Unity objects as assets.
Inheritance
System.Object
ObjectRepository<T>
Syntax
public class ObjectRepository<T> : IRepository<T>, IRepository where T : Object
Type Parameters
Name |
Description |
T |
The type of Unity object
|
Constructors
Declaration
public ObjectRepository(string location, AssetWatcher assetWatcher, string assetExtension = "asset")
Parameters
Type |
Name |
Description |
System.String |
location |
|
AssetWatcher |
assetWatcher |
|
System.String |
assetExtension |
|
Properties
AddAction
Gets/sets the action done on adding.
Declaration
public Action<T, string, string> AddAction { get; set; }
Property Value
Type |
Description |
System.Action<T, System.String, System.String> |
|
Extension
Declaration
public string Extension { get; }
Property Value
Type |
Description |
System.String |
|
Location
Declaration
public string Location { get; }
Property Value
Type |
Description |
System.String |
|
Methods
Add(T)
Declaration
Parameters
Type |
Name |
Description |
T |
obj |
|
Add(IEnumerable<T>)
Declaration
public void Add(IEnumerable<T> storeObjects)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T> |
storeObjects |
|
Clear()
Declaration
CreateLocation()
Creates the location where the assets in this repository are stored, if it doesn't exist yet.
Declaration
public void CreateLocation()
Get(String)
Declaration
public T Get(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
GetAll()
Declaration
Returns
GetAllNames()
Declaration
public string[] GetAllNames()
Returns
Type |
Description |
System.String[] |
|
Remove(String)
Declaration
public void Remove(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Rename(String, String)
Declaration
public void Rename(string currentName, string newName)
Parameters
Type |
Name |
Description |
System.String |
currentName |
|
System.String |
newName |
|
Replace(T)
Declaration
public bool Replace(T newObj)
Parameters
Type |
Name |
Description |
T |
newObj |
|
Returns
Type |
Description |
System.Boolean |
|
ReplaceOrAdd(T)
Declaration
public void ReplaceOrAdd(T obj)
Parameters
Type |
Name |
Description |
T |
obj |
|
Events
OnAdded
Declaration
public event Action<T> OnAdded
Event Type
Type |
Description |
System.Action<T> |
|
Implements