Exemple #1
0
    public void BattleDisplaySelf(Damagable target, Vector3 pos, string text = "")
    {
        GameObject temp = Instantiate(ImageHolder, pos, Quaternion.identity);

        temp.transform.SetParent(this.gameObject.transform, false);
        temp.GetComponent <Image>().sprite        = target.getImages()[0];
        temp.GetComponentInChildren <Text>().text = text;
        Destroy(temp, 1.8f);
    }
Exemple #2
0
 public void setChar(Damagable character, GameObject background)
 {
     Char      = character;
     backdrop  = background;
     HealthBar = Instantiate(healthBar, new Vector3(0, 0, 0), Quaternion.identity);
     HealthBar.transform.SetParent(this.gameObject.transform, false);
     HealthBar.SetHealthBar(Char);
     this.gameObject.GetComponent <Image>().sprite = Char.getImages()[0];
     this.gameObject.transform.SetParent(backdrop.transform, false);
 }
Exemple #3
0
 public void enemyDie()
 {
     this.gameObject.GetComponent <Image>().sprite = Char.getImages()[3];
 }
Exemple #4
0
 public void updateChar(Damagable character)
 {
     Char = character;
     this.gameObject.GetComponent <Image>().sprite = Char.getImages()[0];
     HealthBar.SetHealthBar(Char);
 }