PropertyInterface
Nectunia.PropertyInterface.Tags Class Reference

Detailed Description

List of Tag stored in a ScriptableObject file in the Asset folder.

  1. This is a singleton. /!\ You should only acces it by using "Tags.Instance". /!<br>
  2. Tags are automaticaly load when Unity Editor is opened so you don't need to instanciate them.
  3. If many file exist only the first one found at random will be load.
// To get the Tag list
List<Tag> tagsList = Tags.Instance.TagsList;
// To get a specifique Tag with it's TagID
long tagID1 = 111111111; // TagID have an implicite conversion with long value
TagID tagID2 = tagsList[1].Id;
Tag tag1 = tagsList.Find(t => t.Id == tagID1);
Tag tag2 = tagsList.Find(t => t.Id == tagID2);
Tag tag3 = Tags.GetTagByID(3333333333) // TagID have an implicite conversion with long value
Tag tag4 = Tags.GetTagByID(tagID2)
// To set a specifique Tag
tagsList[1] = tag1;
Tags.Instance.TagsList[0] = tag2;
Tags.Instance.TagsList[3].Id = 44444444; // TagID have an implicite conversion with long value
Inheritance diagram for Nectunia.PropertyInterface.Tags:

Properties

List< TagTagsList [get, set]
 The Tag list. More...
 
static string AssetFilePath [get]
 The path where the Tags file is saved. More...
 
static Tags Instance [get]
 Get the Tags instance. More...
 

Static Public Attributes

const string C_DEFAULT_ASSET_FILE_PATH = "Assets/Plugins/PropertyInterface/Resources"
 The default Path where the Tags file will be saved. More...
 
const string C_DEFAULT_TAGS_FILE_NAME = "Tags.asset"
 The default file name to save the Tags file. More...
 

Public Member Functions

delegate void OnChangedTagListDelegate ()
 
delegate void OnAfterUndoRedoDelegate ()
 
delegate void OnChangedTagDelegate (Tag tag)
 
void OnEnable ()
 
void OnDisable ()
 
void OnChangedTagList ()
 Handler triggered when Tags has been changed. More...
 
void OnChangedTag (Tag tag)
 Handler triggered when a Tag is delete to the Tag list. More...
 
void OnAfterUndoRedo ()
 Handler triggered when undo is performed. More...
 

Static Public Member Functions

static void OnEditorLoaded ()
 Force Tags load when Editor is loading. More...
 
static string GetGUID ()
 Get the GUID of the asset file if it exist. More...
 
static Tag GetTagByID (TagID tagID)
 Get the GUID of the asset file if it exist. More...
 
static void SaveAsset ()
 Save the modifications on the .asset file. More...
 

Events

OnChangedTagListDelegate OnChangedTagListCallBack
 
OnChangedTagDelegate OnChangedTagCallBack
 
OnAfterUndoRedoDelegate OnAfterUndoRedoCallBack
 

Property Documentation

◆ AssetFilePath

string Nectunia.PropertyInterface.Tags.AssetFilePath
staticget

The path where the Tags file is saved.

◆ Instance

Tags Nectunia.PropertyInterface.Tags.Instance
staticget

Get the Tags instance.

This should be the only way to access Tags.

◆ TagsList

List<Tag> Nectunia.PropertyInterface.Tags.TagsList
getset

The Tag list.

Member Function Documentation

◆ GetGUID()

static string Nectunia.PropertyInterface.Tags.GetGUID ( )
static

Get the GUID of the asset file if it exist.

Returns
The GUID if the file exist, "" otherwise.

◆ GetTagByID()

static Tag Nectunia.PropertyInterface.Tags.GetTagByID ( TagID  tagID)
static

Get the GUID of the asset file if it exist.

Returns
The GUID if the file exist, "" otherwise.

◆ OnAfterUndoRedo()

void Nectunia.PropertyInterface.Tags.OnAfterUndoRedo ( )

Handler triggered when undo is performed.

◆ OnAfterUndoRedoDelegate()

delegate void Nectunia.PropertyInterface.Tags.OnAfterUndoRedoDelegate ( )

◆ OnChangedTag()

void Nectunia.PropertyInterface.Tags.OnChangedTag ( Tag  tag)

Handler triggered when a Tag is delete to the Tag list.

◆ OnChangedTagDelegate()

delegate void Nectunia.PropertyInterface.Tags.OnChangedTagDelegate ( Tag  tag)

◆ OnChangedTagList()

void Nectunia.PropertyInterface.Tags.OnChangedTagList ( )

Handler triggered when Tags has been changed.

◆ OnChangedTagListDelegate()

delegate void Nectunia.PropertyInterface.Tags.OnChangedTagListDelegate ( )

◆ OnDisable()

void Nectunia.PropertyInterface.Tags.OnDisable ( )

◆ OnEditorLoaded()

static void Nectunia.PropertyInterface.Tags.OnEditorLoaded ( )
static

Force Tags load when Editor is loading.

◆ OnEnable()

void Nectunia.PropertyInterface.Tags.OnEnable ( )

◆ SaveAsset()

static void Nectunia.PropertyInterface.Tags.SaveAsset ( )
static

Save the modifications on the .asset file.

Event Documentation

◆ OnAfterUndoRedoCallBack

OnAfterUndoRedoDelegate Nectunia.PropertyInterface.Tags.OnAfterUndoRedoCallBack

◆ OnChangedTagCallBack

OnChangedTagDelegate Nectunia.PropertyInterface.Tags.OnChangedTagCallBack

◆ OnChangedTagListCallBack

OnChangedTagListDelegate Nectunia.PropertyInterface.Tags.OnChangedTagListCallBack

Member Data Documentation

◆ C_DEFAULT_ASSET_FILE_PATH

const string Nectunia.PropertyInterface.Tags.C_DEFAULT_ASSET_FILE_PATH = "Assets/Plugins/PropertyInterface/Resources"
static

The default Path where the Tags file will be saved.

◆ C_DEFAULT_TAGS_FILE_NAME

const string Nectunia.PropertyInterface.Tags.C_DEFAULT_TAGS_FILE_NAME = "Tags.asset"
static

The default file name to save the Tags file.