コード例 #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
    protected virtual void Start()
    {
        ObjectPooler = GetComponent <MMMultipleObjectPooler>();
        _nextSpawnIn = InitialDelay;

        for (int i = 0; i < MaxEnemies; i++)
        {
            Spawn();
        }
    }
コード例 #3
0
ファイル: TimedSpawner.cs プロジェクト: leonidas192/Iseng
 /// <summary>
 /// Grabs the associated object pooler if there's one, and initalizes the frequency
 /// </summary>
 protected virtual void Initialization()
 {
     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;
     }
     DetermineNextFrequency();
 }
コード例 #4
0
 /// <summary>
 /// On awake we fill our object pool
 /// </summary>
 protected virtual void Awake()
 {
     Instance = this;
     FillObjectPool();
 }
コード例 #5
0
 protected virtual void Start()
 {
     ObjectPooler = GetComponent <MMMultipleObjectPooler>();
     _nextSpawnIn = InitialDelay;
 }
コード例 #6
0
 /// <summary>
 /// On awake, we get the objectPooler component
 /// </summary>
 protected virtual void Awake()
 {
     _objectPooler = GetComponent <MMObjectPooler>();
     _startTime    = Time.time;
 }
コード例 #7
0
 private void Awake()
 {
     _tilemap     = GetComponent <Tilemap>();
     ObjectPooler = GetComponent <MMSimpleObjectPooler>();
 }