Spawning a prefab and setting it to player 2

I am current making a small 3rd person tank shooter, my problem is i have a spawn code, however i have no idea how to have said line of code set the player to player 2 which is a variable in a script on it. This is player 2’s spawn code:
whatToSpawnClone[0] = Instantiate(whatToSpawnPrefab[0], spawnLocations[1].transform.position, Quaternion.Euler(0,90,0)) as GameObject;
On the prefab is a script called ShankShooting and i just need to have it set the variable:
public int m_PlayerNumber = 2; on said script. Any Ideas?

Something like this?

whatToSpawnClone[0].GetComponent<ShankShooting>().m_PlayerNumber= 2;