Answer the question
In order to leave comments, you need to log in
Isn't it dangerous to serialize classes in this way regarding unity?
Hello. A little long question for you in the feed)). In my project, I would like to drop the monobehaviour classes in the main logic. Do something like this:
public class Tower : MonoBehaviour
{
[SerializeField] protected HealthComponent healthComponent;
private ArmsComponent _armsComponent;
}
[Serializable]
public class ArmsComponent
{
public int typeArm;
// Логика класса
}
[Serializable]
public class HealthComponent
{
public int health;
// Логика класса
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question