protected override void PopIn() { if (skinEditor != null) { skinEditor.Show(); return; } var editor = new SkinEditor(); editor.State.BindValueChanged(visibility => updateComponentVisibility()); skinEditor = editor; LoadComponentAsync(editor, _ => { if (editor != skinEditor) { return; } AddInternal(editor); SetTarget(lastTargetScreen); }); }
public override void Show() { // base call intentionally omitted. if (skinEditor == null) { LoadComponentAsync(skinEditor = new SkinEditor(target), AddInternal); skinEditor.State.BindValueChanged(editorVisibilityChanged); } else { skinEditor.Show(); } }
public override void Show() { // base call intentionally omitted as we have custom behaviour. if (skinEditor != null) { skinEditor.Show(); return; } var editor = new SkinEditor(target); editor.State.BindValueChanged(editorVisibilityChanged); skinEditor = editor; // Schedule ensures that if `Show` is called before this overlay is loaded, // it will not throw (LoadComponentAsync requires the load target to be in a loaded state). Schedule(() => { if (editor != skinEditor) { return; } LoadComponentAsync(editor, _ => { if (editor != skinEditor) { return; } AddInternal(editor); }); }); }