// Token: 0x06002115 RID: 8469 RVA: 0x0009B560 File Offset: 0x00099760
 private void Update()
 {
     if (this.crosshairTarget)
     {
         CombatHealthBarViewer.HealthBarInfo healthBarInfo = this.GetHealthBarInfo(this.crosshairTarget);
         healthBarInfo.endTime = Mathf.Max(healthBarInfo.endTime, Time.time + 1f);
     }
     this.SetDirty();
 }
Ejemplo n.º 2
0
 // Token: 0x06002251 RID: 8785 RVA: 0x000945B4 File Offset: 0x000927B4
 private CombatHealthBarViewer.HealthBarInfo GetHealthBarInfo(HealthComponent victimHealthComponent)
 {
     CombatHealthBarViewer.HealthBarInfo healthBarInfo;
     if (!this.victimToHealthBarInfo.TryGetValue(victimHealthComponent, out healthBarInfo))
     {
         healthBarInfo = new CombatHealthBarViewer.HealthBarInfo();
         healthBarInfo.healthBarRootObject          = UnityEngine.Object.Instantiate <GameObject>(this.healthBarPrefab, this.container);
         healthBarInfo.healthBarRootObjectTransform = healthBarInfo.healthBarRootObject.transform;
         healthBarInfo.healthBar            = healthBarInfo.healthBarRootObject.GetComponent <HealthBar>();
         healthBarInfo.healthBar.source     = victimHealthComponent;
         healthBarInfo.healthBar.viewerBody = this.viewerBody;
         healthBarInfo.healthBarRootObject.GetComponentInChildren <BuffDisplay>().source = victimHealthComponent.body;
         healthBarInfo.sourceHealthComponent = victimHealthComponent;
         healthBarInfo.verticalOffset        = 0f;
         Collider component = victimHealthComponent.GetComponent <Collider>();
         if (component)
         {
             healthBarInfo.verticalOffset = component.bounds.extents.y;
         }
         healthBarInfo.sourceTransform = (victimHealthComponent.body.coreTransform ?? victimHealthComponent.transform);
         ModelLocator component2 = victimHealthComponent.GetComponent <ModelLocator>();
         if (component2)
         {
             Transform modelTransform = component2.modelTransform;
             if (modelTransform)
             {
                 ChildLocator component3 = modelTransform.GetComponent <ChildLocator>();
                 if (component3)
                 {
                     Transform transform = component3.FindChild("HealthBarOrigin");
                     if (transform)
                     {
                         healthBarInfo.sourceTransform = transform;
                         healthBarInfo.verticalOffset  = 0f;
                     }
                 }
             }
         }
         this.victimToHealthBarInfo.Add(victimHealthComponent, healthBarInfo);
         this.trackedVictims.Add(victimHealthComponent);
     }
     return(healthBarInfo);
 }
 // Token: 0x0600211C RID: 8476 RVA: 0x0009B648 File Offset: 0x00099848
 private void Remove(int trackedVictimIndex, CombatHealthBarViewer.HealthBarInfo healthBarInfo)
 {
     this.trackedVictims.RemoveAt(trackedVictimIndex);
     UnityEngine.Object.Destroy(healthBarInfo.healthBarRootObject);
     this.victimToHealthBarInfo.Remove(healthBarInfo.sourceHealthComponent);
 }