Page 1 of 3 123 LastLast
Results 1 to 10 of 30
  1. #1
    Join Date
    Oct 2008
    Location
    Holy Land
    Posts
    313

    Lightbulb Unity Tip$ and Trick$

    I'm sitting right now on the manual, digging for cool tips for unity.
    if you guys have some. Share your weapons!!

    Tip of the day:
    Tired of switching your fields from private to public?

    To see private fields in the inspector, RMB on the inspector tab header and chose "Debug".
    anytime you can come back by selecting "Normal"

    Last edited by hareljann; 10-28-2010 at 09:30 AM.

  2. #2
    Join Date
    Jun 2008
    Posts
    1,088
    Awesome tip! I am guessing this is new to 3.0? If not I didn't ever cacth this so thanks for the heads up!

    -Dane

  3. #3
    Join Date
    Oct 2008
    Location
    Holy Land
    Posts
    313
    np, you welcome!

    I don't remember but I think it was also in 2.6..

  4. #4
    Join Date
    Apr 2010
    Posts
    60
    Hide public fields from showing up in the inspector by using [HideInInspector]

    Code:
     
    using UnityEngine;
    using System.Collections;
    
    public class Example : MonoBehaviour {
    
       [HideInInspector]
       public int i;      // Will not show in the inspector
    	
    	
       void Start(){
          i = 1;
       }
    }

  5. #5
    Join Date
    May 2008
    Posts
    542
    I really wish Unity showed properties in the inspector... sigh.

    A man can dream though, a man can dream.
    Hello everyone and welcome to another 3DBuzz VTM, and tonight we'll be programming in Brain****!

  6. #6
    Join Date
    Oct 2008
    Location
    Holy Land
    Posts
    313
    Tip of the day:
    ... damn ... I can't get this objects to snap! and no! I'm not willing to make all my object 1X1 boxes!

    Introducing VERTEX SNAPPING

    -in transform tool press and hold the V key to activate the vertex snapping mode.
    -Move your cursor over the vertex on your mesh that you want to use as the pivot point.
    -Hold down the left button once your cursor is over the desired vertex and drag your mesh next to any other vertex on another mesh.
    -Release your mouse button and the V key when you are happy with the results.
    -Shift-V acts as a toggle of this functionality.
    -You can snap vertex to vertex, vertex to surface and pivot to vertex.

    Now, building levels are much easier!
    edit: the tip works only in unity 3.0.
    Last edited by hareljann; 10-31-2010 at 09:01 AM.

  7. #7
    Join Date
    Jun 2003
    Location
    Beiseker, Alberta, Canada
    Posts
    2,611
    Wow, some nice tips! Thanks for sharing these!
    For me, happiness is learning new things.

  8. #8
    Join Date
    Dec 2007
    Location
    Austin, Texas
    Posts
    499
    If you want to be able to edit a non-monobehaviour class in the inspector, and you have it as a variable in another class, just put:
    [System.Serializable] above the class definition!

    Example:
    Code:
    [System.Serializable]
    public class Stat {
    	public string statName;
    	public string statDescription;
    	public int Value = 0;
    	public int modValue = 0;
    }

  9. #9
    Join Date
    Apr 2002
    Location
    Denmark
    Posts
    1,823
    Quote Originally Posted by septien View Post
    Hide public fields from showing up in the inspector by using [HideInInspector]

    Code:
     
    using UnityEngine;
    using System.Collections;
    
    public class Example : MonoBehaviour {
    
       [HideInInspector]
       public int i;      // Will not show in the inspector
    	
    	
       void Start(){
          i = 1;
       }
    }
    Cool. Can you somehow use it for multiple lines of fields?
    Dan 'pezz' Kronholm.
    Currently working on: The MMO class!.
    Previously working on: Game called "Boom Bots", while learning Unity and C#. WIP thread here.

  10. #10
    Join Date
    Oct 2008
    Location
    Holy Land
    Posts
    313
    Quote Originally Posted by m50 View Post
    If you want to be able to edit a non-monobehaviour class in the inspector, and you have it as a variable in another class, just put:
    [System.Serializable] above the class definition!

    Example:
    Code:
    [System.Serializable]
    public class Stat {
    	public string statName;
    	public string statDescription;
    	public int Value = 0;
    	public int modValue = 0;
    }

    hi, nice one! Thanks..

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •