I have a Networked game where each player is essentially a floating camera, it’s much like a Turn-based Strategy game.
Everything works fine up to unit selection.
When I have a selected unit there’s a couple of options you can do, which are shown as buttons in the UI, Move, Shoot, Dodge, are some examples.
Unit selection is handled by a manager script that is part of the player’s prefab. Which is instantiated(spawned) when they connect.
I have a problem when I have a unit selected and I click on the ‘Move’ button (or any of them really). How do I bind the ‘onClick’ function of the action to work on the player’s selected model?
So say if there is a function in my player manager that enters “movementMode”, called “EnterMovementMode()”. Which has to be executed when the player clicked on the “Move” Button in the UI.
Seen in image bellow, The selected unit is highlighted by the green gear-like projector.
Should I make the GUI part of the player object and spawn it as a networkbehaviour object so it is pre-affixed to the action I want it to take?
I’m kinda stuck here
Thanks,