示例#1
0
    public void setUpWeapons(PlayerInfo pi)
    {
        weaponHandling.player        = GetComponent <PlayerBase>();
        weaponHandling.specialWeapon = GetComponent <WeaponSpecial>();

        WeaponBase pistol     = new WeaponPistol(pi.charEnum);
        WeaponBase sniper     = new WeaponSniper();
        WeaponBase biogun     = new WeaponBiogun();
        WeaponBase MP40       = new WeaponMP40();
        WeaponBase mine       = new WeaponMine();
        WeaponBase flame      = new WeaponFlamethrower();
        Transform  childFlame = transform.Find("Flame");

        weaponHandling.flamethrower = childFlame.GetComponent <WeaponFlamethrowerLogic>();

        //WeaponBase specialCurie = new WeaponSpecialCurieLogic();
        // Tu sa vytvoria vsetky zbrane ktore sa priradia do weapon handling aby sa nemusel volat zbytocne load na sprajtoch
        //weaponHandling.weapons.Add(WeaponEnum.specialCurie, special);
        WeaponBase special = null;

        switch (pi.charEnum)
        {
        case CharacterEnum.Tesla:
            special = new WeaponTeslaSpecial();
            weaponHandling.specialWeapon.SetUp(pi, transform.parent.GetComponent <BulletManager>(), this, special);
            weaponHandling.weapons.Add(WeaponEnum.specialTesla, special);
            break;

        case CharacterEnum.Curie:
            special = new WeaponCurieSpecial();
            weaponHandling.specialWeapon.SetUp(pi, transform.parent.GetComponent <BulletManager>(), this, special);
            weaponHandling.weapons.Add(WeaponEnum.specialCurie, special);
            break;

        case CharacterEnum.DaVinci:
            special = new WeaponDaVinciSpecial();
            //special = new WeaponTeslaSpecial();
            weaponHandling.specialWeapon.SetUp(pi, transform.parent.GetComponent <BulletManager>(), this, special);
            weaponHandling.weapons.Add(WeaponEnum.specialDaVinci, special);
            //weaponHandling.specialWeapon.SetUp(pi, transform.parent.GetComponent<BulletManager>(), this, special);
            //weaponHandling.weapons.Add(WeaponEnum.specialTesla, special);
            break;

        case CharacterEnum.Einstein:
            special = new WeaponEinsteinSpecial();
            weaponHandling.specialWeapon.SetUp(pi, transform.parent.GetComponent <BulletManager>(), this, special);
            weaponHandling.weapons.Add(WeaponEnum.specialEinstein, special);
            break;

        case CharacterEnum.Nobel:
            special = new WeaponNobelSpecial();
            weaponHandling.specialWeapon.SetUp(pi, transform.parent.GetComponent <BulletManager>(), this, special);
            weaponHandling.weapons.Add(WeaponEnum.specialNobel, special);
            break;
        }

        weaponHandling.weapons.Add(WeaponEnum.sniper, sniper);
        weaponHandling.weapons.Add(WeaponEnum.pistol, pistol);
        weaponHandling.weapons.Add(WeaponEnum.biogun, biogun);
        weaponHandling.weapons.Add(WeaponEnum.MP40, MP40);
        weaponHandling.weapons.Add(WeaponEnum.mine, mine);
        weaponHandling.weapons.Add(WeaponEnum.flamethrower, flame);


        // Inicializacia prvej zbrane
        weaponHandling.inventory.Add(pistol);
        weaponHandling.inventory.Add(special);
        //weaponHandling.inventory.Add(flame);
        //weaponHandling.inventory.Add(sniper);
        //weaponHandling.inventory.Add(biogun);
        //weaponHandling.inventory.Add(MP40);
        //weaponHandling.inventory.Add(mine);

        weaponHandling.activeWeapon = weaponHandling.inventory[0];
    }
示例#2
0
    public void setUpWeapons(PlayerInfo pi)
    {
        weaponHandling.player = GetComponent<PlayerBase>();
        weaponHandling.specialWeapon = GetComponent<WeaponSpecial>();

        WeaponBase pistol = new WeaponPistol(pi.charEnum);
        WeaponBase sniper = new WeaponSniper();
        WeaponBase biogun = new WeaponBiogun();
        WeaponBase MP40 = new WeaponMP40();
        WeaponBase mine = new WeaponMine();
        WeaponBase flame = new WeaponFlamethrower();
        Transform childFlame = transform.Find("Flame");
        weaponHandling.flamethrower = childFlame.GetComponent<WeaponFlamethrowerLogic>();

        //WeaponBase specialCurie = new WeaponSpecialCurieLogic();
        // Tu sa vytvoria vsetky zbrane ktore sa priradia do weapon handling aby sa nemusel volat zbytocne load na sprajtoch
        //weaponHandling.weapons.Add(WeaponEnum.specialCurie, special);
        WeaponBase special = null;

        switch (pi.charEnum)
        {
            case CharacterEnum.Tesla:
                special = new WeaponTeslaSpecial();
                weaponHandling.specialWeapon.SetUp(pi, transform.parent.GetComponent<BulletManager>(), this, special);
                weaponHandling.weapons.Add(WeaponEnum.specialTesla, special);
                break;
            case CharacterEnum.Curie:
                special = new WeaponCurieSpecial();
                weaponHandling.specialWeapon.SetUp(pi, transform.parent.GetComponent<BulletManager>(), this, special);
                weaponHandling.weapons.Add(WeaponEnum.specialCurie, special);
                break;
            case CharacterEnum.DaVinci:
                special = new WeaponDaVinciSpecial();
                //special = new WeaponTeslaSpecial();
                weaponHandling.specialWeapon.SetUp(pi, transform.parent.GetComponent<BulletManager>(), this, special);
                weaponHandling.weapons.Add(WeaponEnum.specialDaVinci, special);
                //weaponHandling.specialWeapon.SetUp(pi, transform.parent.GetComponent<BulletManager>(), this, special);
                //weaponHandling.weapons.Add(WeaponEnum.specialTesla, special);
                break;
            case CharacterEnum.Einstein:
                special = new WeaponEinsteinSpecial();
                weaponHandling.specialWeapon.SetUp(pi, transform.parent.GetComponent<BulletManager>(), this, special);
                weaponHandling.weapons.Add(WeaponEnum.specialEinstein, special);
                break;
            case CharacterEnum.Nobel:
                special = new WeaponNobelSpecial();
                weaponHandling.specialWeapon.SetUp(pi, transform.parent.GetComponent<BulletManager>(), this, special);
                weaponHandling.weapons.Add(WeaponEnum.specialNobel, special);
                break;
        }

        weaponHandling.weapons.Add(WeaponEnum.sniper, sniper);
        weaponHandling.weapons.Add(WeaponEnum.pistol, pistol);
        weaponHandling.weapons.Add(WeaponEnum.biogun, biogun);
        weaponHandling.weapons.Add(WeaponEnum.MP40, MP40);
        weaponHandling.weapons.Add(WeaponEnum.mine, mine);
        weaponHandling.weapons.Add(WeaponEnum.flamethrower, flame);

        // Inicializacia prvej zbrane
        weaponHandling.inventory.Add(pistol);
        weaponHandling.inventory.Add(special);
        //weaponHandling.inventory.Add(flame);
        //weaponHandling.inventory.Add(sniper);
        //weaponHandling.inventory.Add(biogun);
        //weaponHandling.inventory.Add(MP40);
        //weaponHandling.inventory.Add(mine);

        weaponHandling.activeWeapon = weaponHandling.inventory[0];
    }