void Start() { config = GetComponent <EnemyPrefabConfig> (); model = config.enemyModel; view = config.enemyView; model.SetMaxHealth(config.maxHealth); }
public void Init() { gameObject = new GameObject(); gameObject.AddComponent <EnemyModel>(); model = gameObject.GetComponent <EnemyModel>(); maxHealth = 100; model.SetMaxHealth(maxHealth); }