예제 #1
0
 public void Initialize()
 {
     if (control == null)
         control = GetComponent<dfControl>();
     s = gameObject.GetComponent<dfProgressBar>();
     s.MinValue = 0;
     bvl = GetComponentInChildren<barValueLabel>();
     switch (owner)
     {
         case spawnBars.hudOwner.Player:
             hull = Target.GetComponentInChildren<Hull>();
             break;
         case spawnBars.hudOwner.Enemy:
             hull = Target.GetComponentInChildren<Hull>();
             if (Target.layer == LayerMask.NameToLayer("NonPlayer"))
             {
                 Target.GetComponent<NPCController>().setBars(transform.parent.gameObject);//Redundant because it is also in Shieldbar script
             }
             else
                 Target.GetComponent<EnemyController>().setBars(transform.parent.gameObject);//Redundant because it is also in Shieldbar script
             break;
     }
     if (isGUITarget)
     {
         GUIReciever.hull = hull;
         GUIReciever.GUITarget = this;
     }
     if (owner != spawnBars.hudOwner.GUI)
     {
         hull.hBar = this;
         setValue();
     }
 }
예제 #2
0
	public void Initialize () 
    {
        if (control == null)
            control = GetComponent<dfControl>();
        s = GetComponent<dfProgressBar>();
        s.MinValue = 0;
        bvl = GetComponentInChildren<barValueLabel>();
        switch (owner)
        {
            case spawnBars.hudOwner.Player:
                shields = Target.GetComponentInChildren<Shield>();

                break;
            case spawnBars.hudOwner.Enemy:
                shields = Target.GetComponentInChildren<Shield>();
                break;
        }
        if (isGUITarget)
        {
            GUIReciever.shields = shields;
            GUIReciever.GUITarget = this;
            GUIReciever2.shields = shields;
            GUIReciever2.GUITarget = this;
        }
        if (owner != spawnBars.hudOwner.GUI)
        {
            shields.sBar = this;
            setValue();
        }
	}
예제 #3
0
 public void setValue()
 {
     if(s == null)
         s = gameObject.GetComponent<dfProgressBar>();
     s.Value = planet.health;
     if (bvl == null)
     {
         bvl = GetComponentInChildren<barValueLabel>();
     }
 }
예제 #4
0
 public void Initialize(DefendThePlanetObjective dtpo)
 {
     planet = dtpo;
     planet.pbs = this;
     if (control == null)
         control = GetComponent<dfControl>();
     s = gameObject.GetComponent<dfProgressBar>();
     s.MinValue = 0;
     s.MaxValue = planet.maxHealth;
     bvl = GetComponentInChildren<barValueLabel>();
     setValue();
 }
예제 #5
0
 public void setValue()
 {
     if(s == null && gameObject!=null)
         s = gameObject.GetComponent<dfProgressBar>();
     s.MaxValue = hull.MaxHull;
     s.Value = hull.hull;
     if (bvl == null)
     {
         bvl = GetComponentInChildren<barValueLabel>();
     }
     if(bvl!=null)
         bvl.setValue( hull.hull,hull.MaxHull);
     if (isGUITarget)
     {
         GUIReciever.setValue();
     }
 }
예제 #6
0
 public void setValue()
 {
     if (s == null)
         s = gameObject.GetComponent<dfProgressBar>();
     s.MaxValue = shields.MaxShield;
     s.Value = shields.Shields;
     if (bvl == null)
     {
         bvl = GetComponentInChildren<barValueLabel>();
     }
     if (bvl != null)
         bvl.setValue(shields.Shields, shields.MaxShield);
     if (isGUITarget)
     {
         GUIReciever.setValue();
         GUIReciever2.setValue();
     }
 }