示例#1
0
    /// <summary>
    /// Initialize this weapon
    /// </summary>
    public override void Initialization()
    {
        base.Initialization();
        _aimableWeapon = GetComponent <WeaponAim>();

        if (!_poolInitialized)
        {
            // if (GetComponent<MMMultipleObjectPooler>() != null)
            // {
            //     ObjectPooler = GetComponent<MMMultipleObjectPooler>();
            // }
            if (GetComponent <MMSimpleObjectPooler>() != null)
            {
                ObjectPooler = GetComponent <MMSimpleObjectPooler>();
            }

            if (ObjectPooler == null)
            {
                Debug.LogWarning(this.name +
                                 " : no object pooler (simple or multiple) is attached to this Projectile Weapon, it won't be able to shoot anything.");
                return;
            }

            if (FlipWeaponOnCharacterFlip)
            {
                _flippedProjectileSpawnOffset   = ProjectileSpawnOffset;
                _flippedProjectileSpawnOffset.y = -_flippedProjectileSpawnOffset.y;
            }

            _poolInitialized = true;
        }
    }
示例#2
0
 /// <summary>
 /// On init we grab our pool and initialize our stuff
 /// </summary>
 public override void Initialization()
 {
     base.Initialization();
     _objectPool          = this.gameObject.GetComponent <MMSimpleObjectPooler>();
     RemainingBombs       = MaximumAmountOfBombsAtOnce;
     _addOneRemainingBomb = new WaitForSeconds(BombDelayBeforeExplosion);
 }
示例#3
0
    /// <summary>
    /// Called when a new level gets started to load all the scripts for upgrades from the current
    /// players GameObject.
    /// </summary>
    private void GetUpgradeInfo()
    {
        dashUpgrade     = player.GetComponent <CharacterDash>();
        jumpUpgrade     = player.GetComponent <CharacterJump>();
        runUpgrade      = player.GetComponent <CharacterHorizontalMovement>();
        wallJumpUpgrade = player.GetComponent <CharacterWalljump>();
        glideUpgrade    = player.GetComponent <CharacterGlide>();
        swimUpgrade     = player.GetComponent <CharacterSwim>();
        healthUpgrade   = player.GetComponent <Health>();
        rockUpgrade     = player.GetComponent <RockHolder>();
        rockWeapon      = player.GetComponent <CharacterWeaponRockHandler>().CurrentWeapon.GetComponent <ProjectileWeapon>();
        projectilePool  = player.GetComponent <CharacterWeaponRockHandler>().CurrentWeapon.GetComponent <MMSimpleObjectPooler>();
        laserSight      = player.GetComponent <CharacterWeaponRockHandler>().CurrentWeapon.GetComponent <WeaponLaserSight>();
        DebugUpgrades();

        laserSight.enabled = false;
    }