/// <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; } }
protected virtual void Start() { ObjectPooler = GetComponent <MMMultipleObjectPooler>(); _nextSpawnIn = InitialDelay; for (int i = 0; i < MaxEnemies; i++) { Spawn(); } }
/// <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(); }
/// <summary> /// On awake we fill our object pool /// </summary> protected virtual void Awake() { Instance = this; FillObjectPool(); }
protected virtual void Start() { ObjectPooler = GetComponent <MMMultipleObjectPooler>(); _nextSpawnIn = InitialDelay; }
/// <summary> /// On awake, we get the objectPooler component /// </summary> protected virtual void Awake() { _objectPooler = GetComponent <MMObjectPooler>(); _startTime = Time.time; }
private void Awake() { _tilemap = GetComponent <Tilemap>(); ObjectPooler = GetComponent <MMSimpleObjectPooler>(); }