flightsim

来源:互联网 发布:js中的对象是什么 编辑:程序博客网 时间:2024/05/20 10:56
Code (csharp):
  1. // -------------------- Kalkulationen Salto vorwärts abblocken / Calculations Block salto forward -----------------------------------------------------
  2.        
  3.         // Variable divesalto
  4.         //  sturzflug salto vorwärts blocken || dive salto forward blocking
  5.         if (rotationx < 90) divesalto=rotationx/100.0;//Updown
  6.         if (rotationx > 90) divesalto=-0.2;//Updown
  7.        
  8.         //Variable diveblocker
  9.         // Blockt seitlichenTaumelflug beim Sturzflug || blocks sideways stagger flight while dive
  10.         if (rotationx <90) diveblocker=rotationx/200.0;
  11.         else diveblocker=0;
  12.  
  13.         //----------------------------Alles zurückdrehen / everything rotate back ---------------------------------------------------------------------------------
  14.        
  15.         // Zurückrotieren wenn Key in die andere Richtung zeigt | rotateback when key wrong direction
  16.         if ((rotationz <180)(Input.GetAxis ("Horizontal")>0)) transform.Rotate(0,0,rightleftsoft*Time.deltaTime*80);
  17.         if ((rotationz >180)(Input.GetAxis ("Horizontal")<0)) transform.Rotate(0,0,rightleftsoft*Time.deltaTime*80);
  18.  
  19.         //Zurückdrehen Z Achse generell. Limitiert auf Horizontal Button ist nicht gedrückt
  20.         //Rotate back in z axis general, limited by no horizontal button pressed
  21.         if (!Input.GetButton ("Horizontal")){
  22.             if ((rotationz < 135)) transform.Rotate(0,0,rightleftsoftabs*Time.deltaTime*-100);
  23.             if ((rotationz > 225)) transform.Rotate(0,0,rightleftsoftabs*Time.deltaTime*100);
  24.             }
  25.            
  26.         //Zurückdrehen X Achse || Rotate back X axis
  27.         if ((!Input.GetButton ("Vertical"))(groundtrigger.triggered==0)){
  28.             if ((rotationx >0)(rotationx < 180)) transform.Rotate(Time.deltaTime*-50,0,0);
  29.             if ((rotationx >0)(rotationx > 180)) transform.Rotate(Time.deltaTime*50,0,0);
  30.             }
  31.            
0 0
原创粉丝点击