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   j p . n y a t l a . n y a r t o o l k i t . c s . m a r k e r s y s t e m ; 
 u s i n g   j p . n y a t l a . n y a r t o o l k i t . c s . c o r e ; 
 u s i n g   N y A R U n i t y U t i l s ; 
 u s i n g   S y s t e m . I O ; 
 
 p u b l i c   c l a s s   A R J p e g B e h a v i o u r   :   M o n o B e h a v i o u r 
 { 
 	 p r i v a t e   N y A R U n i t y M a r k e r S y s t e m   _ m s ; 
 	 p r i v a t e   N y A R U n i t y S e n s o r   _ s s ; 
 	 p r i v a t e   i n t   m i d ; / / m a r k e r   i d 
 	 p r i v a t e   G a m e O b j e c t   _ b g _ p a n e l ; 
 	 
 	 v o i d   A w a k e ( ) 
 	 { 
 	 	 / / s e t u p   t e x t u r e 
 	 	 T e x t u r e 2 D   t e x =   ( T e x t u r e 2 D ) R e s o u r c e s . L o a d ( " 3 2 0 x 2 4 0 A B G R " ,   t y p e o f ( T e x t u r e 2 D ) ) ; 
 	 	 t h i s . _ s s = n e w   N y A R U n i t y S e n s o r ( t e x . w i d t h , t e x . h e i g h t ) ; 
 	 	 t h i s . _ s s . u p d a t e ( t e x ) ; 
 	 
 	 	 N y A R M a r k e r S y s t e m C o n f i g   c o n f i g   =   n e w   N y A R M a r k e r S y s t e m C o n f i g ( t e x . w i d t h , t e x . h e i g h t ) ; 
 	 	 t h i s . _ m s = n e w   N y A R U n i t y M a r k e r S y s t e m ( c o n f i g ) ; 
 	 	 t h i s . _ m s . s e t C o n f i d e n c e T h r e s h o l d ( 0 . 1 ) ; 
 	 	 m i d = t h i s . _ m s . a d d A R M a r k e r ( 
 	 	 	 n e w   S t r e a m R e a d e r ( n e w   M e m o r y S t r e a m ( ( ( T e x t A s s e t ) R e s o u r c e s . L o a d ( " p a t t _ h i r o " , t y p e o f ( T e x t A s s e t ) ) ) . b y t e s ) ) , 
 	 	 	 1 6 , 2 5 , 8 0 ) ; 
 	 	 / / s e t u p   b a c k g r o u n d 
 	 	 t h i s . _ b g _ p a n e l = G a m e O b j e c t . F i n d ( " P l a n e " ) ; 
 	 	 t h i s . _ b g _ p a n e l . r e n d e r e r . m a t e r i a l . m a i n T e x t u r e = t e x ; 
 	 	 t h i s . _ m s . s e t A R B a c k g r o u n d T r a n s f o r m ( t h i s . _ b g _ p a n e l . t r a n s f o r m ) ; 
 	 	 
 	 	 / / s e t u p   c a m e r a   p r o j e c t i o n 
 	 	 t h i s . _ m s . s e t A R C a m e r a P r o j e c t i o n ( t h i s . c a m e r a ) ; 
 	 } 
 	 / /   U s e   t h i s   f o r   i n i t i a l i z a t i o n 
 	 v o i d   S t a r t   ( ) 
 	 { 
 	 } 
 	 / /   U p d a t e   i s   c a l l e d   o n c e   p e r   f r a m e 
 	 v o i d   U p d a t e   ( ) 
 	 { 
 	 	 / / U p d a t e   m a r k e r   s y s t e m   b y   s s 
 	 	 t h i s . _ m s . u p d a t e ( t h i s . _ s s ) ; 
 	 	 / / u p d a t e   G a m e o b j e c t   t r a n s f o r m 
 	 	 i f ( t h i s . _ m s . i s E x i s t M a r k e r ( m i d ) ) { 
 	 	 	 D e b u g . L o g ( c + " : " + t h i s . _ m s . g e t C o n f i d e n c e ( m i d ) ) ; 
 	 	 	 t h i s . _ m s . s e t M a r k e r T r a n s f o r m ( m i d , G a m e O b j e c t . F i n d ( " M a r k e r O b j e c t " ) . t r a n s f o r m ) ; 
 	 	 D e b u g . L o g ( t h i s . _ m s . g e t C o n f i d e n c e ( m i d ) ) ; 
 	 	 } e l s e { 
 	 	 	 / /   h i d e   G a m e   o b j e c t 
 	 	 	 G a m e O b j e c t . F i n d ( " M a r k e r O b j e c t " ) . t r a n s f o r m . l o c a l P o s i t i o n = n e w   V e c t o r 3 ( 0 , 0 , - 1 0 0 ) ; 
 	 	 } 
 	 } 
 	 i n t   c = 0 ; 
 } 
 