Skip to content

Simple class for Unity that lets you add a [StayPositive] tag to variable to make them stay positive.

Notifications You must be signed in to change notification settings

fernantastic/staypositiveattribute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Stay Positive attribute for Unity

Add the [StayPositive] tag in front of a variable and the editor won't let it become a negative number.

Works for float, int, vector2, vector3 and vector4.

[StayPositive] public float positiveFloat = 1;
[StayPositive] public int positiveInt = 1;
[StayPositive] public Vector3 positiveVector = Vector3.one;

Installation

Copy this anywhere in your Unity project (that's not an Editor folder).

About

Simple class for Unity that lets you add a [StayPositive] tag to variable to make them stay positive.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages