// Start is called before the first frame update void Start() { this.currentHealth = this.maxHealth; var healthBarObject = Instantiate(this.healthBarPrefab, References.canvas.transform); this.healthBarBehaviour = healthBarObject.GetComponent <HealthBarBehaviour>(); }
// Start is called before the first frame update void Start() { GameObject healthBarObject = Instantiate(healthbarPrefab, References.theCanvas.transform); myHealthBar = healthBarObject.GetComponent <HealthBarBehaviour>(); currentHealth = maxHealth; }
// Start is called before the first frame update void Start() //create health panel on canvas { currentHealth = maxHealth; GameObject healthBarObject = Instantiate(healthBarPrefab, References.canvas.transform); myHealthBar = healthBarObject.GetComponent <HealthBarBehaviour>(); }
public void ReplaceHealthBarBehaviour(HealthBarBehaviour newValue) { var index = GameComponentsLookup.HealthBarBehaviour; var component = CreateComponent <HealthBarBehaviourComponent>(index); component.value = newValue; ReplaceComponent(index, component); }
// Start is called before the first frame update void Start() { healthBar = Instantiate(healthBarPrefab, gameObject.transform); healthBar.transform.parent = gameObject.transform; myHealthBar = healthBar.GetComponent <HealthBarBehaviour>(); currHealth = maxHealth; mainCamera = Camera.main; isDead = false; }
// Start is called before the first frame update void Start() { GameObject healthBarObject = Instantiate(healthbarPrefab, References.canvas.transform); myHealthBar = healthBarObject.GetComponent <HealthBarBehaviour>(); currentHealth = maxHealth; isDead = false; timeUntilDestroy = timeBeforeDestroy; }
void Start() { if (heathBar == null) { heathBar = FindObjectOfType <HealthBarBehaviour>(); } if (player == null) { player = FindObjectOfType <PlayerLifeTime>(); } }
// Start is called before the first frame update public void Start() { frontCannon = transform.Find("Cannons").Find("FrontCannon"); leftCannons[0] = transform.Find("Cannons").Find("LeftFrontCannon"); leftCannons[1] = transform.Find("Cannons").Find("LeftCenterCannon"); leftCannons[2] = transform.Find("Cannons").Find("LeftBackCannon"); rightCannons[0] = transform.Find("Cannons").Find("RightFrontCannon"); rightCannons[1] = transform.Find("Cannons").Find("RightCenterCannon"); rightCannons[2] = transform.Find("Cannons").Find("RightBackCannon"); health = maxHealth; healthBarInstance = Instantiate(healthBar); healthBarInstance.owner = transform; healthBarInstance.hpSlider.value = 1; }
// Start is called before the first frame update void Start() { healthBar = Instantiate(HealthBarPrefab).GetComponent <HealthBarBehaviour>(); Vector3 healthbarPosition = transform.position; healthbarPosition.y = 10.5f; healthBar.transform.position = healthbarPosition; healthPoints = MaxHealth * 0.5f; healthBar.AngleToCamera(); UpdateHealthBar(); Barricade.material.mainTextureScale = new Vector2(1, 1); SecToNextAttack = SecBetweenAttacks; animator = GetComponent <Animator>(); }
public void SetHealthBar(HealthBarBehaviour newHealthBar) { healthBar = newHealthBar; }