protected override void OnEnable() { _lifeTime?.Release(); GameLog.Log("GameFlowWindow : OnEnable"); graph = null; base.OnEnable(); _lifeTime.AddCleanUpAction(() => windows.Remove(this)); if (!windows.Contains(this)) { windows.Add(this); } MessageBroker.Default .Receive <UniGraphSaveMessage>() .Where(x => x.graph == _targetGraph) .Do(x => Save()) .Subscribe() .AddTo(_lifeTime); MessageBroker.Default .Receive <UniGraphReloadMessage>() .Where(x => x.graph == _targetGraph) .Do(x => Save()) .Do(x => Reload()) .Subscribe() .AddTo(_lifeTime); Reload(); }
private void InnerInitialize( IGraphData graphData, Action initializeAction = null, Action <List <ILifeTimeCommand> > initializeCommands = null, Action executeAction = null) { if (Application.isEditor && Application.isPlaying == false) { _lifeTime?.Release(); } if (Application.isPlaying && _isInitialized) { return; } _onInitialize = initializeAction; _onCommandsInitialize = initializeCommands; _onExecute = executeAction; _lifeTime?.Release(); base.Initialize(graphData); InitializeData(graphData); _isInitialized = Application.isPlaying; //initialize all node commands InitializeCommands(); //initialize ports InitializePorts(); //custom node initialization OnInitialize(); //proxy initialization _onInitialize?.Invoke(); LifeTime.AddCleanUpAction(() => { _isActive = false; }); }
/// <summary> /// initialize property with target Addressable Asset /// </summary> /// <param name="addressable"></param> public void Initialize(TAddressable addressable) { lifeTimeDefinition = lifeTimeDefinition ?? new LifeTimeDefinition(); progress = progress ?? new FloatRecycleReactiveProperty(); status = status ?? new RecycleReactiveProperty <AsyncOperationStatus>(); value = value ?? new RecycleReactiveProperty <TApi>(); lifeTimeDefinition.Release(); reference = addressable; lifeTimeDefinition.AddCleanUpAction(CleanUp); }
public async UniTask Initialize(IViewModel model, bool isViewOwner = false) { // save current state _isViewOwner = isViewOwner; //restart view lifetime _viewModelLifeTime.Release(); _progressLifeTime.Release(); //calls one per lifetime if (!_isInitialized.Value) { InitialSetup(); OnAwake(); } InitializeHandlers(model); BindLifeTimeActions(model); //custom initialization await OnInitialize(model); }
protected override void OnEnable() { _lifeTime?.Release(); GameLog.Log("GameFlowWindow : OnEnable"); graph = null; base.OnEnable(); _lifeTime.AddCleanUpAction(() => windows.Remove(this)); if (!windows.Contains(this)) { windows.Add(this); } Reload(); }
public void Initialize(int portNodeId, NodeGraph portGraph) { this.nodeId = portNodeId; this.graph = portGraph; connections ??= new List <PortConnection>(); connections.ForEach(x => x.Initialize(portGraph)); //initialize port lifetime lifeTimeDefinition ??= new LifeTimeDefinition(); lifeTime = lifeTimeDefinition.LifeTime; lifeTimeDefinition.Release(); //initialize port value portValue.Initialize(fieldName); //bind port value to port lifetime lifeTime.AddDispose(portValue); }
public void Initialize(INode data) { this.node = data; this.nodeId = data.Id; connections = connections ?? new List <PortConnection>(); connections.ForEach(x => x.Initialize(node.GraphData)); //initialize port lifetime lifeTimeDefinition = lifeTimeDefinition ?? new LifeTimeDefinition(); lifeTime = lifeTimeDefinition.LifeTime; lifeTimeDefinition.Release(); //initialize port value portValue.Initialize(fieldName); //bind port value to port lifetime lifeTime.AddDispose(portValue); }
public void Initialize( int id, IEnumerator enumerator, bool moveNextImmediately = false) { Release(); lifeTimeDefinition.Release(); IdValue = id; rootEnumerator = enumerator; current = enumerator; SetTaskState(RoutineState.Active); if (moveNextImmediately) { MoveNext(); } }
public async UniTask Execute() { if (isActive.Value) { await OnAlreadyActive(); } lifeTimeDefinition.Release(); LifeTime.AddCleanUpAction(OnExit); LifeTime.AddCleanUpAction(() => isActive.Value = false); LifeTime.AddCleanUpAction(() => isInitialized.Value = false); isActive.Value = true; await OnInitialize(); await OnExecute(); await OnPostExecute(); }
protected override void OnDestroy() { _lifeTime.Release(); base.OnDestroy(); }
public void Disconnect() => _lifeTime.Release();
public void Unload() => _atlasesLifetime.Release();
public void Reset() => _lifeTime?.Release();