Exemple #1
0
    public void Init(BaseObject obj)
    {
        TARGET = obj;
        if (TARGET == null)
        {
            TARGET = GetComponent <UIAnchor>().objectToFollow.GetComponent <BaseObject>();
        }
        TARGET.PlugHealthBar(this);
        //health bar cant be child of moving shit
        HealthBar           = GetComponentInChildren <Canvas>().GetComponentInChildren <Fizzik.HealthBarComponent>();
        hpbar.currentHealth = (int)TARGET.GetHP();
        hpbar.totalHealth   = (int)TARGET.GetMAX_HP();
        hpbar.GetComponent <Image>().material = HealthBarMaterial;


        isInit = true;
    }