void ShotBullet(Transform shotPostion, Vector3 player) { // GameObject shoteff = Instantiate(shotEffect, shotPos[0].position, shotPos[0].rotation); //if(isSeeRight) //{ // Vector3 localScale = shoteff.transform.localScale; // shoteff.transform.localScale = new Vector3(-localScale.x, localScale.y); //} EnemyBulletScript bullet = Instantiate(enemyBullet, shotPostion.position, shotPostion.rotation) as EnemyBulletScript; bullet.isSeeRight = isSeeRight; bullet.MoveToPlayer(player); }
public void Shot() { GameObject Shot_effect = Instantiate(ShotEffect, shotPos.position, shotPos.rotation); EnemyBulletScript enemy_Bullet = Instantiate(bullet, shotPos.position, shotPos.rotation) as EnemyBulletScript; if (isSeeRight) { Vector2 localScale = Shot_effect.transform.localScale; Shot_effect.transform.localScale = new Vector2(-localScale.x, localScale.y); } // enemy_Bullet = Instantiate(bullet, shotPos.position, shotPos.rotation); bullet.isSeeRight = isSeeRight; enemy_Bullet.MoveToPlayer(player.gameObject.transform.position); }