jellewie / Unity-Gnorts

Gnorts an RTS unity game
11 stars 7 forks source link

92 interactable menus #99

Closed JorisVanEijden closed 5 years ago

JorisVanEijden commented 5 years ago

I did not replace any of the existing code, I just added some new features on top. So far I only created the Gate menu and I only applied it to the Stone Gate prefab.

Please play around with it and see if this is something you like before I go creating more buildings and menus.

JorisVanEijden commented 5 years ago

Instructions for adding a gate menu to wooden gates:

  1. Add a Gate component to the Wooden Gate prefab.
  2. Add the Prefab/UI/Buildings/GateMenu prefab as a child to the Wooden Gate prefab.
JorisVanEijden commented 5 years ago

Instructions for creating a new building menu:

  1. Create a new UI/Canvas
  2. Add a Sticky Menu component to it
  3. Create a UI/Panel gameObject to it
  4. Add all static UI items you need to the panel
  5. Save the canvas as a prefab in Prefab/UI/Buildings/
  6. Create a new C# script in _Code/Buildings
  7. Make the new script implement the "InteractableMenu" interface
  8. In the OpenMenu() method assign dynamic values and functionalities
  9. Add the newly created component to the existing building prefab
  10. Add the Menu prefab as a child to the existing building prefab
jellewie commented 5 years ago

100 has been chosen,

This code would still be useful later for other things tho