I want execute the function “SetDefault()” when the variable “setDefault” is true.
i mean, i want set default values in the fields if it is necessary.
How can i do that?
Thank you so much!!
//-------------------------------------------------
[Serializable]
public class Hiter
{
[TagSelector]
public string hiterTag;
public Colliders2D colliderType;
public enum Colliders2D { BoxCollider2D, CircleCollider2D, CapsuleCollider2D };
}
//-------------------------------------------------
[Serializable]
public class Hiters
{
public bool setDefault;
public Hiter[] hiter = new Hiter[] { };
void SetDefault()
{
Hiter hiter1 = new Hiter();
hiter1.hiterTag = Tags.enemy;
hiter1.colliderType = Hiter.Colliders2D.BoxCollider2D;
hiter.SetValue(hiter1, 0);
Hiter hiter2 = new Hiter();
hiter2.hiterTag = Tags.player;
hiter2.colliderType = Hiter.Colliders2D.BoxCollider2D;
hiter.SetValue(hiter2, 1);
}
}
//-------------------------------------------------
Ok, i’m sorry, it is posible move the thread? or i must delete it and repost it there?
The Start method doest’n works insie of a serializable class becouse it is not a derivated class from Monobehaviour class and i want to see the changes on the editor fields and remember it.
The constructor does not works either. The editor create the instance but i can’t see the changes in the form fields. Or maybe i am not using the right way to change the form fields values.