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 ; 
 / / /   < s u m m a r y > 
 / / /   S0n0000000000o00000hbn0;uP000000h0W0f0S_W0~0Y00
 / / /   0000000k0o00h i r o 0000O(uW0f0O0`0U0D00
 / / /   < / s u m m a r y > 
 p u b l i c   c l a s s   M a r k e r P l a n e B e h a v i o 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 W e b C a m   _ 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   u n i t y   w e b c a m 
 	 	 W e b C a m D e v i c e [ ]   d e v i c e s =   W e b C a m T e x t u r e . d e v i c e s ; 
 
 	 	 i f   ( d e v i c e s . L e n g t h   < = 0 ) { 
 	 	 	 D e b u g . L o g E r r o r ( " N o   W e b c a m . " ) ; 
 	 	 	 r e t u r n ; 
 	 	 } 
 	 	 W e b C a m T e x t u r e   w = n e w   W e b C a m T e x t u r e ( 3 2 0 , 2 4 0 , 1 5 ) ; 
 	 	 / / M a k e   W e b c a m T e x t u r e   w r a p p e d   S e n s o r . 
 	 	 t h i s . _ s s = N y A R U n i t y W e b C a m . c r e a t e I n s t a n c e ( w ) ; 
 	 	 / / M a k e   c o n f i g u l a t i o n   b y   S e n s o r   s i z e . 
 	 	 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 h i s . _ s s . w i d t h , t h i s . _ s s . 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 ) ; 
 	 	 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 = w ; 
 	 	 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 ) ; 
 	 	 r e t u r n ; 
 	 } 	 
 	 / /   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   ( ) 
 	 { 
 	 	 t h i s . _ s s . s t a r t ( ) ; 
 	 } 
 	 i n t   c = 0 ; 
 	 / /   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 . _ s s . u p d a t e ( ) ; 
 	 	 t h i s . _ m s . u p d a t e ( t h i s . _ s s ) ; 
 	 	 V e c t o r 3   m p o s = I n p u t . m o u s e P o s i t i o n ; 
 	 	 m p o s = t h i s . c a m e r a . S c r e e n T o V i e w p o r t P o i n t ( m p o s ) ; 
 	 	 m p o s . x = ( m p o s . x ) * 3 2 0 ; 
 	 	 m p o s . y = ( 1 . 0 f - m p o s . y ) * 2 4 0 ; 
 	 	 D e b u g . L o g ( c + " : " + m p o s . x + " , " + m p o s . y + " , " + m p o s . z ) ; c + + ; 
 	 	 / / 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 ) ) { 
 	 	 	 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 ) ; 
 	 	 	 / / 000^jn0S_
 	 	 	 / / s^b^jk0	Yc
 	 	 	 V e c t o r 3   p = n e w   V e c t o r 3 ( ) ; 
 	 	 	 t h i s . _ m s . g e t M a r k e r P l a n e P o s ( m i d , ( i n t ) m p o s . x , ( i n t ) m p o s . y , r e f   p ) ; 
 	 	 	 G a m e O b j e c t . F i n d ( " C u b e " ) . t r a n s f o r m . l o c a l P o s i t i o n = p ; 
 	 	 	 T r a n s f o r m   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 ; 
 	 	 } 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 ) ; 
 	 	 } 
 	 } 
 } 
 
 