IEnumerator Spore() { if(isTutacoroutine){yield break;} if(isBombcoroutine){yield break;} if(isSporecoroutine){yield break;} isSporecoroutine = true; GameObject bullet; bullet = GameObject.Instantiate( Bullet[0] ); bullet_parameter = bullet.GetComponent<Bullet_Parameter>(); bullet_parameter.Parent = this.gameObject;//誰が撃ったかを渡す //弾を飛ばす処理 animator.SetTrigger ("Gyon"); bullet.transform.position = Muzzle[0].position; /*if(!audioSource.isPlaying){ audioSource.Play(); }*/ //硬直 yield return new WaitForSeconds(bullet_parameter.wait_time);//攻撃前の隙 enemy_flag.flag_key = false; isSporecoroutine = false; //enemy_flag.state = Enemy_Flag.Enemy_State.Attack; }
IEnumerator Tuta() { isTutacoroutine = true; GameObject bullet; bullet = GameObject.Instantiate( Bullet[2] ); bullet_parameter = bullet.GetComponentInChildren<Bullet_Parameter>(); bullet_parameter.Parent = this.gameObject;//誰が撃ったかを渡す //弾を飛ばす処理 animator.SetTrigger ("Grun"); bullet.transform.position = Muzzle[1].position; bullet.GetComponent<Rigidbody>().velocity = ( (Player.transform.position - this.transform.position + new Vector3 (0,1,0)).normalized * 5 ); /*if(!audioSource.isPlaying){ audioSource.Play(); }*/ //硬直 yield return new WaitForSeconds(2);//攻撃前の隙 enemy_flag.flag_key = false; isTutacoroutine = false; //enemy_flag.state = Enemy_Flag.Enemy_State.Attack; }