Code
if(tileInteractable is ILock) { ILock lockedInteractable = tileInteractable as ILock; if(lockedInteractable.Locked) { int lockedItemCount = 0; List<string> lockedStrings = new List<string>(); List<Action> lockedActions = new List<Action>(); lockedItemCount++; lockedStrings.Add (tileInteractable.ObjectName); lockedActions.Add(new Action( delegate { lockedInteractable.Unlock (GameManager.instance.player.entity); Reset(); } )); radComponentCount++; buttonStrings.Add ("Unlock"); actions.Add(new Action( delegate { Reset(); GenerateRadial(lockedItemCount,lockedActions,lockedStrings); isActive = true; } )); } } To run you through the code, the following occurs:
A radial menu button is made. It's told to create one button with the entity's name as its hover text.
When pressed, it calls Unlock with the sender as the player, and then closes the radial menu via Reset().
We then create another radial button labelled Unlock that runs the other radial menu when it's pressed. This radial button is then built into a base menu with any other similar ones, so the first menu has Unlock, Examine, etc. if anything exists that implements that functionality, and the second refers to the potential targets.
This code is then nearly identically duplicated, with ILock changed to IExaminable and .Unlock changed to .Examine. Doing this creates the Examine functionality for the main radial menu.