예제 #1
0
 public static Vector3 DirectionToVector3(HamsterDirection dir)
 {
     return(new Dictionary <HamsterDirection, Vector3> {
         { HamsterDirection.Up, new Vector3(0, 1, 0).normalized },
         { HamsterDirection.Down, new Vector3(0, -1, 0).normalized },
         { HamsterDirection.Left, new Vector3(-1, 0, 0).normalized },
         { HamsterDirection.LeftUp, new Vector3(-1, 1, 0).normalized },
         { HamsterDirection.LeftDown, new Vector3(-1, -1, 0).normalized },
         { HamsterDirection.Right, new Vector3(1, 0, 0).normalized },
         { HamsterDirection.RightUp, new Vector3(1, 1, 0).normalized },
         { HamsterDirection.RightDown, new Vector3(1, -1, 0).normalized },
     }[dir]);
 }
예제 #2
0
 public static string DirectionToAnimation(HamsterDirection dir)
 {
     return(new Dictionary <HamsterDirection, string> {
         { HamsterDirection.Up, Move.Up },
         { HamsterDirection.Down, Move.Down },
         { HamsterDirection.Left, Move.Left },
         { HamsterDirection.LeftUp, Move.LeftUp },
         { HamsterDirection.LeftDown, Move.LeftDown },
         { HamsterDirection.Right, Move.Right },
         { HamsterDirection.RightUp, Move.RightUp },
         { HamsterDirection.RightDown, Move.RightDown },
     }[dir]);
 }