var FFont_GetLetter = function(c) {var/*var*/l=this.FindLetter(c);if(l==null){if(char.IsLower(c)){return this.FindLetter(char.ToUpper(c));}else if(char.IsUpper(c)){return this.FindLetter(char.ToLower(c));}return null;}else{return l;}};

var FFont_FindLetter = function(c) {for(var/*int*/i=0;i<this.Letters.Length;i++){var/*var*/letter=this.Letters[i];if(letter.Letter==c){return letter;}}return null;};

var RenderTextureToScreen_OnPostRender = function() {GL.PushMatrix();GL.LoadOrtho();for(var/*var*/i=0;i<this.mat.passCount;++i){this.mat.SetPass(i);GL.Begin(GL.QUADS);GL.TexCoord2(0,1);GL.Vertex3(0.0,1.0,0.1);GL.TexCoord2(1,1);GL.Vertex3(1.0,1.0,0.1);GL.TexCoord2(1,0);GL.Vertex3(1.0,0.0,0.1);GL.TexCoord2(0,0);GL.Vertex3(0.0,0.0,0.1);GL.End();}GL.PopMatrix();};

var HandleBgMat_Update = function() {if(Camera.main!=null){this.BgMat.SetVector("_ CamDir",Camera.main.transform.forward);this.BgMat.SetVector("_ CamUp",Camera.main.transform.up);this.BgMat.SetVector("_ CamRight",Camera.main.transform.right);}this.BgMat.SetFloat("_ Z",0.5+this.tl.Beat()*0.2);this.BgMat.SetFloat("_ T",Time.time);this.OverlayMat.SetFloat("_ T",Time.time);var/*bool*/totalFuckup=(this.tl.T()>31000&&this.tl.T()<32700)||(this.tl.T()>60000&&this.tl.T()<61700);if(totalFuckup){this.BgMat.SetFloat("_ T",Time.time*100.0);this.BgMat.SetFloat("_ Mul",Mathf.Repeat(Time.time*20.0,1.0)*5.0);}else{this.BgMat.SetFloat("_ T",Time.time);this.BgMat.SetFloat("_ Mul",1.0);}};

var FontText_Start = function() {if(!this.Generated){this.GenerateText();}};

var FontText_Update = function() {if(Application.isEditor){if(this.GeneratedText!=this.Text){this.SetText(this.Text);}}};

var FontText_SetText = function(text) {this.Text=text;var/*int*/cCount=this.transform.childCount;for(var/*int*/i=0;i<cCount;i++){GameObject.DestroyImmediate(this.transform.GetChild(0).gameObject);}this.GenerateText();};

var FontText_GenerateText = function() {var/*var*/x=0.0;var/*var*/x_offset=0.0;if(this.Center){for(var/*int*/i=0;i<this.Text.Length;i++){var/*char*/letter=this.Text[i];var/*var*/prefab=this.Font.GetLetter(letter);if(prefab!=null){x_offset-=prefab.xOffset0*0.5;x_offset-=prefab.xOffset1*0.5;}else{x+=this.Font.SpaceSpacing*0.5;}}}for(var/*int*/i=0;i<this.Text.Length;i++){var/*char*/letter=this.Text[i];var/*var*/prefab=this.Font.GetLetter(letter);if(prefab!=null){x+=prefab.xOffset0;var/*var*/letterObj=GameObject.Instantiate(prefab.Obj);letterObj.transform.parent=this.transform;letterObj.transform.localRotation=Quaternion.identity;letterObj.transform.localPosition=new Vector3(x+x_offset,0,0);if(this.OverrideMaterial!=null){letterObj.GetComponent("MeshRenderer").sharedMaterials=[ this.OverrideMaterial];}x+=prefab.xOffset1;}else{x+=this.Font.SpaceSpacing;}}this.Generated=true;this.GeneratedText=this.Text;};

var SceneTekst2_OnEnable = function() {this.SetText(0);this.RandomizeCamera();};

