Helper Scripts Collection 1.3.1
API documentation for the helper scripts compatible with Unity3D
Public Member Functions | Public Attributes | Protected Attributes | Properties | Events | List of all members
NikosAssets.Helpers.BaseDestinationContainerMono< ComponentType > Class Template Reference

A helper class that stores and offers methods for its list of generic ComponentTypes and emits events if the Destinations list was modified using methods of this class More...

Public Member Functions

virtual bool AddToDestinations (ComponentType comp, bool addDistinct=false)
 Adds the given type only if it is not null and either if no duplicate is found or if addDistinct is false. Emits the OnDestinationAddedUnityEvent and OnDestinationAdded events on success. More...
 
virtual void AddMultipleToDestinations (List< ComponentType > componentTypes, bool addDistinct=false)
 A helper method to add multiple ComponentTypes to the Destinations list, also emitting the OnDestinationAddedUnityEvent and OnDestinationAdded events. More...
 
virtual void RemoveAllFromDestinations ()
 Removes all items from the Destinations list and emits the OnDestinationRemovedUnityEvent and OnDestinationRemoved events.
 
virtual bool RemoveFromDestinations (ComponentType comp)
 Removes the given type and emits the OnDestinationRemovedUnityEvent and OnDestinationRemoved events on success. More...
 
virtual bool RemoveFromDestinationsAt (int index)
 Remove and emit events at index More...
 
virtual List< ComponentType > GetDestinationsWithExcluded (List< ComponentType > excludeDestinations, bool removeFoundDoubleFromExclusiveList)
 

Public Attributes

OnDestinationListChangedUnityEvent OnDestinationAddedUnityEvent
 
OnDestinationListChangedUnityEvent OnDestinationRemovedUnityEvent
 
Action< ComponentType > OnDestinationRemoved
 

Protected Attributes

List< ComponentType > _destinations = new List<ComponentType>()
 

Properties

List< ComponentType > Destinations [get]
 

Events

Action< ComponentType > OnDestinationAdded
 

Detailed Description

A helper class that stores and offers methods for its list of generic ComponentTypes and emits events if the Destinations list was modified using methods of this class

Template Parameters
ComponentTypeThe type stored in the Destinations list.
Type Constraints
ComponentType :Component 

Member Function Documentation

◆ AddMultipleToDestinations()

virtual void NikosAssets.Helpers.BaseDestinationContainerMono< ComponentType >.AddMultipleToDestinations ( List< ComponentType >  componentTypes,
bool  addDistinct = false 
)
virtual

A helper method to add multiple ComponentTypes to the Destinations list, also emitting the OnDestinationAddedUnityEvent and OnDestinationAdded events.

Parameters
componentTypes
addDistinctAre duplicates allowed?

◆ AddToDestinations()

virtual bool NikosAssets.Helpers.BaseDestinationContainerMono< ComponentType >.AddToDestinations ( ComponentType  comp,
bool  addDistinct = false 
)
virtual

Adds the given type only if it is not null and either if no duplicate is found or if addDistinct is false. Emits the OnDestinationAddedUnityEvent and OnDestinationAdded events on success.

Parameters
comp
addDistinct
Returns
false if couldn't add, otherwise true

◆ RemoveFromDestinations()

virtual bool NikosAssets.Helpers.BaseDestinationContainerMono< ComponentType >.RemoveFromDestinations ( ComponentType  comp)
virtual

Removes the given type and emits the OnDestinationRemovedUnityEvent and OnDestinationRemoved events on success.

Parameters
comp
Returns
false if couldn't remove, otherwise true

◆ RemoveFromDestinationsAt()

virtual bool NikosAssets.Helpers.BaseDestinationContainerMono< ComponentType >.RemoveFromDestinationsAt ( int  index)
virtual

Remove and emit events at index

Parameters
index
Returns
true on removal success, otherwise false