void Awake()
    {
        cam             = Camera.main;
        cameraTransform = cam.transform;

        for (int i = 0; i < transform.childCount; i++)
        {
            healthBars.Add(transform.GetChild(i));
        }

        _Instance = this;
        if (prefab == null)
        {
            prefab = (GameObject)Resources.Load("Prefabs/FloatingDamage");
        }

        if (_config == null)
        {
            _config = (FloatBarConfig)Resources.Load("FloatBarConfig");
        }

        config    = _config;
        poolTrans = _CreateTrans("HealthbarPool");
        showTrans = _CreateTrans("HealthbarRoot");
    }
Exemplo n.º 2
0
 public override void OnRollbackDestroy()
 {
     if (uiFloatBar != null)
     {
         FloatBarManager.DestroyText(uiFloatBar);
     }
     GameObject.Destroy(gameObject);
 }
Exemplo n.º 3
0
 public override void BindEntity(BaseEntity e)
 {
     base.BindEntity(e);
     e.EntityView       = this;
     this.entity        = e as Entity;
     uiFloatBar         = FloatBarManager.CreateFloatBar(transform, this.entity.curHealth, this.entity.maxHealth);
     transform.position = this.entity.transform.Pos3.ToVector3();
 }
Exemplo n.º 4
0
    // Token: 0x0600000B RID: 11 RVA: 0x0000243D File Offset: 0x0000063D
    public static void DestroyText(UIFloatBar trans)
    {
        FloatBarManager instance = FloatBarManager._Instance;

        if (instance != null)
        {
            instance._DestroyText(trans);
        }
    }
Exemplo n.º 5
0
 public override void BindEntity(BaseEntity e, BaseEntity oldEntity = null)
 {
     base.BindEntity(e, oldEntity);
     e.EntityView = this;
     this.entity  = e as Entity;
     if (oldEntity != null)
     {
         uiFloatBar = (oldEntity.EntityView as EntityView).uiFloatBar;
     }
     else
     {
         uiFloatBar = FloatBarManager.CreateFloatBar(transform, this.entity.curHealth, this.entity.maxHealth);
     }
 }
Exemplo n.º 6
0
    // Token: 0x0600000C RID: 12 RVA: 0x00002454 File Offset: 0x00000654
    public static UIFloatBar CreateFloatBar(Transform trans, int val, int maxVal)
    {
        FloatBarManager instance = FloatBarManager._Instance;

        return((instance != null) ? instance._CreateFloatBar(trans, val, maxVal) : null);
    }