var SceneTekst2_Update = function() {var/*var*/t=this.tl.T()-this.demo.TimeSceneTekst2;for(var/*int*/i=0;i<this.tekstit.Length;i++){for(var/*int*/j=0;j<2;j++){if(this.tl.PassedT(this.demo.TimeSceneTekst2+i*this.timeInterval+j*this.timeInterval/2)){this.RandomizeCamera();}}if(this.tl.PassedT(this.demo.TimeSceneTekst2+i*this.timeInterval)){this.SetText(i);}}this.textobj.transform.rotation=Quaternion.AngleAxis(-90+Mathf.Repeat(4.0*/*(float)*/t*180.0/this.timeInterval,180.0),new Vector3(0,1,0));};

var SceneTekst2_RandomizeCamera = function() {this.cameraObj.transform.position=new Vector3(0,Random.Range(-1.5,2.5),-this.textLen*0.5);this.cameraObj.transform.forward=Vector3.Normalized(new Vector3(0,0,0).Sub(this.cameraObj.transform.position));};

var SceneTekst2_SetText = function(i) {this.text.SetText(this.tekstit[i]);this.textLen=this.tekstit[i].Length;};

var SceneTekst3_Awake = function() {this.inited=true;this.path=this.GeneratePath();var/*float*/x=0;for(var/*int*/i=0;i<this.text.Length;i++){var/*char*/c=this.text[i];var/*var*/letter=this.font.GetLetter(c);if(letter!=null){x+=letter.xOffset0*1.25;var/*var*/obj=/*(GameObject)*/GameObject.Instantiate(letter.Obj);obj.GetComponent("MeshRenderer").sharedMaterials=[ this.letterMat];obj.transform.parent=this.transform;var/*var*/p0=this.GetPathPos(this.path,x);var/*var*/p1=this.GetPathPos(this.path,x+0.1);var/*var*/d=Vector3.Normalized(p1.Sub(p0));obj.transform.position=this.GetPathPos(this.path,x);obj.transform.right=d;x+=letter.xOffset1*1.25;}else{x+=this.font.SpaceSpacing*1.25;}}};

var SceneTekst3_Update = function() {var/*var*/t=this.tl.T()-this.demo.TimeSceneTekst3;var/*var*/x=t*0.01;var/*var*/p0=this.GetPathPos(this.path,x);var/*var*/p1=this.GetPathPos(this.path,x+0.1);var/*var*/p2=this.GetPathPos(this.path,x+Mathf.Sin(t*0.01));var/*var*/d=Vector3.Normalized(p1.Sub(p0));this.cameraObject.transform.position=p0;this.cameraObject.transform.right=d;var/*var*/f=this.cameraObject.transform.forward;var/*var*/b=this.tl.Beat();var/*var*/m=1.0-b*1.5;if(m<0)m=0;var/*var*/yoff=Mathf.Sin(b*10)*m*0.5;this.cameraObject.transform.position=p0.Sub(f.Mul(4.0)).Add((new Vector3(0,0,0)).Sub(this.cameraObject.transform.up.Mul(yoff)));};

var SceneTekst3_GeneratePath = function() {var/*var*/sentences=this.GetSentences(this.text);var/*var*/npath=[];var/*Vector3*/p=new Vector3(0,0,0);var/*Vector3*/dir=new Vector3(1,0,0);for(var/*int*/i=0;i<160;i++){p=p.Add(dir.Mul(5.0));var/*var*/rnd=new Vector3(Random.Range(-1.0,1.0),Random.Range(-1.0,1.0),Random.Range(-1.0,1.0));dir=Vector3.Normalized(dir.Add(Vector3.Normalized(rnd.Mul(0.25))));npath.Add(p);}return npath;};

var SceneTekst3_GetPathPos = function(path, p) {if(p<0){return this.path[0];}for(var/*int*/i=1;i<this.path.Count;i++){var/*var*/E=this.path[i].Sub(this.path[i-1]);var/*var*/e=Vector3.Magnitude(E);if(p<e){var/*var*/p0=i>1?this.path[i-2]:this.path[0];var/*var*/p1=this.path[i-1];var/*var*/p2=this.path[i];var/*var*/p3=i<this.path.Count-1?this.path[i+1]:this.path[i];return this.catmull(p0,p1,p2,p3,p/e);}p-=e;}return this.path[this.path.Count-1];};

