SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void SetHorizontalAxis(float XPosition)
  2.     {
  3.         Direction = (XPosition > Screen.width) ? 1 : -1;
  4.         if (XPosition > (Screen.width * 0.3) && XPosition < (Screen.width * 0.4) || XPosition > (Screen.width * 0.6) && (XPosition < (Screen.width * 0.7)))
  5.         {
  6.             // AREA 1
  7.             Limit = 0.5f;            
  8.         }
  9.         else if (XPosition > (Screen.width * 0.15) && XPosition < (Screen.width * 0.3) || XPosition > (Screen.width * 0.7) && (XPosition < (Screen.width * 0.85)))
  10.         {
  11.             // AREA 2
  12.             Limit = 0.7f;
  13.         }
  14.         else if (XPosition > (Screen.width * 0) && XPosition < (Screen.width * 0.15) || XPosition > (Screen.width * 0.85) && (XPosition <= (Screen.width * 1)))
  15.         {
  16.             // AREA 3
  17.             Limit = 1f;
  18.         }  
  19.  
  20.  
  21.         if (HorizontalAxis > -Limit && HorizontalAxis < Limit)
  22.         {
  23.             HorizontalAxis += 0.01f * Direction;
  24.         }
  25.         else
  26.         {
  27.             // AREA 0
  28.             HorizontalAxis = 0f;
  29.         }
  30.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top