public DelayedCall delayCall(Delegate call, float delay, object[] args=null) { if (call == null) return null; var delayedCall = new DelayedCall(call, delay, args); add(delayedCall); return delayedCall; }
/** Delays the execution of a function until a certain time has passed. Creates an * object of type 'DelayedCall' internally and returns it. Remove that object * from the juggler to cancel the function call. */ public DelayedCall delayCall(DelayedCall.CallbackDelegate call, float delay) { if (call == null) return null; var delayedCall = new DelayedCall(new DelayedCall.CallbackDelegate(call), delay); add(delayedCall); return delayedCall; }
public DelayedCall delayCall(DelayedCall.CallbackDelegateWithArgs call, float delay, object[] args) { if (call == null) return null; var delayedCall = new DelayedCall(new DelayedCall.CallbackDelegateWithArgs(call), delay, args); add(delayedCall); return delayedCall; }
/** * Shakes the camera harness * @param intensity How much to shake the camera (max radius for randomization off center) * @param pulses How make shake pulses to do before the shake effect stops. */ public void shake(float intensity=5f, int pulses=5) { if (pulses < 1) { return; } object[] shakeArgs = new object[]{ intensity }; _shaker = _juggler.delayCall(new shakeDelegate(doShake), CAMERA_SHAKE_INTERVAL, shakeArgs); _shaker.repeatCount=pulses + 1; _juggler.add(_shaker); _shaking=true; startMoving(); }