var SceneTekst3_catmull = function(p0, p1, p2, p3, t) {return new Vector3(this.catmullf(p0.x,p1.x,p2.x,p3.x,t),this.catmullf(p0.y,p1.y,p2.y,p3.y,t),this.catmullf(p0.z,p1.z,p2.z,p3.z,t));};

var SceneTekst3_catmullf = function(p0, p1, p2, p3, t) {return p1+0.5*((-p0+p2)+(2.0*p0-5.0*p1+4.0*p2-p3)*t+(-p0+3.0*p1-3.0*p2+p3)*t*t)*t;};

var SceneTekst3_GetSentences = function(txt) {var/*List*/s=[];var/*int*/N=0;var/*string*/sentence="";while(N<txt.Length){var/*var*/c=txt[N];if(c=='\n'){while(txt[N]=='\n'){N++;}s.Add(sentence);sentence="";c=txt[N];}sentence+=c;N++;}s.Add(sentence);return s;};

var SceneJoro_Update = function() {var/*var*/t=this.tl.T()-this.demo.TimeSceneJoro;if(t<0)return;var/*var*/pathi=Mathf.FloorToInt(t/this.interval);pathi%=this.pathit0.Length;var/*var*/g0=this.pathit0[pathi];var/*var*/g1=this.pathit1[pathi];var/*var*/pt=t%this.interval;var/*var*/ft=/*(float)*/pt/this.interval;this.cameraObj.transform.position=g0.transform.position.Add((g1.transform.position.Sub(g0.transform.position)).Mul(ft));this.cameraObj.transform.rotation=Quaternion.Slerp(g0.transform.rotation,g1.transform.rotation,ft);this.cameraObj.transform.position=this.cameraObj.transform.position.Add(new Vector3(Mathf.Sin(/*(float)*/t)+Mathf.Cos(/*(float)*/t*1.1),Mathf.Cos(/*(float)*/t)+Mathf.Cos(/*(float)*/t*1.3),Mathf.Sin(/*(float)*/t)+Mathf.Cos(/*(float)*/t*0.8)).Mul(0.01));};

var RotateSimuLogo_Update = function() {};

var SceneAlkuLogo_Awake = function() {this.origPos=this.cameraObject.transform.position;this.origRot=this.cameraObject.transform.rotation;};

