title: Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption
body: <p>I checked this code with a friend that has a better knowledge of Unity, but we can't find the problem.
  Basically, Unity says that i can't parent a prefab, but i'm trying to change the parent of an instanced object, not the prefab.</p>
  <p>I can't understand the error (but I think that it's in the Update method)</p>
  <pre><code>public GameObject[] Weapons;
  public float projectileSpeed;
  public float bulletTime;
  public Rigidbody bullet;
  
  private bool canShoot = true;
  private float t = 0f;
  private int actualBullets;
  private GameObject actualWeapon;
  
  
  private void Update()
  {
      t += Time.deltaTime;
      if (actualWeapon != null)
          return;
      actualWeapon = GameObject.Instantiate(Weapons[0], gunPosition.position, gunPosition.rotation) as GameObject;
      actualWeapon.transform.parent = GameManager.instance.player.transform;      
  }
  public virtual void Fire() 
  {
      if (canShoot)
      {
          actualBullets--;
          var nBullet = GameObject.Instantiate(bullet, bulletSpawn.position, Quaternion.identity) as Rigidbody;
          
          nBullet.AddForce (new Vector3(Vector3.forward.x, Vector3.forward.y, projectileSpeed));
          canShoot = false;
      }
      else if (t &gt; bulletTime)
          (canShoot, t) = (true, 0);
  }
  </code></pre>