示例#1
0
        private void Start()
        {
            var heroFactory            = new HeroFactory(Instantiate(heroesConfiguration));
            var weaponFactory          = new WeaponFactory(Instantiate(weaponsConfiguration));
            var halloweenWeaponFactory = new WeaponFactory(Instantiate(halloweenWeaponsConfiguration));

            var consumerGameObject = new GameObject();

            consumer = consumerGameObject.AddComponent <Consumer>();

            battleFactory          = new BattleFactory(heroFactory, weaponFactory);
            halloweenBattleFactory = new BattleFactory(heroFactory, halloweenWeaponFactory);
            consumer.Configure(battleFactory);
        }
示例#2
0
 public void Configure(BattleFactory battleFactory)
 {
     currentBattleFactory = battleFactory;
 }