- Home /
Question by
Dave1 · Oct 11, 2014 at 03:41 AM ·
adsadvertisingframerate drops
Why is our framerate hurt by adding in ads?
We implemented some Lifestreet ads in our Facebook Unity3d game. After doing so we see a big drop in our framerate. They look like simple animated ads and they run some Flash code and are in separate html divs so we didn't think it would have an effect on our game. Any ideas why the drop in framerate? Below is the example code they gave us to implement:
Application.ExternalEval( "var jscript = document.createElement('script');" + "jscript.setAttribute('type', 'text/javascript');" + "jscript.async = true;" + "jscript.src = '//ads.lfstmedia.com/getad?site=25000';" + "var stag = document.getElementsByTagName('script')[0];" + "stag.parentNode.insertBefore(jscript, stag);");
Application.ExternalEval(
"var ad_div = document.createElement('div');"+
"ad_div.setAttribute('id', 'lsm_ad_div');"+
"ad_div.style.textAlign='center';"+
"var body = document.getElementsByTagName('body')[0];"+
"var insertionPoint = body.children[0];"+
"body.insertBefore(ad_div, insertionPoint);"+
"(function delayedAdBuilder() {"+
"if (typeof LSM_Slot !== 'undefined') {"+
"LSM_Slot({"+
"slot: 'slot25000',"+
"adkey: 'fff',"+
"ad_size: '728x90',"+
"_render_div_id: 'lsm_ad_div'"+
"});"+
"} else {"+
"setTimeout(delayedAdBuilder, 20);"+
"}"+
"})();"
);
Comment