u s i n g   U n i t y E n g i n e ; 
 u s i n g   S y s t e m ; 
 u s i n g   S y s t e m . C o l l e c t i o n s ; 
 u s i n g   S y s t e m . C o l l e c t i o n s . G e n e r i c ; 
 u s i n g   S y s t e m . I O ; 
 u s i n g   l i v e 2 d . f r a m e w o r k ; 
 u s i n g   l i v e 2 d ; 
 
 / / # p r a g m a   w a r n i n g   d i s a b l e   0 6 1 2 
 n a m e s p a c e   U t a g e 
 { 
 	 / / /   < s u m m a r y > 
 	 / / /   [(un0L i v e 2 D 000n0000000
 	 / / /   < / s u m m a r y > 
 	 p u b l i c   c l a s s   L i v e 2 D M o d e l D a t a 
 	 { 
 	 	 / / 00000`1X
 	 	 p u b l i c   c l a s s   M o t i o n I n f o 
 	 	 { 
 	 	 	 p u b l i c   s t r i n g   N a m e {   g e t ;   p r i v a t e   s e t ;   } 	 	 	 	 / / 
TMR
 	 	 	 p u b l i c   s t r i n g   G r o u p N a m e   {   g e t ;   p r i v a t e   s e t ;   } 	 	 / / 
TMR
 	 	 	 p u b l i c   L i v e 2 D M o t i o n   N o F a d e M o t i o n   {   g e t ;   p r i v a t e   s e t ;   } 	 / / 0000Bfj0W0n000000
 	 	 	 p u b l i c   L i v e 2 D M o t i o n   M o t i o n   {   g e t ;   p r i v a t e   s e t ;   } 	 / / 00000
 	 	 	 p u b l i c   A s s e t F i l e   V o i c e F i l e   {   g e t ;   p r i v a t e   s e t ;   } 	 / / 0000000
 	 	 	 p u b l i c   b o o l   I s I d l e T y p e   {   g e t ;   s e t ;   } 	 	 	 	 / / I d l e 000n000000K0
 
 	 	 	 p u b l i c   M o t i o n I n f o ( s t r i n g   n a m e ,   s t r i n g   g r o u p N a m e ,   L i v e 2 D M o t i o n   m o t i o n ,   L i v e 2 D M o t i o n   n o F a d e M o t i o n ,   A s s e t F i l e   v o i c e F i l e ,   b o o l   i s I d l e T y p e ) 
 	 	 	 { 
 	 	 	 	 N a m e   =   n a m e ; 
 	 	 	 	 G r o u p N a m e   =   g r o u p N a m e ; 
 	 	 	 	 M o t i o n   =   m o t i o n ; 
 	 	 	 	 N o F a d e M o t i o n   =   n o F a d e M o t i o n ; 
 	 	 	 	 V o i c e F i l e   =   v o i c e F i l e ; 
 	 	 	 	 I s I d l e T y p e   =   i s I d l e T y p e ; 
 	 	 	 } 
 	 	 } ; 
 
 	 	 / / 000000000
 	 	 p u b l i c   c l a s s   M o t i o n G r o u p 
 	 	 { 
 	 	 	 p u b l i c   D i c t i o n a r y < s t r i n g ,   M o t i o n I n f o >   m o t i o n s   =   n e w   D i c t i o n a r y < s t r i n g , M o t i o n I n f o > ( ) ; 
 	 	 } ; 
 
 	 	 p u b l i c   f l o a t   W i d t h   {   g e t ;   p r i v a t e   s e t ;   } 
 	 	 p u b l i c   f l o a t   H e i g h t   {   g e t ;   p r i v a t e   s e t ;   } 
 
 	 	 p u b l i c   s t r i n g   M o t i o n G r o u p N a m e I d l e   {   g e t ;   s e t ;   } 
 	 	 p u b l i c   L i v e 2 D M o d e l U n i t y   L i v e 2 D M o d e l   {   g e t ;   p r i v a t e   s e t ;   } 
 
 	 	 p u b l i c   D i c t i o n a r y < s t r i n g ,   M o t i o n G r o u p >   M o t i o n G r o u p s   {   g e t ;   p r i v a t e   s e t ;   } 
 	 	 p u b l i c   M o t i o n Q u e u e M a n a g e r   M a i n M o t i o n M a n a g e r   {   g e t ;   p r i v a t e   s e t ;   }               / /   00000{t000
 
 	 	 p u b l i c   D i c t i o n a r y < s t r i n g ,   L 2 D E x p r e s s i o n M o t i o n >   E x p r e s s i o n s   {   g e t ;   p r i v a t e   s e t ;   } 	 / / h`000
 	 	 p u b l i c   M o t i o n Q u e u e M a n a g e r   E x p r e s s i o n M a n a g e r   {   g e t ;   p r i v a t e   s e t ;   }               / /   h`00000{t000
 
 	 	 p u b l i c   s t r i n g   C u r r e n t E x p r e s s i o n N a m e   {   g e t ;   p r i v a t e   s e t ;   } 
 
 	 	 / / S__00$R[n0
TMRh0I D 
 	 	 D i c t i o n a r y < s t r i n g ,   s t r i n g >   h i t A r e a I d s   =   n e w   D i c t i o n a r y < s t r i n g ,   s t r i n g > ( ) ; 
 
 	 	 p u b l i c   L i v e 2 D P o s e   P o s e   {   g e t ;   p r i v a t e   s e t ;   } 	 	 	 	 	 / / 000R0fH0000
 	 	 p u b l i c   L 2 D P h y s i c s   P h y s i c s   {   g e t ;   p r i v a t e   s e t ;   } 	 	 	 	 / / irto{000
 
 	 	 p u b l i c   M a t r i x 4 x 4   M o d e l M a t r i x   {   g e t ;   p r i v a t e   s e t ;   } 
 	 	 p u b l i c   f l o a t   P i x e l s T o U n i t s   {   g e t ;   p r i v a t e   s e t ;   } 	 	 	 	 / / h:yY00h0M0n000000^j1 XSMOB0_00n00000pe
 
 	 	 p u b l i c   A c t i o n < A s s e t F i l e >   C a l l b a c k P l a y S o u n d ; 
 
 	 	 / / 00000n0-[
 	 	 p u b l i c   c l a s s   M o t i o n S e t t i n g 
 	 	 { 
 	 	 	 p u b l i c   M o t i o n I n f o   M o t i o n   {   g e t ;   p r i v a t e   s e t ;   } 
 	 	 	 p u b l i c   M o t i o n P l a y T y p e   P l a y T y p e   {   g e t ;   s e t ;   } 
 
 	 	 	 p u b l i c   M o t i o n S e t t i n g ( M o t i o n I n f o   m o t i o n ,   M o t i o n P l a y T y p e   p l a y T y p e ) 
 	 	 	 { 
 	 	 	 	 t h i s . M o t i o n   =   m o t i o n ; 
 	 	 	 	 t h i s . P l a y T y p e   =   p l a y T y p e ; 
 	 	 	 } 
 
 	 	 	 p u b l i c   b o o l   I s E n d   {   g e t ;   s e t ;   } 
 
 	 	 } ; 
 	 	 p u b l i c   M o t i o n S e t t i n g   C u r r e n t M o t i o n S e t t i n g   {   g e t ;   p r i v a t e   s e t ;   } 
 
 	 	 p u b l i c   b o o l   I s C u r r e n t M o t i o n I d l e   { 
 	 	 	 g e t 
 	 	 	 { 
 	 	 	 	 r e t u r n   ( C u r r e n t M o t i o n S e t t i n g   ! =   n u l l   & &   C u r r e n t M o t i o n S e t t i n g . M o t i o n . I s I d l e T y p e )   ; 
 	 	 	 } 
 	 	 } 
 
 	 	 L i v e 2 D S e t t i n g s   S e t t i n g s   {   g e t   {   r e t u r n   L i v e 2 D F o r U t a g e . G e t I n s t a n c e ( ) . S e t t i n g s ;   }   } 
 
 	 	 / /  gRn0 NVvn0c;uo00000W0j0D0g0D0M0j00h:yY00_00k0
 	 	 i n t e r n a l   b o o l   I s I n i t   {   g e t ;   s e t ;   } 
 
 
 	 	 i n t e r n a l   L i v e 2 D M o d e l D a t a ( G r a p h i c I n f o L i s t   g r a p h i c ,   i n t   l a y e r ,   f l o a t   p i x e l s T o U n i t s ) 
 	 	 { 
 	 	 	 M o t i o n G r o u p s   =   n e w   D i c t i o n a r y < s t r i n g ,   M o t i o n G r o u p > ( ) ; 
 	 	 	 M a i n M o t i o n M a n a g e r   =   n e w   M o t i o n Q u e u e M a n a g e r ( ) ; 
 	 	 	 E x p r e s s i o n s   =   n e w   D i c t i o n a r y < s t r i n g ,   L 2 D E x p r e s s i o n M o t i o n > ( ) ; 
 	 	 	 E x p r e s s i o n M a n a g e r   =   n e w   M o t i o n Q u e u e M a n a g e r ( ) ; 
 
 	 	 	 M o t i o n G r o u p N a m e I d l e   =   " i d l e " ; 
 	 	 	 P i x e l s T o U n i t s   =   p i x e l s T o U n i t s ; 
 	 	 	 L o a d G r a p h i c ( g r a p h i c ) ; 
 	 	 	 L i v e 2 D M o d e l . s e t L a y e r ( l a y e r ) ; 
 	 	 	 I n i t M a t r i x ( ) ; 
 	 	 	 / / 00000000
 	 	 	 H e i g h t   =   L i v e 2 D M o d e l . g e t C a n v a s H e i g h t ( )   /   P i x e l s T o U n i t s ; 
 	 	 	 W i d t h   =   L i v e 2 D M o d e l . g e t C a n v a s W i d t h ( )   /   P i x e l s T o U n i t s ; 
 	 	 } 
 
 	 	 v o i d   L o a d G r a p h i c (   G r a p h i c I n f o L i s t   g r a p h i c ) 
 	 	 { 
 	 	 	 i f   ( g r a p h i c . M a i n . F i l e . S u b F i l e s . C o u n t   >   0 ) 
 	 	 	 { 
 	 	 	 	 L o a d M o d e l J s o n ( g r a p h i c . M a i n . F i l e ) ; 
 	 	 	 } 
 	 	 	 e l s e 
 	 	 	 { 
 	 	 	 	 D e b u g . L o g E r r o r ( " N o t F o u n d   L i v e 2 D   F i l e s " ) ; 
 / / 	 	 	 	 L o a d S c r a t c h ( g r a p h i c ) ; 
 	 	 	 } 
 	 	 } 
 
 	 	 / / /   < s u m m a r y > 
 	 	 / / /   m o d e l . j s o n n0000v_k00_j00000k0Rg0000Qt0K0Q00
 	 	 / / /   < / s u m m a r y > 
 	 	 p u b l i c   s t a t i c   v o i d   A d d S u b F i l e s ( 	 L i v e 2 D S e t t i n g s   s e t t i n g s ,   A s s e t F i l e   f i l e ) 
 	 	 { 
 	 	 	 t r y 
 	 	 	 { 
 	 	 	 	 V a l u e   j s o n   =   J s o n . p a r s e F r o m S t r i n g ( f i l e . T e x t ) ; 
 
 	 	 	 	 s t r i n g   r o o t D i r   =   F i l e P a t h U t i l . G e t D i r e c t o r y P a t h ( f i l e . F i l e N a m e ) ; 
 
 	 	 	 	 c o n s t   s t r i n g   a d d E x t   =   " . b y t e s " ; 
 	 	 	 	 / /   000000
 	 	 	 	 A d d S u b F i l e ( f i l e ,   r o o t D i r ,   j s o n . g e t ( " m o d e l " ) . t o S t r i n g ( )   +   a d d E x t ) ; 
 
 	 	 	 	 / /   00000000
 	 	 	 	 i n t   t e x t u r e _ n u m   =   j s o n . g e t ( " t e x t u r e s " ) . g e t V e c t o r ( n u l l ) . C o u n t ; 
 	 	 	 	 f o r   ( i n t   i   =   0 ;   i   <   t e x t u r e _ n u m ;   i + + ) 
 	 	 	 	 { 
 	 	 	 	 	 A d d S u b F i l e ( f i l e ,   r o o t D i r ,   j s o n . g e t ( " t e x t u r e s " ) . g e t ( i ) . t o S t r i n g ( ) ) ; 
 	 	 	 	 } 
 
 	 	 	 	 / /   00000n0MNn0000S_
 	 	 	 	 i f   ( j s o n . g e t M a p ( n u l l ) . C o n t a i n s K e y ( " m o t i o n s " ) ) 
 	 	 	 	 { 
 	 	 	 	 	 D i c t i o n a r y < s t r i n g ,   V a l u e >   m o t i o n _ k e y s   =   j s o n . g e t ( " m o t i o n s " ) . g e t M a p ( n u l l ) ; 
 	 	 	 	 	 / /   000000000peRJ S O N 
 	 	 	 	 	 f o r e a c h   ( v a r   m t n k e y   i n   m o t i o n _ k e y s ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 s t r i n g   g r o u p N a m e   =   m t n k e y . K e y . T o S t r i n g ( ) ; 
 	 	 	 	 	 	 / /   00000h00000000( m o t i o n s MNn000000) 
 	 	 	 	 	 	 V a l u e   m o t i o n P a t h s   =   j s o n . g e t ( " m o t i o n s " ) . g e t ( g r o u p N a m e ) ; 
 	 	 	 	 	 	 i n t   m o t i o n N u m   =   m o t i o n P a t h s . g e t V e c t o r ( n u l l ) . C o u n t ; 
 
 	 	 	 	 	 	 f o r   ( i n t   m   =   0 ;   m   <   m o t i o n N u m ;   m + + ) 
 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 V a l u e   d a t a   =   m o t i o n P a t h s . g e t ( m ) ; 
 	 	 	 	 	 	 	 s t r i n g   n a m e   =   d a t a . g e t ( " f i l e " ) . t o S t r i n g ( ) ; 
 	 	 	 	 	 	 	 A d d S u b F i l e ( f i l e ,   r o o t D i r ,   n a m e   +   a d d E x t ) ; 
 	 	 	 	 	 	 	 / /   00000000L0B00p0eQ00
 	 	 	 	 	 	 	 i f   ( d a t a . g e t M a p ( n u l l ) . C o n t a i n s K e y ( " s o u n d " ) ) 
 	 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 	 i f   ( s e t t i n g s . S o u n d T y p e   ! =   L i v e 2 D S e t t i n g s . S o u n d . I g n o r e ) 
 	 	 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 	 	 A d d S u b F i l e ( f i l e ,   r o o t D i r ,   d a t a . g e t ( " s o u n d " ) . t o S t r i n g ( ) ) ; 
 	 	 	 	 	 	 	 	 } 
 	 	 	 	 	 	 	 } 
 	 	 	 	 	 	 } 
 	 	 	 	 	 } 
 	 	 	 	 } 
 
 	 	 	 	 / /   0000000000
 	 	 	 	 i f   ( j s o n . g e t M a p ( n u l l ) . C o n t a i n s K e y ( " p o s e " ) ) 
 	 	 	 	 { 
 	 	 	 	 	 A d d S u b F i l e ( f i l e ,   r o o t D i r ,   j s o n . g e t ( " p o s e " ) . t o S t r i n g ( ) ) ; 
 	 	 	 	 } 
 
 	 	 	 	 / /   irto{0000000
 	 	 	 	 i f   ( j s o n . g e t M a p ( n u l l ) . C o n t a i n s K e y ( " p h y s i c s " ) ) 
 	 	 	 	 { 
 	 	 	 	 	 A d d S u b F i l e ( f i l e ,   r o o t D i r ,   j s o n . g e t ( " p h y s i c s " ) . t o S t r i n g ( ) ) ; 
 	 	 	 	 } 
 
 	 	 	 	 / / h`000
 	 	 	 	 i f   ( j s o n . g e t M a p ( n u l l ) . C o n t a i n s K e y ( " e x p r e s s i o n s " ) ) 
 	 	 	 	 { 
 	 	 	 	 	 V a l u e   v a l   =   j s o n . g e t ( " e x p r e s s i o n s " ) ; 
 	 	 	 	 	 i n t   n u m   =   v a l . g e t V e c t o r ( n u l l ) . C o u n t ; 
 	 	 	 	 	 f o r   ( i n t   i   =   0 ;   i   <   n u m ;   i + + ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 V a l u e   d a t a   =   v a l . g e t ( i ) ; 
 	 	 	 	 	 	 A d d S u b F i l e ( f i l e ,   r o o t D i r ,   d a t a . g e t ( " f i l e " ) . t o S t r i n g ( ) ) ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 	 	 	 } 
 	 	 	 c a t c h (   E x c e p t i o n   e   ) 
 	 	 	 { 
 	 	 	 	 D e b u g . L o g E r r o r (   " L o a d   e r r o r   : "   + f i l e . F i l e N a m e   +   "     "   +   e . M e s s a g e   ) ; 
 	 	 	 } 
 	 	 } 
 
 	 	 s t a t i c   v o i d   A d d S u b F i l e ( A s s e t F i l e   f i l e ,   s t r i n g   r o o t D i r ,   s t r i n g   p a t h ) 
 	 	 { 
 	 	 	 f i l e . L o a d A n d A d d S u b F i l e ( F i l e P a t h U t i l . C o m b i n e ( r o o t D i r ,   p a t h ) ) ; 
 	 	 } 
 
 	 	 / / /   < s u m m a r y > 
 	 	 / / /   m o d e l . j s o n 000
 	 	 / / /   < / s u m m a r y > 
 	 	 v o i d   L o a d M o d e l J s o n ( A s s e t F i l e   f i l e ) 
 	 	 { 
 	 	 	 t r y 
 	 	 	 { 
 	 	 	 	 V a l u e   j s o n   =   J s o n . p a r s e F r o m S t r i n g ( f i l e . T e x t ) ; 
 
 	 	 	 	 s t r i n g   r o o t D i r   =   F i l e P a t h U t i l . G e t D i r e c t o r y P a t h ( f i l e . F i l e N a m e ) ; 
 
 	 	 	 	 c o n s t   s t r i n g   a d d E x t   =   " . b y t e s " ; 
 	 	 	 	 / /   000000
 	 	 	 	 L o a d M o d e l ( R e a d S u b F i l e ( f i l e ,   r o o t D i r ,   j s o n . g e t ( " m o d e l " ) . t o S t r i n g ( )   +   a d d E x t ) . B y t e s ) ; 
 
 	 	 	 	 / /   00000000
 	 	 	 	 i n t   t e x t u r e _ n u m   =   j s o n . g e t ( " t e x t u r e s " ) . g e t V e c t o r ( n u l l ) . C o u n t ; 
 	 	 	 	 f o r   ( i n t   i   =   0 ;   i   <   t e x t u r e _ n u m ;   i + + ) 
 	 	 	 	 { 
 	 	 	 	 	 L i v e 2 D M o d e l . s e t T e x t u r e ( i ,   R e a d S u b F i l e ( f i l e ,   r o o t D i r ,   j s o n . g e t ( " t e x t u r e s " ) . g e t ( i ) . t o S t r i n g ( ) ) . T e x t u r e ) ; 
 	 	 	 	 } 
 
 	 	 	 	 / /   00000n0MNn0000S_
 	 	 	 	 i f   ( j s o n . g e t M a p ( n u l l ) . C o n t a i n s K e y ( " m o t i o n s " ) ) 
 	 	 	 	 { 
 	 	 	 	 	 D i c t i o n a r y < s t r i n g ,   V a l u e >   m o t i o n _ k e y s   =   j s o n . g e t ( " m o t i o n s " ) . g e t M a p ( n u l l ) ; 
 	 	 	 	 	 / /   000000000peRJ S O N 
 	 	 	 	 	 f o r e a c h   ( v a r   m t n k e y   i n   m o t i o n _ k e y s ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 s t r i n g   g r o u p N a m e   =   m t n k e y . K e y . T o S t r i n g ( ) ; 
 	 	 	 	 	 	 M o t i o n G r o u p   g r o u p   =   n e w   M o t i o n G r o u p ( ) ; 
 	 	 	 	 	 	 / /   00000h00000000( m o t i o n s MNn000000) 
 	 	 	 	 	 	 V a l u e   m o t i o n P a t h s   =   j s o n . g e t ( " m o t i o n s " ) . g e t ( g r o u p N a m e ) ; 
 	 	 	 	 	 	 i n t   m o t i o n N u m   =   m o t i o n P a t h s . g e t V e c t o r ( n u l l ) . C o u n t ; 
 
 	 	 	 	 	 	 f o r   ( i n t   m   =   0 ;   m   <   m o t i o n N u m ;   m + + ) 
 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 V a l u e   d a t a   =   m o t i o n P a t h s . g e t ( m ) ; 
 	 	 	 	 	 	 	 s t r i n g   n a m e   =   d a t a . g e t ( " f i l e " ) . t o S t r i n g ( ) ; 
 	 	 	 	 	 	 	 t r y 
 	 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 	 b y t e [ ]   b y t e s   =   R e a d S u b F i l e ( f i l e ,   r o o t D i r ,   n a m e   +   a d d E x t ) . B y t e s ; 
 	 	 	 	 	 	 	 	 L i v e 2 D M o t i o n   m o t i o n   =   L i v e 2 D M o t i o n . l o a d M o t i o n ( b y t e s ) ; 
 	 	 	 	 	 	 	 	 L i v e 2 D M o t i o n   n o F a d e M o t i o n   =   L i v e 2 D M o t i o n . l o a d M o t i o n ( b y t e s ) ; 
 	 	 	 	 	 	 	 	 A s s e t F i l e   v o i c e F i l e   =   n u l l ; 
 	 	 	 	 	 	 	 	 / /   00000000L0B00p0eQ00
 	 	 	 	 	 	 	 	 i f   ( S e t t i n g s . S o u n d T y p e   ! =   L i v e 2 D S e t t i n g s . S o u n d . I g n o r e ) 
 	 	 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 	 	 i f   ( d a t a . g e t M a p ( n u l l ) . C o n t a i n s K e y ( " s o u n d " ) ) 
 	 	 	 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 	 	 	 v o i c e F i l e   =   R e a d S u b F i l e ( f i l e ,   r o o t D i r ,   d a t a . g e t ( " s o u n d " ) . t o S t r i n g ( ) ) ; 
 	 	 	 	 	 	 	 	 	 } 
 	 	 	 	 	 	 	 	 } 
 	 	 	 	 	 	 	 	 / / 000000
 	 	 	 	 	 	 	 	 i f   ( d a t a . g e t M a p ( n u l l ) . C o n t a i n s K e y ( " f a d e _ i n " ) ) 
 	 	 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 	 	 m o t i o n . s e t F a d e I n ( i n t . P a r s e ( d a t a . g e t ( " f a d e _ i n " ) . t o S t r i n g ( ) ) ) ; 
 	 	 	 	 	 	 	 	 } 
 / / 	 	 	 	 	 	 	 	 n o F a d e M o t i o n . s e t F a d e I n ( 1 ) ; 
 	 	 	 	 	 	 	 	 / / 0000000
 	 	 	 	 	 	 	 	 i f   ( d a t a . g e t M a p ( n u l l ) . C o n t a i n s K e y ( " f a d e _ o u t " ) ) 
 	 	 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 	 	 m o t i o n . s e t F a d e O u t ( i n t . P a r s e ( d a t a . g e t ( " f a d e _ o u t " ) . t o S t r i n g ( ) ) ) ; 
 	 	 	 	 	 	 	 	 } 
 / / 	 	 	 	 	 	 	 	 n o F a d e M o t i o n . s e t F a d e O u t ( 1 ) ; 
 	 	 	 	 	 	 	 	 / / 00000`1X0{v2
 	 	 	 	 	 	 	 	 A d d M o t i o n T o G r o u p ( g r o u p N a m e ,   g r o u p ,   n a m e ,   m o t i o n ,   n o F a d e M o t i o n ,   v o i c e F i l e ) ; 
 	 	 	 	 	 	 	 } 
 	 	 	 	 	 	 	 c a t c h   (   E x c e p t i o n   e ) 
 	 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 	 D e b u g . L o g E r r o r ( " L o a d   e r r o r   : "   +   f i l e . F i l e N a m e   +   "     "   +   n a m e   +   "     "   +   e . M e s s a g e ) ; 
 	 	 	 	 	 	 	 } 
 	 	 	 	 	 	 } 
 	 	 	 	 	 	 M o t i o n G r o u p s . A d d ( g r o u p N a m e ,   g r o u p ) ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 
 	 	 	 	 / /   0000000000
 	 	 	 	 i f   ( j s o n . g e t M a p ( n u l l ) . C o n t a i n s K e y ( " p o s e " ) ) 
 	 	 	 	 { 
 	 	 	 	 	 P o s e   =   L i v e 2 D P o s e . L o a d C u s t o m ( R e a d S u b F i l e ( f i l e ,   r o o t D i r ,   j s o n . g e t ( " p o s e " ) . t o S t r i n g ( ) ) . T e x t ) ; 
 	 	 	 	 } 
 
 	 	 	 	 / /   irto{0000000
 	 	 	 	 i f   ( j s o n . g e t M a p ( n u l l ) . C o n t a i n s K e y ( " p h y s i c s " ) ) 
 	 	 	 	 { 
 	 	 	 	 	 P h y s i c s   =   L 2 D P h y s i c s . l o a d ( R e a d S u b F i l e ( f i l e ,   r o o t D i r ,   j s o n . g e t ( " p h y s i c s " ) . t o S t r i n g ( ) ) . T e x t ) ; 
 	 	 	 	 } 
 
 	 	 	 	 / / 000000000
 	 	 	 	 i f   ( j s o n . g e t M a p ( n u l l ) . C o n t a i n s K e y ( " h i t _ a r e a s " ) ) 
 	 	 	 	 { 
 	 	 	 	 	 V a l u e   v a l   =   j s o n . g e t ( " h i t _ a r e a s " ) ; 
 	 	 	 	 	 i n t   n u m   =   v a l . g e t V e c t o r ( n u l l ) . C o u n t ; 
 	 	 	 	 	 f o r   ( i n t   i   =   0 ;   i   <   n u m ;   i + + ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 V a l u e   d a t a   =   v a l . g e t ( i ) ; 
 	 	 	 	 	 	 h i t A r e a I d s . A d d ( d a t a . g e t ( " n a m e " ) . t o S t r i n g ( ) ,   d a t a . g e t ( " i d " ) . t o S t r i n g ( ) ) ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 
 	 	 	 	 / / h`000
 	 	 	 	 i f   ( j s o n . g e t M a p ( n u l l ) . C o n t a i n s K e y ( " e x p r e s s i o n s " ) ) 
 	 	 	 	 { 
 	 	 	 	 	 V a l u e   v a l   =   j s o n . g e t ( " e x p r e s s i o n s " ) ; 
 	 	 	 	 	 i n t   n u m   =   v a l . g e t V e c t o r ( n u l l ) . C o u n t ; 
 	 	 	 	 	 f o r   ( i n t   i   =   0 ;   i   <   n u m ;   i + + ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 V a l u e   d a t a   =   v a l . g e t ( i ) ; 
 	 	 	 	 	 	 t r y 
 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 L 2 D E x p r e s s i o n M o t i o n   e x p r e s s i o n   =   L 2 D E x p r e s s i o n M o t i o n . l o a d J s o n ( R e a d S u b F i l e ( f i l e ,   r o o t D i r ,   d a t a . g e t ( " f i l e " ) . t o S t r i n g ( ) ) . T e x t ) ; 
 	 	 	 	 	 	 	 E x p r e s s i o n s . A d d ( d a t a . g e t ( " n a m e " ) . t o S t r i n g ( ) ,   e x p r e s s i o n ) ; 
 	 	 	 	 	 	 } 
 	 	 	 	 	 	 c a t c h   ( E x c e p t i o n   e ) 
 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 D e b u g . L o g E r r o r ( " L o a d   e r r o r   : "   +   F i l e P a t h U t i l . C o m b i n e ( r o o t D i r ,   d a t a . g e t ( " f i l e " ) . t o S t r i n g ( ) )   +   "     "   +   e . M e s s a g e ) ; 
 	 	 	 	 	 	 } 
 	 	 	 	 	 } 
 	 	 	 	 } 
 
 	 	 	 	 / / 00000000
 	 	 	 	 i f   ( j s o n . g e t M a p ( n u l l ) . C o n t a i n s K e y ( " l a y o u t " ) ) 
 	 	 	 	 { 
 	 	 	 	 	 V a l u e   v a l   =   j s o n . g e t ( " l a y o u t " ) ; 
 	 	 	 	 	 f o r e a c h   ( s t r i n g   k e y   i n   v a l . k e y S e t ( ) ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 s w i t c h   ( k e y ) 
 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 c a s e   " w i t d h " : 
 	 	 	 	 	 	 	 	 v a l . g e t ( k e y ) . t o F l o a t ( ) ; 
 	 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 	 c a s e   " h e i g h t " : 
 	 	 	 	 	 	 	 	 v a l . g e t ( k e y ) . t o F l o a t ( ) ; 
 	 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 	 c a s e   " x " : 
 	 	 	 	 	 	 	 	 v a l . g e t ( k e y ) . t o F l o a t ( ) ; 
 	 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 	 c a s e   " y " : 
 	 	 	 	 	 	 	 	 v a l . g e t ( k e y ) . t o F l o a t ( ) ; 
 	 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 	 c a s e   " c e n t e r _ x " : 
 	 	 	 	 	 	 	 	 v a l . g e t ( k e y ) . t o F l o a t ( ) ; 
 	 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 	 c a s e   " c e n t e r _ y " : 
 	 	 	 	 	 	 	 	 v a l . g e t ( k e y ) . t o F l o a t ( ) ; 
 	 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 	 c a s e   " t o p " : 
 	 	 	 	 	 	 	 	 v a l . g e t ( k e y ) . t o F l o a t ( ) ; 
 	 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 	 c a s e   " b o t t o m " : 
 	 	 	 	 	 	 	 	 v a l . g e t ( k e y ) . t o F l o a t ( ) ; 
 	 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 	 c a s e   " l e f t " : 
 	 	 	 	 	 	 	 	 v a l . g e t ( k e y ) . t o F l o a t ( ) ; 
 	 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 	 c a s e   " r i g h t " : 
 	 	 	 	 	 	 	 	 v a l . g e t ( k e y ) . t o F l o a t ( ) ; 
 	 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 } 
 	 	 	 	 	 } 
 	 	 	 	 } 
 
 	 	 	 	 / /   Rg00000k0d0D0f0
 	 	 	 	 i f   ( j s o n . g e t M a p ( n u l l ) . C o n t a i n s K e y ( " i n i t _ p a r a m " ) ) 
 	 	 	 	 { 
 	 	 	 	 	 V a l u e   v a l   =   j s o n . g e t ( " i n i t _ p a r a m " ) ; 
 	 	 	 	 	 i n t   n u m   =   v a l . g e t V e c t o r ( n u l l ) . C o u n t ; 
 	 	 	 	 	 f o r   ( i n t   i   =   0 ;   i   <   n u m ;   i + + ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 V a l u e   d a t a   =   v a l . g e t ( i ) ; 
 	 	 	 	 	 	 s t r i n g   i d   =   d a t a . g e t ( " i d " ) . t o S t r i n g ( ) ; 
 	 	 	 	 	 	 f l o a t   v a l u e   =   d a t a . g e t ( " v a l u e " ) . t o F l o a t ( ) ; 
 	 	 	 	 	 	 L i v e 2 D M o d e l . s e t P a r a m F l o a t ( i d ,   v a l u e ) ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 
 	 	 	 	 / /   Rg000h:yk0d0D0f0
 	 	 	 	 i f   ( j s o n . g e t M a p ( n u l l ) . C o n t a i n s K e y ( " i n i t _ p a r t s _ v i s i b l e " ) ) 
 	 	 	 	 { 
 	 	 	 	 	 V a l u e   v a l   =   j s o n . g e t ( " i n i t _ p a r t s _ v i s i b l e " ) ; 
 	 	 	 	 	 i n t   n u m   =   v a l . g e t V e c t o r ( n u l l ) . C o u n t ; 
 	 	 	 	 	 f o r   ( i n t   i   =   0 ;   i   <   n u m ;   i + + ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 V a l u e   d a t a   =   v a l . g e t ( i ) ; 
 	 	 	 	 	 	 s t r i n g   i d   =   d a t a . g e t ( " i d " ) . t o S t r i n g ( ) ; 
 	 	 	 	 	 	 f l o a t   v a l u e   =   d a t a . g e t ( " v a l u e " ) . t o F l o a t ( ) ; 
 	 	 	 	 	 	 L i v e 2 D M o d e l . s e t P a r t s O p a c i t y ( i d ,   v a l u e ) ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 	 	 	 } 
 	 	 	 c a t c h   ( E x c e p t i o n   e ) 
 	 	 	 { 
 	 	 	 	 D e b u g . L o g E r r o r ( " L o a d   e r r o r   : "   +   f i l e . F i l e N a m e   +   "     "   +   e . M e s s a g e ) ; 
 	 	 	 } 
 	 	 } 
 
 
 	 	 A s s e t F i l e   R e a d S u b F i l e (   A s s e t F i l e   f i l e ,   s t r i n g   r o o t D i r ,   s t r i n g   f i l e P a t h ) 
 	 	 { 
 	 	 	 s t r i n g   f u l l P a t h   =   F i l e P a t h U t i l . C o m b i n e ( r o o t D i r ,   f i l e P a t h ) ; 
 	 	 	 r e t u r n   f i l e . S u b F i l e s [ f u l l P a t h ] ; 
 	 	 } 
 
 	 	 v o i d   L o a d M o d e l ( b y t e [ ]   b y t e s ) 
 	 	 { 
 	 	 	 L i v e 2 D M o d e l   =   L i v e 2 D M o d e l U n i t y . l o a d M o d e l ( b y t e s ) ; 
 	 	 	 / / S0n000000g0000000000L 2 D _ R E N D E R _ D R A W _ M E S H k0-[
 	 	 	 L i v e 2 D M o d e l . s e t R e n d e r M o d e ( L i v e 2 D . L 2 D _ R E N D E R _ D R A W _ M E S H ) ; 
 	 	 } 
 
 	 	 v o i d   A d d M o t i o n T o G r o u p ( s t r i n g   g r o u p N a m e ,   M o t i o n G r o u p   m o t i o n G r o u p ,   s t r i n g   f i l e N a m e ,   L i v e 2 D M o t i o n   m o t i o n ,   L i v e 2 D M o t i o n   n o F a d e M o t i o n ,   A s s e t F i l e   v o i c e F i l e ) 
 	 	 { 
 	 	 	 b o o l   i s I d l e   =   ( g r o u p N a m e   = =   M o t i o n G r o u p N a m e I d l e ) ; 
 	 	 	 s t r i n g   m o t i o n N a m e   =   F i l e P a t h U t i l . G e t F i l e N a m e W i t h o u t D o u b l e E x t e n s i t o n ( f i l e N a m e ) ; 
 
 	 	 	 i f   ( ! m o t i o n G r o u p . m o t i o n s . C o n t a i n s K e y ( m o t i o n N a m e ) ) 
 	 	 	 { 
 	 	 	 	 m o t i o n G r o u p . m o t i o n s . A d d ( m o t i o n N a m e ,   n e w   M o t i o n I n f o ( m o t i o n N a m e ,   g r o u p N a m e ,   m o t i o n ,   n o F a d e M o t i o n ,   v o i c e F i l e ,   i s I d l e ) ) ; 
 	 	 	 } 
 	 	 } 
 
 	 	 v o i d   I n i t M a t r i x ( ) 
 	 	 { 
 	 	 	 / / 00000000
 	 	 	 v a r   h e i g h t   =   L i v e 2 D M o d e l . g e t C a n v a s H e i g h t ( ) ; 
 	 	 	 v a r   w i d t h   =   L i v e 2 D M o d e l . g e t C a n v a s W i d t h ( ) ; 
 
 	 	 	 / /   RgSn0Bfk000000000L0_
 	 	 	 / /   &~*jko0}cW0_0~0~00yR0000n0	YfL0g0M000
 	 	 	 L 2 D M o d e l M a t r i x   m m a t   =   n e w   L 2 D M o d e l M a t r i x ( w i d t h ,   h e i g h t ) ; 
 	 	 	 m m a t . s e t W i d t h ( w i d t h   /   P i x e l s T o U n i t s ) ; 
 	 	 	 m m a t . s e t C e n t e r P o s i t i o n ( 0 ,   0 ) ; 
 
 	 	 	 / /   MRg00000cc0f0D00n0g00M a t r i x 4 x 4 k0	YcW0j0D0h0D0Q0j0D0
 	 	 	 M a t r i x 4 x 4   m a t   =   M a t r i x 4 x 4 . i d e n t i t y ; 
 	 	 	 v a r   a r r a y   =   m m a t . g e t A r r a y ( ) ; 
 	 	 	 f o r   ( i n t   i   =   0 ;   i   <   1 6 ;   i + + ) 
 	 	 	 { 
 	 	 	 	 m a t [ i ]   =   a r r a y [ i ] ; 
 	 	 	 } 
 	 	 	 M o d e l M a t r i x   =   m a t ; 
 	 	 } 
 
 	 	 / / 00000B}Nk0J0Q000fe
 	 	 i n t e r n a l   v o i d   U p d a t e M o t i o n F i n i s h e d ( ) 
 	 	 { 
 	 	 	 / /   00000B}N
 	 	 	 i f   ( M a i n M o t i o n M a n a g e r . i s F i n i s h e d ( ) ) 
 	 	 	 { 
                                 / / J00c0_0 gRn0 NVn00
                                 i f   ( C u r r e n t M o t i o n S e t t i n g   ! = n u l l   & &   ! C u r r e n t M o t i o n S e t t i n g . I s E n d ) 
 	 	 	 	 { 
                                         s w i t c h   ( C u r r e n t M o t i o n S e t t i n g . P l a y T y p e ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 c a s e   M o t i o n P l a y T y p e . L o o p : 	 	 	 / / 000000j000TX0000000Qu
 	 	 	 	 	 	 	 S t a r t M o t i o n ( C u r r e n t M o t i o n S e t t i n g . M o t i o n ,   C u r r e n t M o t i o n S e t t i n g . P l a y T y p e ) ; 
 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 c a s e   M o t i o n P l a y T y p e . I d l e O n E n d : 	 	 / / 0000|00000h0W0f0Qu
 	 	 	 	 	 	 	 S t a r t R a n d o m M o t i o n ( M o t i o n G r o u p N a m e I d l e ) ; 
 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 c a s e   M o t i o n P l a y T y p e . R a n d o m G r o u p : 	 / / 000000000
 	 	 	 	 	 	 	 S t a r t R a n d o m M o t i o n ( C u r r e n t M o t i o n S e t t i n g . M o t i o n . G r o u p N a m e ) ; 
 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 	 d e f a u l t : 	 	 	 	 	 	 	 / / 00000B}N
 	 	 	 	 	 	 	 C u r r e n t M o t i o n S e t t i n g . I s E n d   =   t r u e ; 
 	 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 	 	 	 } 
 	 	 } 
 
 	 	 / / 000000000	Yf
 	 	 i n t e r n a l   b o o l   C h a n g e R a n d o m M o t i o n ( s t r i n g   g r o u p N a m e ,   b o o l   i s F a d e   =   t r u e ) 
 	 	 { 
 	 	 	 M o t i o n G r o u p   g r o u p ; 
 	 	 	 i f   ( ! M o t i o n G r o u p s . T r y G e t V a l u e ( g r o u p N a m e ,   o u t   g r o u p ) ) 
 	 	 	 { 
 	 	 	 	 r e t u r n   f a l s e ; 
 	 	 	 } 
 
 	 	 	 / / ek0T
Tn00000g00000Qu-N
 	 	 	 i f   ( C u r r e n t M o t i o n S e t t i n g   ! =   n u l l 
 	 	 	 	 & &   C u r r e n t M o t i o n S e t t i n g . M o t i o n   ! =   n u l l 
 	 	 	 	 & &   C u r r e n t M o t i o n S e t t i n g . P l a y T y p e   = =   M o t i o n P l a y T y p e . R a n d o m G r o u p 
 	 	 	 	 & &   C u r r e n t M o t i o n S e t t i n g . M o t i o n . G r o u p N a m e   = =   g r o u p N a m e ) 
 	 	 	 { 
 	 	 	 	 r e t u r n   t r u e ; 
 	 	 	 } 
 	 	 	 e l s e 
 	 	 	 { 
 	 	 	 	 / / 000000000S_
 	 	 	 	 M o t i o n I n f o   m o t i o n   =   G e t R a n d o m M o t i o n ( g r o u p N a m e ) ; 
 	 	 	 	 / / 00000L0j0D0j000j0k00W0j0D0
 	 	 	 	 i f   ( m o t i o n   = =   n u l l )   r e t u r n   f a l s e ; 
 
 	 	 	 	 S t a r t M o t i o n ( m o t i o n ,   M o t i o n P l a y T y p e . R a n d o m G r o u p ,   i s F a d e ) ; 
 	 	 	 	 r e t u r n   t r u e ; 
 	 	 	 } 
 
 	 	 } 
 
 	 	 / / 000000000	Yf
 	 	 b o o l   S t a r t R a n d o m M o t i o n ( s t r i n g   g r o u p N a m e ,   b o o l   i s F a d e   =   t r u e ) 
 	 	 { 
 	 	 	 / / 000000000S_
 	 	 	 M o t i o n I n f o   m o t i o n   =   G e t R a n d o m M o t i o n ( g r o u p N a m e ) ; 
 	 	 	 / / 00000L0j0D0j000j0k00W0j0D0
 	 	 	 i f   ( m o t i o n   = =   n u l l )   r e t u r n   f a l s e ; 
 
 	 	 	 S t a r t M o t i o n ( m o t i o n ,   M o t i o n P l a y T y p e . R a n d o m G r o u p , i s F a d e ) ; 
 	 	 	 r e t u r n   t r u e ; 
 	 	 } 
 
 	 	 / / 00000	Yf
 	 	 i n t e r n a l   b o o l   C h a n g e M o t i o n ( s t r i n g   n a m e ,   M o t i o n P l a y T y p e   p l a y T y p e ,   b o o l   i s F a d e   =   t r u e ) 
 	 	 { 
 	 	 	 M o t i o n I n f o   m o t i o n ; 
 	 	 	 i f   ( ! T r y G e t M o t i o n ( n a m e ,   o u t   m o t i o n ) ) 
 	 	 	 { 
 	 	 	 	 r e t u r n   f a l s e ; 
 	 	 	 } 
 	 	 	 e l s e 
 	 	 	 { 
 	 	 	 	 / / 000000QuY0y0M0K00000
 	 	 	 	 i f   ( C u r r e n t M o t i o n S e t t i n g   ! = n u l l   & &   ! M o t i o n P l a y T y p e U t i l . C h e c k R e p l a y M o t i o n ( C u r r e n t M o t i o n S e t t i n g . M o t i o n . N a m e ,   n a m e ,   p l a y T y p e ) ) 
 	 	 	 	 { 
 	 	 	 	 	 / / TX0000000]0n0~0~0}Q000000000`0Q0	YH000
 	 	 	 	 	 C u r r e n t M o t i o n S e t t i n g . P l a y T y p e   =   p l a y T y p e ; 
 	 	 	 	 	 C u r r e n t M o t i o n S e t t i n g . I s E n d   =   f a l s e ; 
 	 	 	 	 } 
 	 	 	 	 e l s e 
 	 	 	 	 { 
 	 	 	 	 	 / /   00000Qu
 	 	 	 	 	 S t a r t M o t i o n ( m o t i o n ,   p l a y T y p e ,   i s F a d e ) ; 
 	 	 	 	 } 
 	 	 	 	 r e t u r n   t r u e ; 
 	 	 	 } 
 	 	 } 
 
 	 	 / / 00000	Yf
 	 	 v o i d   S t a r t M o t i o n ( M o t i o n I n f o   m o t i o n ,   M o t i o n P l a y T y p e   p l a y T y p e ,   b o o l   i s F a d e   =   t r u e ) 
 	 	 { 
 	 	 	 / /   00000Qu
 	 	 	 i f   ( ! I s I n i t ) 
 	 	 	 { 
 	 	 	 	 M a i n M o t i o n M a n a g e r . s t a r t M o t i o n ( m o t i o n . N o F a d e M o t i o n ) ; 
 	 	 	 } 
 	 	 	 e l s e 
 	 	 	 { 
                                 M a i n M o t i o n M a n a g e r . s t a r t M o t i o n ( m o t i o n . M o t i o n ) ; 
 	 	 	 } 
 	 	 	 / /   XQu
 	 	 	 i f   ( C a l l b a c k P l a y S o u n d ! = n u l l )   C a l l b a c k P l a y S o u n d ( m o t i o n . V o i c e F i l e ) ; 
 
 	 	 	 C u r r e n t M o t i o n S e t t i n g   =   n e w   M o t i o n S e t t i n g ( m o t i o n , p l a y T y p e ) ; 
 	 	 } 
 	 	 
 	 	 / / 0000j0W0n000000k0	YH00
 	 	 i n t e r n a l   v o i d   C h a g n g e C u r r e n t M o t i o n T o N o F a d e ( ) 
 	 	 { 
 	 	 	 i f   ( C u r r e n t M o t i o n S e t t i n g   ! =   n u l l ) 
 	 	 	 { 
 	 	 	 	 M a i n M o t i o n M a n a g e r . s t a r t M o t i o n ( C u r r e n t M o t i o n S e t t i n g . M o t i o n . N o F a d e M o t i o n ) ; 
 	 	 	 } 
 	 	 } 
 
 	 	 / / 0000n0-NK000000g0000000@b_
 	 	 M o t i o n I n f o   G e t R a n d o m M o t i o n ( s t r i n g   g r o u p N a m e ) 
 	 	 { 
 	 	 	 M o t i o n G r o u p   g r o u p ; 
 	 	 	 i f   ( ! M o t i o n G r o u p s . T r y G e t V a l u e ( g r o u p N a m e ,   o u t   g r o u p ) ) 
 	 	 	 { 
 	 	 	 	 r e t u r n   n u l l ; 
 	 	 	 } 
 	 	 	 D i c t i o n a r y < s t r i n g ,   M o t i o n I n f o >   m o t i o n s   =   g r o u p . m o t i o n s ; 
 	 	 	 i n t   i n d e x   =   U n i t y E n g i n e . R a n d o m . R a n g e (   0 ,   m o t i o n s . C o u n t   ) ; 
 	 	 	 f o r e a c h (   M o t i o n I n f o   m o t i o n   i n   m o t i o n s . V a l u e s   ) 
 	 	 	 { 
 	 	 	 	 i f   ( i n d e x   = =   0 ) 
 	 	 	 	 { 
 	 	 	 	 	 r e t u r n   m o t i o n ; 
 	 	 	 	 } 
 	 	 	 	 - - i n d e x ; 
 	 	 	 } 
 	 	 	 D e b u g . L o g E r r o r ( " R a n d o m E r r o r " ) ; 
 	 	 	 r e t u r n   n u l l ; 
 	 	 } 
 
 	 	 / / c[
Tn0000000S_
 	 	 b o o l   T r y G e t M o t i o n ( s t r i n g   n a m e ,   o u t   M o t i o n I n f o   m o t i o n   ) 
 	 	 { 
 	 	 	 f o r e a c h   ( v a r   m o t i o n G r o u p   i n   M o t i o n G r o u p s . V a l u e s ) 
 	 	 	 { 
 	 	 	 	 i f   ( m o t i o n G r o u p . m o t i o n s . T r y G e t V a l u e ( n a m e ,   o u t   m o t i o n ) ) 
 	 	 	 	 { 
 	 	 	 	 	 r e t u r n   t r u e ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 	 m o t i o n   =   n u l l ; 
 	 	 	 r e t u r n   f a l s e ; 
 	 	 } 
 
 	 	 / / h`	Yf
 	 	 p u b l i c   b o o l   C h a n g e E x p r e s s i o n ( s t r i n g   n a m e ) 
 	 	 { 
 	 	 	 L 2 D E x p r e s s i o n M o t i o n   e x p r e s s i o n ; 
 	 	 	 i f   ( E x p r e s s i o n s . T r y G e t V a l u e ( n a m e ,   o u t   e x p r e s s i o n ) ) 
 	 	 	 { 
 	 	 	 	 C u r r e n t E x p r e s s i o n N a m e   =   n a m e ; 
 	 	 	 	 / /   00000Qu
 	 	 	 	 E x p r e s s i o n M a n a g e r . s t a r t M o t i o n ( e x p r e s s i o n ) ; 
 	 	 	 	 r e t u r n   t r u e ; 
 	 	 	 } 
 	 	 	 r e t u r n   f a l s e ; 
 	 	 } 
 
 	 	 / / h`	Yf0000
 	 	 p u b l i c   v o i d   S t o p E x p r e s s i o n ( ) 
 	 	 { 
 	 	 	 C u r r e n t E x p r e s s i o n N a m e   =   " " ; 
 	 	 	 / /   00000Qu
 	 	 	 E x p r e s s i o n M a n a g e r . s t o p A l l M o t i o n s ( ) ; 
 	 	 } 
 
 	 	 / / 000000n0-[
 	 	 p u b l i c   v o i d   S e t P a r a m F l o a t ( s t r i n g   p a r a m I D ,   f l o a t   v a l ) 
 	 	 { 
 	 	 	 L i v e 2 D M o d e l . s e t P a r a m F l o a t ( p a r a m I D ,   v a l ) ; 
 	 	 } 
 
 	 	 p u b l i c   v o i d   S e t P a r a m F l o a t ( s t r i n g   p a r a m I D ,   f l o a t   v a l ,   f l o a t   w e i g h t ) 
 	 	 { 
 	 	 	 L i v e 2 D M o d e l . s e t P a r a m F l o a t ( p a r a m I D ,   v a l ,   w e i g h t ) ; 
 	 	 } 
 
 	 	 / / 000-[
 	 	 p u b l i c   v o i d   S e t C o l o r ( C o l o r   c o l o r ) 
 	 	 { 
 	 	 	 L i v e 2 D M o d e l . g e t D r a w P a r a m ( ) . s e t B a s e C o l o r ( c o l o r . a ,   c o l o r . r ,   c o l o r . g ,   c o l o r . b ) ; 
 	 	 } 
 
 	 	 / / c[I D n0D r a w D a t a h00c[W0_0pn0S__00$R[0Y000
 	 	 p u b l i c   b o o l   H i t T e s t ( s t r i n g   h i t A r e a N a m e ,   V e c t o r 3   p o i n t ,   M a t r i x 4 x 4   l o c a l T o W o r l d M a t r i x ) 
 	 	 { 
 	 	 	 i f   ( h i t A r e a I d s . C o n t a i n s K e y ( h i t A r e a N a m e ) ) 
 	 	 	 { 
 	 	 	 	 R e c t   r e c t ; 
 	 	 	 	 i f   ( T r y G e t H i t R e c t ( h i t A r e a I d s [ h i t A r e a N a m e ] ,   l o c a l T o W o r l d M a t r i x ,   o u t   r e c t ) ) 
 	 	 	 	 { 
 	 	 	 	 	 r e t u r n   r e c t . C o n t a i n s ( p o i n t ) ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 	 r e t u r n   f a l s e ; 
 	 	 } 
 
 	 	 / / pen0pn0i00K0L0 N[ݍ▅QK0
 	 	 b o o l   T r y G e t H i t R e c t ( s t r i n g   d r a w I D ,   M a t r i x 4 x 4   l o c a l T o W o r l d M a t r i x ,   o u t   R e c t   r e c t ) 
 	 	 { 
 	 	 	 i n t   d r a w I n d e x   =   L i v e 2 D M o d e l . g e t D r a w D a t a I n d e x ( d r a w I D ) ; 
 	 	 	 r e c t   =   n e w   R e c t ( ) ; 
 	 	 	 i f   ( d r a w I n d e x   <   0 ) 
 	 	 	 { 
 	 	 	 	 r e t u r n   f a l s e ; / /   X[(WW0j0D04XT
 	 	 	 } 
 	 	 	 f l o a t [ ]   p o i n t s   =   L i v e 2 D M o d e l . g e t T r a n s f o r m e d P o i n t s ( d r a w I n d e x ) ; 
 	 	 	 r e c t   =   H i t P o i n t s T o W o r l d R e c t ( p o i n t s ,   l o c a l T o W o r l d M a t r i x ) ; 
 	 	 	 r e t u r n   t r u e ; 
 	 	 } 
 
 	 	 / / pen0pn0i00K0L0 N[ݍ▅QK0
 	 	 R e c t   H i t P o i n t s T o W o r l d R e c t ( f l o a t [ ]   p o i n t s ,   M a t r i x 4 x 4   l o c a l T o W o r l d M a t r i x ) 
 	 	 { 
 	 	 	 V e c t o r 3   m i n   =   n e w   V e c t o r 3 ( f l o a t . M a x V a l u e ,   f l o a t . M a x V a l u e ,   0 ) ; 
 	 	 	 V e c t o r 3   m a x   =   n e w   V e c t o r 3 ( f l o a t . M i n V a l u e ,   f l o a t . M i n V a l u e ,   0 ) ; 
 
 	 	 	 M a t r i x 4 x 4   m a t   =   l o c a l T o W o r l d M a t r i x   *   M o d e l M a t r i x ; 
 	 	 	 f o r   ( i n t   i   =   0 ;   i   <   p o i n t s . L e n g t h ;   i   =   i   +   2 ) 
 	 	 	 { 
 	 	 	 	 V e c t o r 3   p o i n t   =   n e w   V e c t o r 3 ( p o i n t s [ i ] ,   p o i n t s [ i   +   1 ] ,   0 ) ; 
 	 	 	 	 p o i n t   =   m a t . M u l t i p l y P o i n t ( p o i n t ) ; 
 	 	 	 	 m i n   =   V e c t o r 3 . M i n ( m i n ,   p o i n t ) ; 
 	 	 	 	 m a x   =   V e c t o r 3 . M a x ( m a x ,   p o i n t ) ; 
 	 	 	 } 
 	 	 	 R e c t   r e c t   =   n e w   R e c t ( ) ; 
 	 	 	 r e c t . m i n   =   m i n ; 
 	 	 	 r e c t . m a x   =   m a x ; 
 	 	 	 r e t u r n   r e c t ; 
 	 	 } 
 
 	 	 / / hQS__00$R[n0wb_0S_
 	 	 p u b l i c   L i s t < R e c t >   G e t A l l H i t R e c t s ( M a t r i x 4 x 4   l o c a l T o W o r l d M a t r i x ) 
 	 	 { 
 	 	 	 L i s t < R e c t >   r e c t s   =   n e w   L i s t < R e c t > ( ) ; 
 	 	 	 f o r e a c h   ( s t r i n g   d r a w I D   i n   h i t A r e a I d s . V a l u e s ) 
 	 	 	 { 
 	 	 	 	 R e c t   r e c t ; 
 	 	 	 	 i f   ( T r y G e t H i t R e c t ( d r a w I D ,   l o c a l T o W o r l d M a t r i x ,   o u t   r e c t ) ) 
 	 	 	 	 { 
 	 	 	 	 	 r e c t s . A d d ( r e c t ) ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 	 r e t u r n   r e c t s ; 
 	 	 } 
 
 	 	 / / hQS__00$R[0+T0wb_0S_
 	 	 p u b l i c   b o o l   T r y G e t T o t a l H i t R e c t ( M a t r i x 4 x 4   l o c a l T o W o r l d M a t r i x ,   o u t   R e c t   t o t a l R e c t ) 
 	 	 { 
 	 	 	 b o o l   r e t   =   f a l s e ; 
 	 	 	 t o t a l R e c t   =   n e w   R e c t ( ) ; 
 	 	 	 t o t a l R e c t . m i n   =   n e w   V e c t o r 2 ( f l o a t . M a x V a l u e ,   f l o a t . M a x V a l u e ) ; 
 	 	 	 t o t a l R e c t . m a x   =   n e w   V e c t o r 2 ( f l o a t . M i n V a l u e ,   f l o a t . M i n V a l u e ) ; 
 	 	 	 f o r e a c h   ( s t r i n g   d r a w I D   i n   h i t A r e a I d s . V a l u e s ) 
 	 	 	 { 
 	 	 	 	 R e c t   r e c t ; 
 	 	 	 	 i f   ( T r y G e t H i t R e c t ( d r a w I D ,   l o c a l T o W o r l d M a t r i x ,   o u t   r e c t ) ) 
 	 	 	 	 { 
 	 	 	 	 	 t o t a l R e c t . m i n   =   V e c t o r 2 . M i n ( t o t a l R e c t . m i n ,   r e c t . m i n ) ; 
 	 	 	 	 	 t o t a l R e c t . m a x   =   V e c t o r 2 . M a x ( t o t a l R e c t . m a x ,   r e c t . m a x ) ; 
 	 	 	 	 	 r e t   =   t r u e ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 	 r e t u r n   r e t ;   
 	 	 } 
 	 } 
 
 } 
 