Answers for "unity separator in inspector"

C#
4

unity separator in inspector

using UnityEngine;

public class Example : MonoBehaviour
{
	//Use this PropertyAttribute to add a header above some fields in the Inspector.
    [Header("Hi there!")]
    
    //Space between variables 
    [Space(10)]
    
    //Attribute used to make a float or int variable in a script be restricted to a specific range.
 	//public RangeAttribute(float min, float max);
    [Range(5,9)]

    public string playerName = "Unnamed";
}
Posted by: Guest on May-14-2020
1

Create gaps / headers between variables in the unity inspector

float variable1;
[Space] //Creates a space inside of the unity editor
[Header("This is a header")] //Creates a header inside of the unity editor
float variable2;
Posted by: Guest on October-27-2020

Code answers related to "unity separator in inspector"

C# Answers by Framework

Browse Popular Code Answers by Language