// Use this for initialization void Start () { IEnemyFactory factory = new EnemyFactoryEasy (); factory.createEnemyA ().show (); factory.createEnemyB().show(); IEnemyFactory factoryHard = new EnemyFactoryHard (); factoryHard.createEnemyA ().show (); factoryHard.createEnemyB ().show (); }
void Awake() { IEnemyB hardB = new EnemyFactoryHard().createEnemyB(); moveSpeed = hardB.getMoveSpeed(); // The speed the enemy moves at. HP = hardB.getHP(); // Setting up the references. ren = transform.Find("body").GetComponent<SpriteRenderer>(); frontCheck = transform.Find("frontCheck").transform; score = GameObject.Find("Score").GetComponent<Score>(); scoreUpdater = new ScoreUpdater(); }