// Update is called once per frame void Update() { rigidbody = GetComponent <Rigidbody2D>(); bossball = GetComponent <BossBall> (); if (sr.isVisible) { if (deltaTime > 100.0f) { for (int i = 0; i < transform.childCount; i++) { Transform shotPosition = transform.GetChild(i); bossball.Shot(shotPosition); } yield return(new WaitForSeconds(bossball.shotDelay)); deltaTime = 0; } } else { if (deltaTime > 100.0f) { deltaTime = 0; } } deltaTime++; }
void Start() { rigidbody = GetComponent <Rigidbody2D>(); sr = GetComponent <SpriteRenderer>(); HP = 30; bossball = GetComponent <BossBall> (); StartPos = rigidbody.position; }