#Which way is better for organizing/easy access?

1 messages · Page 1 of 1 (latest)

lean crest
#

Putting variables in batches according to their types, or their use cases?

1.
public float f,h,j; // Primitive types
float f1;
[HideInInspector]public float f2, f3;
public int f,h,j;
int f1;
bool brrr;

public Class1 fsa; // Self made classes here
public Class2 fdsln;

public Transform ffff; // Unity Components/behaviours
public GameObject fndsjfsd;

public Vector3 fsadas; // Unity Data types
public Quaternion fdsfs;
2.
float animationSpeed;
Animator animator;
string[] animationNames;
int[] animationIndices;
bool animationIsPlaying;

float cardSpeed;
Transform cardTransform;
Card cardScript;
bool isCardOut;
civic cobalt
lean crest
#

true but there are many times when you just need many individual variables

#

how to deal with them

civic cobalt
# lean crest how to deal with them

wrap them in a class if they are to be used multiple types
Serialize that class so you can get a collapsable element
You can also make a property attribute so it can done with a group of elements

lean crest
#

oh

#

i didn't know you can even serialize classes for inspector

#

that's a really nice info

unborn folio
#

u can use [Header]

dawn shuttle
lean crest
#

I've tried using headers but I don't really like em

#

serializing classes might be the one I would love to use tho

unborn folio
#

serializing ?

#

how

dawn shuttle