// Start is called before the first frame update void Start() { DontDestroyOnLoad(this); redEnemies.Add(GameObject.Find("Red")); blueEnemies.Add(GameObject.Find("Blue")); var eventArgs = new InitEnemyEventArgs(); eventArgs.enemy = redEnemies[0]; onInitRedEnemy(this, eventArgs); eventArgs.enemy = blueEnemies[0]; onInitBlueEnemy(this, eventArgs); //StartCoroutine(generateEnemy()); }
private void initBlueEnemy(object sender, InitEnemyEventArgs e) { BlueEnemyView enemyView = e.enemy.GetComponent <BlueEnemyView>(); BlueEnemyModel enemyModel = new BlueEnemyModel(new EnemyEntity(blueEnemyData)); BlueEnemyController enemyController = new BlueEnemyController(enemyModel, enemyView); }
private void initRedEnemy(object sender, InitEnemyEventArgs e) { RedEnemyView enemyView = e.enemy.GetComponent <RedEnemyView>(); RedEnemyModel enemyModel = new RedEnemyModel(new EnemyEntity(redEnemyData)); RedEnemyController enemyController = new RedEnemyController(enemyModel, enemyView); }