private void Start() { bar = GameObject.FindGameObjectWithTag("BossHealth").GetComponent <Slider>(); res = GameObject.FindGameObjectWithTag("Boss").GetComponent <BossResources>(); boss = GameObject.FindGameObjectWithTag("BossName").GetComponent <Text>(); boss.text = res.bossname; bar.maxValue = res.health; bar.value = bar.maxValue; }
//start off in a random direction //if you collide with the Room layer you bounce off //if you collide with the player you deal damage and bounce off void Start() { fly = GameObject.FindGameObjectWithTag("FireFly").GetComponent <FireFlyResources>(); pr = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerResources>(); anim = GetComponent <Animator>(); rb = GetComponent <Rigidbody2D>(); br = GetComponentInParent <BossResources>(); startTimeBtwDamage = fly.rateOfFire; terra = GetComponentInParent <SpawnOfTerra>(); ps = GetComponentsInChildren <ParticleSystem>(); movement = new Vector2(Random.Range(-1f, 1f), Random.Range(-1f, 1f)); rb.velocity = movement * 5; }
// Start is called before the first frame update void Start() { forms = new List <GameObject>(); GameObject instance = (GameObject)Instantiate(startingForm, transform.position, Quaternion.identity); instance.transform.parent = transform; forms.Add(instance); br = GetComponent <BossResources>(); item = GetComponent <DropFire>(); end = GetComponent <GenerateLevelEnd>(); br.SetName("Spawn of Terra"); FindObjectOfType <AudioManager>().TerraSpawnSound(); }
public void updateValue() { bar = GameObject.FindGameObjectWithTag("BossHealth").GetComponent <Slider>(); res = GameObject.FindGameObjectWithTag("Boss").GetComponent <BossResources>(); boss = GameObject.FindGameObjectWithTag("BossName").GetComponent <Text>(); boss.text = res.bossname; if (bar != null) { if (bar.maxValue <= res.health) { bar.maxValue = res.health; } bar.value = res.health; if (res.death) { Invoke("OnDeath", 1f); } } }