public async Task Setup(BootStrap bootstrap, System.Action <IManager> onSetup, System.Action <IManager> onSetupFail) { PromiseChain promise = new PromiseChain(); if (_layerRoot == null) { promise.Then(LoadUICamera); } if (_layerPrefab == null) { promise.Then(LoadDeviceFrame); } await promise.Exec(); SetupInternal(); onSetup(this); }
public void Teardown() { PromiseChain <System.Action> teardownChain = new PromiseChain <System.Action>(); int count = _managers.Count; for (int i = count - 1; i >= 0; --i) { teardownChain.Then(_managers[i].Teardown, OnTeardown); } teardownChain.Exec(); }
public BootStrap Then(IManager manager) { _setupChain.Then(manager.Setup, this, OnManagerSetup, OnManagerSetupFail); return(this); }