var SceneAlkuLogo_Update = function() {var/*var*/t=this.tl.T();this.textObj.transform.rotation=Quaternion.AngleAxis(this.tl.Time()*425,new Vector3(0,1,0));var/*var*/b=this.tl.Beat();var/*var*/m=1.0-b*1.0;if(m<0)m=0;this.textObj.transform.position=new Vector3(0,Mathf.Cos(b*5)*m*0.2,0);if(t>=this.t0a&&t<this.t0b){var/*var*/pos0=this.node0a.transform.position;var/*var*/pos1=this.node0b.transform.position;var/*var*/rot0=this.node0a.transform.rotation;var/*var*/rot1=this.node0b.transform.rotation;var/*var*/ft=/*(float)*/(t-this.t0a)/(this.t0b-this.t0a);this.cameraObject.transform.position=pos0.Add(pos1.Sub(pos0).Mul(ft));this.cameraObject.transform.rotation=Quaternion.Slerp(rot0,rot1,ft);}else if(t>=this.t1a&&t<this.t1b){var/*var*/pos0=this.node1a.transform.position;var/*var*/pos1=this.node1b.transform.position;var/*var*/rot0=this.node1a.transform.rotation;var/*var*/rot1=this.node1b.transform.rotation;var/*var*/ft=/*(float)*/(t-this.t1a)/(this.t1b-this.t1a);this.cameraObject.transform.position=pos0.Add(pos1.Sub(pos0).Mul(ft));this.cameraObject.transform.rotation=Quaternion.Slerp(rot0,rot1,ft);}else if(t>=this.t2a&&t<this.t2b){var/*var*/pos0=this.node2a.transform.position;var/*var*/pos1=this.node2b.transform.position;var/*var*/rot0=this.node2a.transform.rotation;var/*var*/rot1=this.node2b.transform.rotation;var/*var*/ft=/*(float)*/(t-this.t2a)/(this.t2b-this.t2a);this.cameraObject.transform.position=pos0.Add(pos1.Sub(pos0).Mul(ft));this.cameraObject.transform.rotation=Quaternion.Slerp(rot0,rot1,ft);}else if(t>=this.t3a&&t<this.t3b){var/*var*/pos0=this.node3a.transform.position;var/*var*/pos1=this.node3b.transform.position;var/*var*/rot0=this.node3a.transform.rotation;var/*var*/rot1=this.node3b.transform.rotation;var/*var*/ft=/*(float)*/(t-this.t3a)/(this.t3b-this.t3a);this.cameraObject.transform.position=pos0.Add(pos1.Sub(pos0).Mul(ft));this.cameraObject.transform.rotation=Quaternion.Slerp(rot0,rot1,ft);}else if(t>=this.t4a&&t<this.t4b){var/*var*/pos0=this.node4a.transform.position;var/*var*/pos1=this.node4b.transform.position;var/*var*/rot0=this.node4a.transform.rotation;var/*var*/rot1=this.node4b.transform.rotation;var/*var*/ft=/*(float)*/(t-this.t4a)/(this.t4b-this.t4a);this.cameraObject.transform.position=pos0.Add(pos1.Sub(pos0).Mul(ft));this.cameraObject.transform.rotation=Quaternion.Slerp(rot0,rot1,ft);}else if(t>=this.t5a&&t<this.t5b){var/*var*/pos0=this.node5a.transform.position;var/*var*/pos1=this.node5b.transform.position;var/*var*/rot0=this.node5a.transform.rotation;var/*var*/rot1=this.node5b.transform.rotation;var/*var*/ft=/*(float)*/(t-this.t5a)/(this.t5b-this.t5a);this.cameraObject.transform.position=pos0.Add(pos1.Sub(pos0).Mul(ft));this.cameraObject.transform.rotation=Quaternion.Slerp(rot0,rot1,ft);}else if(t>=this.t6a&&t<this.t6b){var/*var*/pos0=this.node6a.transform.position;var/*var*/pos1=this.node6b.transform.position;var/*var*/rot0=this.node6a.transform.rotation;var/*var*/rot1=this.node6b.transform.rotation;var/*var*/ft=/*(float)*/(t-this.t6a)/(this.t6b-this.t6a);this.cameraObject.transform.position=pos0.Add(pos1.Sub(pos0).Mul(ft));this.cameraObject.transform.rotation=Quaternion.Slerp(rot0,rot1,ft);}else if(t>=this.t7a&&t<this.t7b){var/*var*/pos0=this.node7a.transform.position;var/*var*/pos1=this.node7b.transform.position;var/*var*/rot0=this.node7a.transform.rotation;var/*var*/rot1=this.node7b.transform.rotation;var/*var*/ft=/*(float)*/(t-this.t7a)/(this.t7b-this.t7a);this.cameraObject.transform.position=pos0.Add(pos1.Sub(pos0).Mul(ft));this.cameraObject.transform.rotation=Quaternion.Slerp(rot0,rot1,ft);}else{this.cameraObject.transform.position=this.origPos;this.cameraObject.transform.rotation=this.origRot;}};

var SceneTekst1_OnEnable = function() {this.SetTekst(this.Tekst1);};

var SceneTekst1_Update = function() {if(this.tl.PassedT(41600)){this.SetTekst(this.Tekst2);}if(this.tl.PassedT(48500)){this.SetTekst(this.Tekst3);}for(var/*int*/i=0;i<this.times0.Length;i++){if(this.tl.PassedT(this.times0[i]-70)||this.tl.PassedT(this.times0[i]+6950-215)||this.tl.PassedT(this.times0[i]+2*6950-350)){this.RandomizeCamera();}}};

var SceneTekst1_RandomizeCamera = function() {this.cameraObj.transform.position=this.txt.transform.position.Add(new Vector3(Random.Range(-1.0,1.0),Random.Range(-1.0,1.0),-1.0));this.cameraObj.transform.forward=(this.txt.transform.position.Sub(this.cameraObj.transform.position));};

var SceneTekst1_SetTekst = function(txtObj) {this.Tekst1.SetActive(false);this.Tekst2.SetActive(false);this.Tekst3.SetActive(false);txtObj.SetActive(true);this.txt=txtObj;};

