Beispiel #1
0
 internal void Start()
 {
     if (DisplayHealth)
     {
         m_display = Instantiate(UIList.Instance.HealthBarPrefab, this.transform).GetComponent <HealthDisplay>();
         m_display.SetMaxHealth(MaxHealth);
     }
 }
Beispiel #2
0
 internal void Start()
 {
     if (DisplayHealth)
     {
         if (GetComponent <BasicMovement>() != null && GetComponent <BasicMovement> ().IsCurrentPlayer)
         {
             UIBarInfo ubi = new UIBarInfo();
             ubi.FillColor  = Color.red;
             ubi.UILabel    = "Health";
             ubi.funcUpdate = UpdateHealthValues;
             ubi.target     = gameObject;
             FindObjectOfType <GUIHandler>().AddUIBar(ubi);
         }
         else
         {
             m_display = Instantiate(UIList.Instance.HealthBarPrefab, this.transform).GetComponent <HealthDisplay>();
             m_display.SetMaxHealth(MaxHealth);
         }
     }
 }
 public override void OnAddProperty()
 {
     if (GetComponent <BasicMovement>() != null &&
         GetComponent <BasicMovement> ().IsCurrentPlayer)
     {
         UIBarInfo ubi = new UIBarInfo();
         ubi.FillColor   = new Color(0.2f, 0.2f, 0f);
         ubi.UILabel     = "Sentiment";
         ubi.funcUpdate  = UpdateSentiment;
         ubi.target      = gameObject;
         ubi.DisplayMode = UIBarDisplayMode.BASE;
         ubi.useScale    = false;
         FindObjectOfType <GUIHandler>().AddUIBar(ubi);
         Debug.Log("Adding a GUI bar");
     }
     m_display = Instantiate(UIList.Instance.HealthBarPrefab, this.transform).GetComponent <HealthDisplay>();
     m_display.SetMaxHealth(ActivateThreashold);
     m_display.DisplayAsFraction = true;
     m_display.ValueLabel        = "SNT";
     Debug.Log("Adding for: " + gameObject);
 }