예제 #1
0
    public ICharacter CreateCharacter(string characterName)
    {
        ISoldier soldier   = null;
        string   assetName = "";

        switch (characterName)
        {
        case "Captain":
            assetName = "Captain";
            break;

        case "Captive":
            assetName = "Captive";
            break;

        case "Rookie":
            assetName = "Rookie";
            break;

        case "Sergeant":
            assetName = "Sergeant";
            break;
        }

        IAssetsFactory resoureLoadFactory = new ResouresLoadFactory();
        GameObject     GO = resoureLoadFactory.LoadSoldier(assetName);

        switch (characterName)
        {
        case "Captain":
            soldier = new SoldierCaptain();
            break;

        case "Captive":
            soldier = new SoldierCaptive();
            break;

        case "Rookie":
            soldier = new SoldierRookie();
            break;

        case "Sergeant":
            soldier = new SoldierSergeant();
            break;
        }

        return(soldier);
    }
예제 #2
0
    public IWeapon CreateWeapon(WeaponType type)
    {
        IWeapon weapon    = null;
        string  assetName = "";

        switch (type)
        {
        case WeaponType.Gun:
            assetName = "Gun";
            break;

        case WeaponType.Rifle:
            assetName = "Rifle";
            break;

        case WeaponType.Rocket:
            assetName = "Rocket";
            break;
        }

        IAssetsFactory resoureLoadFactory = new ResouresLoadFactory();
        GameObject     GO = resoureLoadFactory.LoadWeapon(assetName);

        switch (type)
        {
        case WeaponType.Gun:
            weapon = new WeaponGun(30, 4, GO);
            break;

        case WeaponType.Rifle:
            weapon = new WeaponRifle(40, 6, GO);
            break;

        case WeaponType.Rocket:
            weapon = new WeaponRocket(60, 8, GO);
            break;
        }

        return(weapon);
    }
예제 #3
0
    public ICharacter CreateCharacter(string characterName)
    {
        IEnemy enemy     = null;
        string assetName = "";

        switch (characterName)
        {
        case "Elf":
            assetName = "Elf";
            break;

        case "Ogre":
            assetName = "Ogre";
            break;

        case "Troll":
            assetName = "Troll";
            break;
        }

        IAssetsFactory resoureLoadFactory = new ResouresLoadFactory();
        GameObject     GO = resoureLoadFactory.LoadSoldier(assetName);

        switch (characterName)
        {
        case "Elf":
            enemy = new EnemyElf();
            break;

        case "Ogre":
            enemy = new EnemyOgre();
            break;

        case "Troll":
            enemy = new EnemyTroll();
            break;
        }

        return(enemy);
    }