示例#1
0
 // Token: 0x060008BB RID: 2235 RVA: 0x000381F8 File Offset: 0x000365F8
 public static TouchStick.StickDir GetDirCodeFromAngle(float ang, bool as8way)
 {
     ang += ((!as8way) ? 45f : 22.5f);
     ang  = TouchStick.NormalizeAnglePositive(ang);
     if (as8way)
     {
         if (ang < 45f)
         {
             return(TouchStick.StickDir.U);
         }
         if (ang < 90f)
         {
             return(TouchStick.StickDir.UR);
         }
         if (ang < 135f)
         {
             return(TouchStick.StickDir.R);
         }
         if (ang < 180f)
         {
             return(TouchStick.StickDir.DR);
         }
         if (ang < 225f)
         {
             return(TouchStick.StickDir.D);
         }
         if (ang < 270f)
         {
             return(TouchStick.StickDir.DL);
         }
         if (ang < 315f)
         {
             return(TouchStick.StickDir.L);
         }
         return(TouchStick.StickDir.UL);
     }
     else
     {
         if (ang < 90f)
         {
             return(TouchStick.StickDir.U);
         }
         if (ang < 180f)
         {
             return(TouchStick.StickDir.R);
         }
         if (ang < 270f)
         {
             return(TouchStick.StickDir.D);
         }
         return(TouchStick.StickDir.L);
     }
 }