Search Unity

MonoBehavior's {} Question

Discussion in 'Scripting' started by RSutton84, Apr 15, 2014.

  1. RSutton84

    RSutton84

    Joined:
    May 29, 2013
    Posts:
    4
    Ok, so im not one to really post these type of questions but it is taking alot of my time to have my { stay on the same lines in Monobehavior and having to go back and change it every time

    instead of void blah(){}

    I want Monobehavior to do this for me

    void blah()
    {
    }
    Any answer? Cant find the right option in the editor
     
  2. shaderop

    shaderop

    Joined:
    Nov 24, 2010
    Posts:
    942
    Do you mean that MonoDevelop changes the curly braces placement every time you open an existing file? Or do you mean that you want to have it so that when you create a new script file the curly braces are placed on new lines?
     
  3. RSutton84

    RSutton84

    Joined:
    May 29, 2013
    Posts:
    4
    Both:
    Everytime I save the file i get it where its doing this:
    if (!photonView.isMine) {
    transform.position = Vector3.Lerp (transform.position, this.correctPlayerPos, Time.deltaTime * 5);
    transform.rotation = Quaternion.Lerp (transform.rotation, this.correctPlayerRot, Time.deltaTime * 5);
    }

    instead of how I want it like this:

    if (!photonView.isMine)
    {
    transform.position = Vector3.Lerp (transform.position, this.correctPlayerPos, Time.deltaTime * 5);
    transform.rotation = Quaternion.Lerp (transform.rotation, this.correctPlayerRot, Time.deltaTime * 5);
    }