Exemplo n.º 1
0
        protected override void OnDisable()
        {
            base.OnDisable();

            this.ReleaseSubscriptions();

            this.techGroups.ClientAnyModification -= this.TechGroupsClientAnyModificationHandler;
            this.techNodes.ClientAnyModification  -= this.TechNodesClientAnyModificationHandler;

            if (instance == this)
            {
                instance = null;
            }
        }
Exemplo n.º 2
0
        public void Setup(PlayerCharacterPrivateState privateState)
        {
            TechGroupsChanged = null;
            TechNodesChanged  = null;

            this.technologies = privateState.Technologies;
            this.techGroups   = this.technologies.Groups;
            this.techNodes    = this.technologies.Nodes;

            this.technologies.ClientSubscribe(
                _ => _.LearningPoints,
                _ => LearningPointsChanged?.Invoke(),
                this);

            this.techGroups.ClientAnyModification += this.TechGroupsClientAnyModificationHandler;
            this.techNodes.ClientAnyModification  += this.TechNodesClientAnyModificationHandler;

            instance = this;

            CurrentTechnologiesChanged?.Invoke();
            TechGroupsChanged?.Invoke();
            TechNodesChanged?.Invoke();
            LearningPointsChanged?.Invoke();
        }