I have two devices. One runs my game’s casual logic, the other runs the ranked logic. I only want one to be enabled at each time.
I have a third device that I want to use to disable one and switch on the other. Is there any default built-in way to fully disable a device and disconnect its events/loops/etc.? Effectively reverting it back to a “pre-enable on start” state.
As far as I can find, the only way is via making a custom Disable() and doing all of the above manually, but doing that feels unnecessarily complex - surely there must be a better way?
Being able to clone/duplicate a device with its references intact could also work for this, but this doesn’t appear to be possible either. 
My mind now went to “maybe I can have a few duplicates made in advance and destroy the old ones as-needed”; however, destroying a custom device without a custom function is also not possible. sigh
I was able to accomplish the original goal, after much trial and error, via leveraging coroutines.
Related code snippet to make coroutines easier to work with:
https://dev.epicgames.com/community/snippets/4dl/fortnite-cancelable-spawned-coroutines
Code Excerpt (in case it helps future peoples):
GamemodeManager := class(creative_device):
# Instances
@editable CasualLogic : CasualLogicManager = CasualLogicManager{}
@editable RankedLogic : RankedLogicManager = RankedLogicManager{}
# Variables
var IsCasualMode : logic = true
var CurrentRoutine : ?routine = false
# Functions
RunCurrentMode():void=
# Cancel any currently-ongoing routines
if(CurrentRoutineTemp := CurrentRoutine?):
Print("Cancelled current mode")
CurrentRoutineTemp.Cancel()
# add additional cleanup logic here
# Start either casual or ranked mode
if(IsCasualMode = true):
Print("Starting casual mode")
CurrentRoutineTemp := SpawnRoutine(CasualLogic.StartGame)
set CurrentRoutine = option{CurrentRoutineTemp}
else:
Print("Starting ranked mode")
CurrentRoutineTemp := SpawnRoutine(RankedLogic.StartGame)
set CurrentRoutine = option{CurrentRoutineTemp}
All I had to do to my original devices was change the OnBegin to be a custom method StartGame. Much cleaner than having to splice them up.