Exemple #1
0
        public UShootStageFuncIntervalInfinite(System.Func <float> intervalFunc, int bulletIndex, UnityAction <UBulletObject> bulletInitAction, bool shouldBulletAddToMonitor = true, bool shouldBulletActivateCollider = true)
        {
            _intervalFunc = intervalFunc;

            if (bulletIndex < 0)
            {
                UDebug.Warning("shoot bullet index is negative, nothing will be shot");
                _bulletIndex = -1;
            }
            else
            {
                _bulletIndex = bulletIndex;
            }

            if (bulletInitAction != null)
            {
                _bulletInitEvent = new UShootEvent();
                _bulletInitEvent.AddListener(bulletInitAction);
            }

            _shouldBulletAddToMonitor     = shouldBulletAddToMonitor;
            _shouldBulletActivateCollider = shouldBulletActivateCollider;

            _isForceStopped = false;
        }
Exemple #2
0
        public UShootStageFuncInterval(int count, System.Func <float> intervalFunc, int bulletIndex, UnityAction <UBulletObject> bulletInitAction, bool shouldBulletAddToMonitor = true, bool shouldBulletActivateCollider = true)
        {
            if (count < 0)
            {
                UDebug.Warning("shoot count is negative, set to 0 instead");
                _count = 0;                 // Set to 0 in case of trouble
            }
            else
            {
                _count = count;
            }

            _intervalFunc = intervalFunc;

            if (bulletIndex < 0)
            {
                UDebug.Warning("shoot bullet index is negative, nothing will be shot");
                _bulletIndex = -1;
            }
            else
            {
                _bulletIndex = bulletIndex;
            }

            if (bulletInitAction != null)
            {
                _bulletInitEvent = new UShootEvent();
                _bulletInitEvent.AddListener(bulletInitAction);
            }

            _shouldBulletAddToMonitor     = shouldBulletAddToMonitor;
            _shouldBulletActivateCollider = shouldBulletActivateCollider;

            _isComplete = false;
        }
Exemple #3
0
        public UShootStageSameIntervalInfinite(float interval, int bulletIndex, UnityAction <UBulletObject> bulletInitAction, bool shouldBulletAddToMonitor = true, bool shouldBulletActivateCollider = true)
        {
            if (interval < 0f)
            {
                UDebug.Warning("shoot interval is negative, set to 0 instead");
                _interval = 0f;
            }
            else
            {
                _interval = interval;
            }
            if (bulletIndex < 0)
            {
                UDebug.Warning("shoot bullet index is negative, nothing will be shot");
                _bulletIndex = -1;
            }
            else
            {
                _bulletIndex = bulletIndex;
            }

            if (bulletInitAction != null)
            {
                _bulletInitEvent = new UShootEvent();
                _bulletInitEvent.AddListener(bulletInitAction);
            }

            _shouldBulletAddToMonitor     = shouldBulletAddToMonitor;
            _shouldBulletActivateCollider = shouldBulletActivateCollider;

            _isForceStopped = false;
        }
Exemple #4
0
 public int GetPoolID()
 {
     if (poolID < 0)
     {
         UDebug.Warning("negative pool ID, probably not set");
     }
     return(poolID);
 }
Exemple #5
0
 public UShooter Shoot()
 {
     if (this.stages == null)
     {
         UDebug.Warning("no shoot stages added to shooter");
         return(this);
     }
     StartCoroutine(_ShootCoroutine());
     return(this);
 }
Exemple #6
0
 public IShootStage SetComplete(bool condition)
 {
     UDebug.Warning("UShootStageWaitFor.SetComplete() is called, you may be doing something undesirable. UShootStageWaitFor() is NOT compatible with loop types (since you fed it a predicate)");
     return(this);
 }