private void CommandManager__controlledPressurePlateChanged(NPCPressurePlate obj) { if (obj) { _navMeshAgent.destination = obj.transform.position; } }
public void CompleteProgress(NPCCommandable commandable) { if (commandable is NPCCommand && NpcControlled != (NPCCommand)commandable) { if (NpcControlled) { NpcControlled.UnCommand(); } NpcControlled = (NPCCommand)commandable; _controlledNpcChanged?.Invoke(NpcControlled); NpcControlled.Command(); } if (commandable is NPCPressurePlate && NpcControlled != (NPCPressurePlate)commandable) { if (PressurePlateController) { PressurePlateController.UnCommand(); } PressurePlateController = (NPCPressurePlate)commandable; _controlledPressurePlateChanged?.Invoke(PressurePlateController); PressurePlateController.Command(); } }