IEnumerator start_event(ShotEventData data, float delay, int shot_ID, int card_ID) { List <BulletDeluxe> bullets; if (data == null) { Debug.Log("Event not set. Check scriptable object for event."); Debug.Break(); yield return(null); } yield return(new WaitForSeconds(delay)); switch (data.affectsWhichBullets) { default: case BulletSelection.ALL_BULLETS: bullets = getAllBullets(); break; case BulletSelection.SHOT_BULLETS: bullets = getShotBullets(shot_ID); break; case BulletSelection.INTERLACED_THREAD_BULLETS: bullets = getInterlacedThreadBullets(shot_ID, data.countEachNElements, data.startCountingOn); break; case BulletSelection.INTERLACED_WAVE_BULLETS: bullets = getInterlacedWaveBullets(shot_ID, data.countEachNElements, data.startCountingOn); break; case BulletSelection.INTERLACED_BULLET_BULLETS: bullets = getInterlacedBulletBullets(shot_ID, data.countEachNElements, data.startCountingOn); break; case BulletSelection.EARLIEST_WAVE_BULLETS: bullets = getEarliestWaveBullets(shot_ID); break; case BulletSelection.CARD_BULLETS: bullets = getCardBullets(card_ID); break; } switch (data.action) { default: case BulletAction.PLAYER_DIRECTION: sendPlayerDirection(bullets, data.acceleration); break; case BulletAction.PLAYER_CONSTANT_DIRECTION: sendPlayerConstantDirection(bullets, data.acceleration); break; case BulletAction.EMITTER_DIRECTION: sendEmitterDirection(bullets, data.acceleration); break; case BulletAction.EMITTER_CONSTANT_DIRECTION: sendEmitterConstantDirection(bullets, data.acceleration); break; case BulletAction.DEACCELERATION: sendDeacceleration(bullets, data.deacceleration); break; } }
public void fileEvent(ShotEventData data, float delay, int shot_ID, int card_ID) { StartCoroutine(start_event(data, delay, shot_ID, card_ID)); }