// Update is called once per frame void Update() { if (flg == false) //角度取得用のフラグがfalseなら { angle = mother.Playerangle(pos); //プレイヤーとの角度を取得 transform.rotation = Quaternion.Euler(0, 0, angle); //角度を変える flg = true; //角度取得用のフラグをtrueにする } transform.Translate(-0.1f * mother.enemySpeed, 0, 0); }
public void oEnemymove92(int direction) //回転しながら移動(回転は子オブジェクトが担当) { if (moveFlg == false) //Enemy移動のフラグがfalseなら { if (flg == false) //角度取得用のフラグがfalseなら { angle = mother.Playerangle(pos); //プレイヤーとの角度を取得 transform.rotation = Quaternion.Euler(0, 0, angle); //角度を変える flg = true; //角度取得用のフラグをtrueにする } transform.rotation = Quaternion.Euler(0, 0, angle); transform.Translate(-0.3f, 0, 0);//移動 } }
void oEnemymove9_att1()//一定間隔で弾を出す { time += Time.deltaTime * mother.enemySpeed; if (time >= att1time && count <= 3) { pos = transform.position; angle = mother.Playerangle(enemy9Move.enemyPosition); boss.Att1(way, min, max, enemyMode, angle, att1, pos.x, pos.y); count++; time = 0; } else if (count == 4) { count = 0; oEnemymove9_attstop(); } }
void att4() { if (transform.localScale.x <= 1.5f && att4Flg == false) { transform.localScale = new Vector3(transform.localScale.x + 0.02f * mother.enemySpeed, transform.localScale.y + 0.02f * mother.enemySpeed, transform.localScale.z); } else { att4Flg = true; if (transform.localScale.x >= size.x) { transform.localScale = new Vector3(transform.localScale.x - 0.02f * mother.enemySpeed, transform.localScale.y - 0.02f * mother.enemySpeed, transform.localScale.z); } else { angle = mother.Playerangle(transform.position); GameObject bulletInstance = Instantiate(bullet) as GameObject; bulletInstance.transform.rotation = Quaternion.Euler(0, 0, angle); bulletInstance.transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z); att4Flg = false; flg = true; } } }