Пример #1
0
 protected override void Update(float dt)
 {
     if (Service.BuildingTooltipController != null)
     {
         Service.BuildingTooltipController.ResetTooltipSlots();
     }
     for (HealthViewNode healthViewNode = this.nodeList.Head; healthViewNode != null; healthViewNode = healthViewNode.Next)
     {
         HealthViewComponent healthView = healthViewNode.HealthView;
         if (healthView != null)
         {
             healthView.UpdateLocation();
             if (healthView.AutoRegenerating)
             {
                 this.UpdateAutoRegeneration(healthView, dt);
             }
         }
     }
 }
        public override void Execute()
        {
            base.Execute();
            EntityController          entityController = Service.Get <EntityController>();
            NodeList <HealthViewNode> nodeList         = entityController.GetNodeList <HealthViewNode>();

            for (HealthViewNode healthViewNode = nodeList.Head; healthViewNode != null; healthViewNode = healthViewNode.Next)
            {
                healthViewNode.HealthView.SetEnabled(this.show);
                if (this.show)
                {
                    Service.Get <BuildingTooltipController>().EnsureBuildingTooltip((SmartEntity)healthViewNode.Entity);
                }
            }
            NodeList <SupportViewNode> nodeList2 = Service.Get <EntityController>().GetNodeList <SupportViewNode>();

            for (SupportViewNode supportViewNode = nodeList2.Head; supportViewNode != null; supportViewNode = supportViewNode.Next)
            {
                supportViewNode.SupportView.SetEnabled(this.show);
                if (this.show)
                {
                    Service.Get <BuildingTooltipController>().EnsureBuildingTooltip((SmartEntity)supportViewNode.Entity);
                }
            }
            NodeList <GeneratorViewNode> nodeList3 = Service.Get <EntityController>().GetNodeList <GeneratorViewNode>();

            for (GeneratorViewNode generatorViewNode = nodeList3.Head; generatorViewNode != null; generatorViewNode = generatorViewNode.Next)
            {
                if (this.show)
                {
                    generatorViewNode.GeneratorView.SetEnabled(this.show);
                    Service.Get <ICurrencyController>().UpdateGeneratorAccruedCurrency((SmartEntity)generatorViewNode.Entity);
                }
                else
                {
                    generatorViewNode.GeneratorView.ShowCollectButton(false);
                    generatorViewNode.GeneratorView.SetEnabled(this.show);
                }
            }
            this.parent.ChildComplete(this);
        }