Selector Manager
Last updated
Was this helpful?
Last updated
Was this helpful?
Is the global Manager, handles the Data, the Open and Close the selector, instantiate the Item. All other scripts must be childs gameobjects of the Selector Manager.
Key or Input from the Unity Input manager to Open and Close the Selector.
Start Open or Close when hit play.
Instantiate the Original GameObject of the Selected Item , if the Item does not have an Original GameObject it will instantiate the Item object itself.
Transform reference the position to instantiate the Item. If this parameter is empty, it will instantiate using the Selector Manager Transform as position reference.
Remove the Last spawned item and It will add the new one.
It will use Animation Transforms to animate the Target in an out when opening and closing the Selector.
Which transform the Animations will be applied to.
Animation Transform Asset to use as Open Animation.
Animation Transform Asset to use as Close Animation.
This is an Scriptable Object to save all the important values of the Selector.
Total of coins for the selector.
Restore all the values from to the Default Data.
Invoked when a item is selected. For dynamic methods, uses the Original GameObject as parameter.
Invoked when the Selector is Open. For dynamic methods, uses the Original GameObject as parameter.
As an Example you can check the Demo: Cards Linear Screen so see this Event on action.
Invoked when the Selector is Closed. For dynamic methods, uses the Original GameObject as parameter.
As an Example you can check the Demo: Cards Linear Screen so see this Event on action.
bool EnableSelector
Open/Close the selector.
void ToggleSelector()
Toggle On and Off the Selector (if it is open, close it, and vice versa)
void Purchase(MItem item)
Purchase the item, this method is usually called by the SelectorUI class on the Purchase button, which also will update the UI.
void _ReduceAmountSelected()
void SaveDefaultData()
Save to the Data the Default Data. it will use this as Starting point for the selector, and be used all those values as Restore Point. This is also used on the Save Default Data Button on the Selector Manager Inspector.
void RestoreToDefaultData()
Restore Data using the Default Data setted before on the SaveDefaultData() method
void SelectItem()
Select the Focused Item if is not locked and the amount is greater than zero, also instantiate it if Instantiate Item is enabled.
This is usually used by the Select Button on the UI..
void _ChangeCurrentItemMaterial(bool Next)
If the Item is using only one Material-Item, use this method instead of the ones listed below.
(GIF Example)
void _ChangeCurrentItemMaterial(string Name)
If the Selector is using a Data file, it will update the SaveData.
(GIF Example)
void _ChangeCurrentItemMaterial(string Name, bool Next)
If the Selector is using a Data file, it will update the SaveData.
(GIF Example)
void _ChangeCurrentItemMaterial(int Index)
If the Selector is using a Data file, it will update the SaveData.
(GIF Example)
void _ChangeCurrentItemMaterial(int Index, bool Next)
If the Selector is using a Data file, it will update the SaveData.
(GIF Example)
void _ChangeCurrentItemMaterial(bool Next)
If the Selector is using a Data file, it will update the SaveData.
If the Item is using only one Active-Mesh, use this method instead of the ones listed below.
(GIF Example)
void _ChangeCurrentItemMesh(int Index)
If the Selector is using a Data file, it will update the SaveData.
void _ChangeCurrentItemMesh(int Index, bool Next)
If the Selector is using a Data file, it will update the SaveData.
void _ChangeCurrentItemMesh(string Name)
If the Selector is using a Data file, it will update the SaveData.
void _ChangeCurrentItemMesh(string Name, bool Next)
If the Selector is using a Data file, it will update the SaveData.
void _ChangeToScene(string SceneName)
Change to the next scene using the scene name
void _ChangeToScene(string SceneIndex)
Change to the next scene using the scene index
void AddItem(MItem item)
Adds an Item at Runtime.
void AddItem(GameObject item)
void _RemoveItem(MItem item)
Removes an Item at Runtime.
void _RemoveItem(string Name)
Removes an Item at Runtime Using the Items “Name”
void _RemoveItem(int Index)
Removes an Item at Runtime Using the Items “Index”
You can enable 'Use ' and save the data there, but is recommended to use a better and secure 'Saving System'
Enable it to persistent save the Data using Class, but is recommended to use a better and secure 'Saving System' and connect it to the Data Asset.
Store all the Coins Items amount , Lock status, and , as the Restore/Default Data.
As an Example you can check the Demo: Boxes Radial Screen so see this Event on action working together with the method.
Example: Use it on the event and set it to false. so every time you select an item the selector will close.
Reduce the Amount of the selected item. Usually used on the Event. so when the item is selected also reduce by one the item.
...or by the OnClick/Touch an Item Event from the . (See Demo: BoxRadialScreen)
If the Current Item has an component, it change ALL the Material-Item on the list to the Next(true) or Before(false). If the Selector is using a Data file, it will update the SaveData.
If the Current Item has an component, it change an Active Material on the list to the Next Material using the Material-Item “Name”.
If the Current Item has an component, it change an Active Material on the list to the Next(true) Before(false) Material using the Material-Item “Name”.
If the Current Item has an component, it change an Active Material on the list to the Next Material using the Material Item “Index”.
If the Current Item has an component, it change an Active Material on the list to the Next(true) Before(false) Material using the Material Item “Index”.
If the Current Item has an component, it change ALL the Active Mesh items on the list to the Next(true) or Before(false).
If the Current Item has an component, it change an Active Mesh on the list to the Next Mesh using their “Index”.
If the Current Item has an component, it change an Active Mesh on the list to the Next Mesh using their “Index”.
If the Current Item has an component, it change an Active Mesh on the list to the Next Mesh using the Active-Mesh “Name”.
If the Current Item has an component, it change an Active Mesh on the list to the Next(true) Before(false) Mesh using the Active-Mesh “Name”.
Save data won’t work with runtime adding items
Adds an Item at Runtime, if the Item does not have an component on it it will add it
Save data won’t work with runtime adding items
Save data won’t work with runtime adding items
Save data won’t work with runtime adding items