var SceneTekst4_OnEnable = function() {this.SetText(0);};

var SceneTekst4_Update = function() {var/*var*/t=this.tl.T()-this.demo.TimeSceneTekst4;for(var/*int*/i=0;i<this.tekstit.Length;i++){if(this.tl.PassedT(this.demo.TimeSceneTekst4+i*this.timeInterval-this.timeInterval/10)){this.textobj.transform.localScale=new Vector3(1,1,1);this.SetText(i);this.RandomizeCamera();}}var/*var*/it=/*(float)*/((this.tl.T()-this.demo.TimeSceneTekst4)%this.timeInterval)/this.timeInterval;var/*var*/s=1.0;if(it<0.1){it/=0.1;s=1.0-(1.0-it)*(1.0-it);}else{it=(it-0.3)/0.5;if(it<0)it=0;if(it>1)it=1;s=1.0-it;s*=s;}this.textobj.transform.localScale=(new Vector3(1,1,1)).Mul(s);};

var SceneTekst4_RandomizeCamera = function() {this.cameraObj.transform.position=this.textobj.transform.position.Add(new Vector3(Random.Range(-1.0,1.0),Random.Range(-1.0,1.0),-1.0));this.cameraObj.transform.forward=(this.textobj.transform.position.Sub(this.cameraObj.transform.position));};

var SceneTekst4_SetText = function(i) {this.text.SetText(this.tekstit[i]);};

var SceneLoppuLogo_Update = function() {this.cameraObj.transform.position=this.cameraObj.transform.position.Add(new Vector3(0,0,1).Mul(-Time.smoothDeltaTime*0.1));};

var DemoTimeline_Start = function() {this.timer=/*(float)*/this.startTime/1000;this.DemoSong.time=/*(float)*/this.startTime/1000;this.prevTime=0;};

var DemoTimeline_Update = function() {this.currTime=this.T();};

var DemoTimeline_Beat = function() {var/*var*/t=this.T();if(t>34650&&t<48100){return 0;}else if(t<157500){var/*var*/it=t%this.interval;var/*var*/ft=/*(float)*/it/this.interval;return ft;}else{return 0;}};

var DemoTimeline_Beat2 = function() {var/*var*/t=this.T();if(t<157500){var/*var*/it=t%(this.interval/4);var/*var*/ft=/*(float)*/it/(this.interval/4);return ft;}else{return 0;}};

var DemoTimeline_LateUpdate = function() {this.prevTime=this.T();};

var DemoTimeline_Time = function() {return this.DemoSong.time;};

var DemoTimeline_T = function() {return Mathf.FloorToInt(this.Time()*1000);};

var DemoTimeline_PassedT = function(t) {return this.prevTime<t&&this.T()>=t;};

var SimuDemo_Update = function() {if(this.tl.PassedT(1)){this.SetScene(this.SceneSimuLogo);}if(this.tl.PassedT(34650)){this.SetScene(this.SceneTekst1);}if(this.tl.PassedT(55250)){this.SetScene(this.SceneEmpty);}if(this.tl.PassedT(this.TimeSceneTekst2)){this.SetScene(this.SceneTekst2);}if(this.tl.PassedT(89000)){this.SetScene(this.SceneTekst3);}if(this.tl.PassedT(114750)){this.SetScene(this.SceneEmpty);}if(this.tl.PassedT(116500)){this.SetScene(this.JoroScene);}if(this.tl.PassedT(this.TimeSceneTekst4)){this.SetScene(this.SceneTekst4);}if(this.tl.PassedT(157500)){this.SetScene(this.SceneFinalSimuLogo);}if(this.tl.PassedT(170000)){this.SetScene(this.SceneEmpty);this.Background.SetActive(false);}};

var SimuDemo_SetScene = function(sceneObj) {this.SceneSimuLogo.SetActive(false);this.SceneEmpty.SetActive(false);this.SceneTekst1.SetActive(false);this.SceneTekst2.SetActive(false);this.SceneTekst3.SetActive(false);this.JoroScene.SetActive(false);this.SceneTekst4.SetActive(false);this.SceneFinalSimuLogo.SetActive(false);sceneObj.SetActive(true);};

