コード例 #1
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;
        }
コード例 #2
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;
        }
コード例 #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;
        }
コード例 #4
0
 public UShootActor AddShootEvent(UnityAction <UBulletObject> newEvent)
 {
     if (shootEvents == null)
     {
         shootEvents = new UShootEvent();
     }
     shootEvents.AddListener(newEvent);
     return(this);
 }
コード例 #5
0
 public UShootActor ClearShootEvents()
 {
     shootEvents = null;
     return(this);
 }