コード例 #1
0
        // Use this for initialization
        private void Start()
        {
            //
            if( m_InputPanelLeft == null )
            {
                Debug.LogError( "The InputPanelLeft has not assigned.", this );
                return;
            }

            //
            if( m_InputPanelRight == null )
            {
                Debug.LogError( "The InputPanelRight has not assigned.", this );
                return;
            }

            //
            if( m_GridApartmentLayout == null )
            {
                Debug.LogError( "The GridApartmentLayout has not assigned.", this );
                return;
            }

            //
            m_GridItems = m_GridApartmentLayout.GetComponentsInChildren<ApartmentLayoutItem>();

            //
            if( m_GridItems == null || m_GridItems.Length <= 0 )
            {
                Debug.LogError( "The GridItems is Null or Empty.", this );
                return;
            }

            //
            if( m_GridDefaultItem == null )
                m_GridDefaultItem = m_GridItems[0];

            //
            if( m_GridDefaultItem == null )
            {
                Debug.LogError( "The GridDefaultItem has not assigned.", this );
                return;
            }

            //
            m_UICenterOnChild = m_GridApartmentLayout.GetComponent<UICenterOnChild>();

            //
            if( m_UICenterOnChild == null )
            {
                Debug.LogError( "The GridApartmentLayout has not assigned Component:'UICenterOnChild'.", this );
                return;
            }

            //			//
            //			if( string.IsNullOrEmpty( m_WaveLeftGestureName ) )
            //			{
            //				Debug.LogError( "The WaveLeftGestureName is Null or Empty", this );
            //				return;
            //			}
            //
            //			//
            //			if( string.IsNullOrEmpty( m_WaveRightGestureName ) )
            //			{
            //				Debug.LogError( "The WaveRightGestureName is Null or Empty", this );
            //				return;
            //			}

            //
            m_Menu = this.GetComponent<Menu>();

            //
            if( m_Menu == null )
            {
                Debug.LogError( "This GameObject has not assigned Component:'Menu'.", this );
                return;
            }

            //
            m_Menu.OnOpen += this.OnMenuOpen;
            m_Menu.OnOpened += this.OnMenuOpened;

            //
            m_UICenterOnChild.onCenter = OnCenterStart;
            m_UICenterOnChild.onFinished = OnCenterFinished;

            //
            UIEventListener listener = UIEventListener.Get( m_InputPanelLeft.gameObject );
            listener.onHover = this.OnHoverInputPanelLeft;
            listener.onClick = this.OnClickedInputPanelLeft;

            listener = UIEventListener.Get( m_InputPanelRight.gameObject );
            listener.onHover = this.OnHoverInputPanelRight;
            listener.onClick = this.OnClickedInputPanelRight;

            //
            StartCoroutine( DelayInit() );
        }
コード例 #2
0
        //
        private void OnMenuOpen( Menu menu )
        {
            //
            if( !m_bInit )
                return;

            //
            m_AlertWelcome.Show( 1.0f );

            //
            m_bHasWaveHand = false;

            //
            m_bTweening = true;

            //
            m_bPrepareUI = false;

            //
            m_GridApartmentLayout.gameObject.SetActive( false );
        }
コード例 #3
0
        //
        private void OnMenuOpened( Menu menu )
        {
            //
            if( !m_bInit )
                return;

            //
            //m_UICenterOnChild.CenterOn( m_GridDefaultItem.transform );

            //
            CKinect.CursorController.Instance.EnableCursor();

            //
            CKinect.CursorController.Instance.IsLoadingActive = false;

            //
            m_bTweening = false;

            //
            m_bHasItemPrepared = true;
            m_LastItem = null;
        }
コード例 #4
0
ファイル: Gallery.cs プロジェクト: ShipuW/unity-study
        //
        private void OnMenuOpened( Menu menu )
        {
            //
            if( !m_bInit )
                return;

            //
            CKinect.CursorController.Instance.EnableCursor();

            //
            CKinect.CursorController.Instance.IsLoadingActive = false;

            //
            m_bTweening = false;
        }
コード例 #5
0
ファイル: Gallery.cs プロジェクト: ShipuW/unity-study
        // Use this for initialization
        private void Start()
        {
            //
            if (m_UITextureCurrent == null)
            {
                Debug.LogError("The 'UITextureCurrent' has not assigned.", this);
                return;
            }

            //
            if (m_UITextureNext == null)
            {
                Debug.LogError("The 'UITextureNext' has not assigned.", this);
                return;
            }

            //
            if (m_UITexturePrevious == null)
            {
                Debug.LogError("The 'UITexturePrevious' has not assigned.", this);
                return;
            }

            TweenPosition tp = null;

            tp = m_UITextureCurrent.GetComponent<TweenPosition>();

            if (tp == null)
            {
                Debug.LogError("The 'UITextureCurrent' has not component'TweenPosition'.", this);
                return;
            }

            tp.duration = m_TextureTweenDuration;

            //
            tp = m_UITextureNext.GetComponent<TweenPosition>();

            if (tp == null)
            {
                Debug.LogError("The 'UITextureNext' has not component'TweenPosition'.", this);
                return;
            }

            tp.duration = m_TextureTweenDuration;

            //
            tp = m_UITexturePrevious.GetComponent<TweenPosition>();

            if (tp == null)
            {
                Debug.LogError("The 'UITexturePrevious' has not component'TweenPosition'.", this);
                return;
            }

            tp.duration = m_TextureTweenDuration;

            //
            if (m_ButtonNext == null)
            {
                Debug.LogError("The ButtonNext has not assigned.", this);
                return;
            }

            //
            if (m_ButtonPrevious == null)
            {
                Debug.LogError("The ButtonPrevious has not assigned.", this);
                return;
            }

            //
            //m_fLastInputTime = Time.time;

            //
            int next = m_CurrIndex + 1;
            if (next > m_EndIndex)
                next = m_StartIndex;
            m_TextureNext = Resources.Load<Texture2D>(m_Prefix + next.ToString(m_FilenameFormat));

            int previous = m_CurrIndex - 1;
            if (previous < m_StartIndex)
                previous = m_EndIndex;
            m_TexturePrevious = Resources.Load<Texture2D>(m_Prefix + previous.ToString(m_FilenameFormat));

            //
            m_UITextureCurrent.mainTexture = Resources.Load<Texture2D>(m_Prefix + m_CurrIndex.ToString(m_FilenameFormat));
            m_UITextureNext.mainTexture = m_TextureNext;
            m_UITexturePrevious.mainTexture = m_TexturePrevious;

            //
            UIEventListener listener = UIEventListener.Get(m_ButtonNext.gameObject);
            listener.onClick = this.OnButtonNextClick;
            listener.onHover = this.OnButtonNextHover;

            listener = UIEventListener.Get(m_ButtonPrevious.gameObject);
            listener.onClick = this.OnButtonPreviousClick;
            listener.onHover = this.OnButtonPreviousHover;

            //
            if( m_AutoSize )
            {
                m_TextureSize.x = Screen.width;
                m_TextureSize.y = Screen.height;

                m_LeftPos.x = -Screen.width;
                m_RightPos.x = Screen.width;
            }

            //
            m_UITextureNext.transform.localPosition = m_RightPos;
            m_UITexturePrevious.transform.localPosition = m_LeftPos;

            m_UITextureCurrent.width = (int)m_TextureSize.x;
            m_UITextureCurrent.height = (int)m_TextureSize.y;

            m_UITextureNext.width = (int)m_TextureSize.x;
            m_UITextureNext.height = (int)m_TextureSize.y;

            m_UITexturePrevious.width = (int)m_TextureSize.x;
            m_UITexturePrevious.height = (int)m_TextureSize.y;

            //
            //m_vCurrentPageStartPos = m_UITextureCurrent.transform.localPosition;
            //m_vNextPageStartPos = m_UITextureNext.transform.localPosition;
            //m_vPreviousPageStartPos = m_UITexturePrevious.transform.localPosition;

            if (string.IsNullOrEmpty(m_WaveLeftGestureName))
            {
                Debug.LogError("The WaveGestureName has not assigned.");
                return;
            }

            if (string.IsNullOrEmpty(m_WaveRightGestureName))
            {
                Debug.LogError("The WaveGestureName has not assigned.");
                return;
            }

            //
            //
            m_Menu = this.GetComponent<Menu>();

            //
            if( m_Menu == null )
            {
                Debug.LogError( "This GameObject has not assigned Component:'Menu'.", this );
                return;
            }

            //
            m_Menu.OnOpen += this.OnMenuOpen;
            m_Menu.OnOpened += this.OnMenuOpened;

            //
            StartCoroutine( DelayInit() );
        }
コード例 #6
0
ファイル: VideoPlayer.cs プロジェクト: ShipuW/unity-study
        public void OnMenuClose( Menu menu )
        {
            Debug.Log("OnMenuClose");
            BetterList<UIToggle> list = UIToggle.list;

            //UIToggle toggle = UIToggle.GetActiveToggle(1);

            for (int i = 0; i < list.size; ++i)
            {
                UIToggle toggle = list[i];
                if (toggle != null && toggle.group == 1 )
                {
                    toggle.Set(false);

                    Debug.Log("toggle set false");

                }
            }
        }
コード例 #7
0
ファイル: Gallery.cs プロジェクト: ShipuW/unity-study
        //
        private void OnMenuOpen( Menu menu )
        {
            //
            if( !m_bInit )
                return;
            //
            m_AlertWelcome.Show( 1.0f );

            //
            m_bTweening = true;
        }
コード例 #8
0
ファイル: VideoPlayer.cs プロジェクト: ShipuW/unity-study
        //
        private void OnMenuOpen( Menu menu )
        {
            //
            if( !m_bInit )
                return;
            //
            m_AlertWelcome.Show( 1.0f );

            //
            m_bTweening = true;

            //
            if(m_bInZoomIn)
            {
                //缩小
                TweenTransform tt = m_VideoOutputTexture.GetComponent<TweenTransform>();
                tt.PlayReverse();
                tt = m_VideoOutputTexMask.GetComponent<TweenTransform>();
                tt.PlayReverse();
                m_bInZoomIn = false;
                n_bInTweenZoom = false;
            }
        }
コード例 #9
0
ファイル: VideoPlayer.cs プロジェクト: ShipuW/unity-study
        // Use this for initialization
        void Start()
        {
            if(m_ParentVideoItem == null)
            {
                Debug.LogError("The 'ParentVideoItem' has not assigned!");
                return;
            }

            m_VideoItems = m_ParentVideoItem.GetComponentsInChildren<VideoItem>();

            if( m_VideoItems == null || m_VideoItems.Length<=0 )
            {
                Debug.LogError("Can't find Components 'VideoItem' in " + m_ParentVideoItem.name);
                return;
            }

            foreach(VideoItem vi in m_VideoItems)
            {
                //UIEventListener.Get(vi.gameObject).onClick = OnVideoItemClick;

                UIToggle toggle = vi.GetComponent<UIToggle>();

                EventDelegate.Add(toggle.onChange,OnToggleChanged);
            }

            if( m_VideoOutputTexture == null )
            {
                Debug.LogError( "The 'VideoOutputTexture' has not assigned!" );
                return;
            }

            if( m_VideoOutputTexMask == null )
            {
                Debug.LogError( "The 'VideoOutputTexMask' has not assigned!" );
                return;
            }

            if( string.IsNullOrEmpty( m_Folder ) )
            {
                Debug.LogError( "The Video folder is Null or Empty", this );
                return;
            }

            if( m_Filenames == null || m_Filenames.Count <= 0 )
            {
                Debug.LogError( "The Video file names is Null or count <= 0!", this );
                return;
            }

            if( m_MovieA == null )
            {
                Debug.LogError( "The 'MovieA' has not assigned!", this );
                return;
            }

            if( m_MovieB == null )
            {
                Debug.LogError( "The 'MovieB' has not assigned!", this );
                return;
            }

            //
            if( string.IsNullOrEmpty( m_WaveLeftGestureName ) )
            {
                Debug.LogError( "The WaveLeftGestureName is Null or Empty", this );
                return;
            }

            //
            if( string.IsNullOrEmpty( m_WaveRightGestureName ) )
            {
                Debug.LogError( "The WaveRightGestureName is Null or Empty", this );
                return;
            }

            if( m_VideoDefaultTexture == null )
            {
                Debug.LogError( " The 'VideoDefaultTexture' has not assigned! ",this);
                return;
            }

            UIEventListener.Get(m_VideoOutputTexture.gameObject).onClick= this.ZoomMoiveTex;

            //
            m_Menu = this.GetComponent<Menu>();

            //
            if( m_Menu == null )
            {
                Debug.LogError( "This GameObject has not assigned Component:'Menu'.", this );
                return;
            }

            m_VideoOutputTexture.mainTexture = m_VideoDefaultTexture;

            //
            m_Menu.OnOpen += this.OnMenuOpen;
            m_Menu.OnOpened += this.OnMenuOpened;
            m_Menu.OnClose += this.OnMenuClose;

            m_MovieA._loop = false;
            m_MovieB._loop = false;
            _movies = new AVProQuickTimeMovie[2];
            _movies[0] = m_MovieA;
            _movies[1] = m_MovieB;
            _moviePlayIndex = 0;
            _movieLoadIndex = 1;

            m_Folder = Application.streamingAssetsPath + m_Folder;

            StartCoroutine( DelayInit() );
        }
コード例 #10
0
ファイル: MapViewer.cs プロジェクト: ShipuW/unity-study
        // Use this for initialization
        private void Start()
        {
            //
            if( m_DragResize == null )
            {
                Debug.LogError( "The DragResize has not assigned.", this );
                return;
            }

            //
            if( m_ButtonZoomIn == null )
            {
                Debug.LogError( "The ButtonZoomIn has not assigned.", this );
                return;
            }

            //
            if( m_ButtonZoomOut == null )
            {
                Debug.LogError( "The ButtonZoomOut has not assigned.", this );
                return;
            }

            //
            //
            m_Menu = this.GetComponent<Menu>();

            //
            if( m_Menu == null )
            {
                Debug.LogError( "This GameObject has not assigned Component:'Menu'.", this );
                return;
            }

            //
            m_Menu.OnOpen += this.OnMenuOpen;
            m_Menu.OnOpened += this.OnMenuOpened;

            //
            UIEventListener listener = UIEventListener.Get( m_ButtonZoomIn.gameObject );
            listener.onClick = this.OnButtonZoomIn;

            listener = UIEventListener.Get( m_ButtonZoomOut.gameObject );
            listener.onClick = this.OnButtonZoomOut;

            //
            StartCoroutine( DelayInit() );
        }
コード例 #11
0
ファイル: Main.cs プロジェクト: ShipuW/unity-study
        //
        private void OnMenuClose( Menu menu )
        {
            //
            if( !m_bInit )
                return;

            //
            TouchButtonManager.Instance.Show();

            //
            CKinect.CursorController.Instance.DisableCursor();

            //
            if( menu.ID == m_IDOutDoor )
            {
                iTween.MoveTo( m_Camera.gameObject, iTween.Hash( "position",m_CameraOriginLocation.position, "time", m_CameraTweenBackDuration,
                                                                "oncomplete", "OnOutDoorMoveBackCompleted", "oncompletetarget", this.gameObject ) );
                iTween.RotateTo( m_Camera.gameObject, m_CameraOriginLocation.eulerAngles, m_CameraTweenBackDuration );

                //
                m_UserVisualPanel.SetActive( true );
                m_TouchButtonParent.SetActive( true );
                //
                m_OrbitCamera.enabled = false;
                //
                IndicatorManager.Instance.Hide();
                //
                OutDoorInteractiveObjectManager.Instance.Hide();
            }
            else
            {
                //
                HasInteractive = true;
            }
        }
コード例 #12
0
ファイル: OutDoor.cs プロジェクト: ShipuW/unity-study
        // Use this for initialization
        private void Start()
        {
            //
            if( m_ButtonClose == null )
            {
                Debug.LogError( "The ButtonClose has not assigned.", this );
                return;
            }

            //
            if( m_ButtonLighting == null )
            {
                Debug.LogError( "The ButtonLighting has not assigned.", this );
                return;
            }

            //
            m_Menu = this.GetComponent<Menu>();

            //
            if( m_Menu == null )
            {
                Debug.LogError( "This GameObject has not assigned Component:'Menu'.", this );
                return;
            }

            //
            m_Menu.OnOpen += this.OnMenuOpen;
            m_Menu.OnOpened += this.OnMenuOpened;

            //
            if( m_OrbitCamera == null )
                m_OrbitCamera = Camera.main.GetComponent<OrbitCamera>();

            //
            if( m_OrbitCamera == null )
            {
                Debug.LogError( "The OrbitCamera has not assigned.", this );
                return;
            }

            //
            StartCoroutine( DelayInit() );
        }
コード例 #13
0
ファイル: OutDoor.cs プロジェクト: ShipuW/unity-study
        //
        private void OnMenuOpened( Menu menu )
        {
            //
            if( !m_bInit )
                return;

            //
            //m_AlertWelcome.Show( 1.0f );

            //
            CKinect.CursorController.Instance.EnableCursor();

            //
            //CKinect.CursorController.Instance.IsLoadingActive = false;

            //
            m_bTweening = false;

            //
            ShowButtons();

            //
            m_bHasWelcome = true;
            m_AlertHintDrag.Show( 1.0f );
            m_fAlertHintLastTime = Time.time;
            CKinect.CursorController.Instance.IsLoadingActive = true;
            m_OrbitCamera.Enable();
            m_fAlertHintDragLastTime = Time.time;
        }
コード例 #14
0
ファイル: OutDoor.cs プロジェクト: ShipuW/unity-study
        //
        private void OnMenuOpen( Menu menu )
        {
            //
            if( !m_bInit )
                return;

            //
            m_bTweening = true;

            //
            m_bOnIndicatorHoverOver = false;

            //
            m_bHasWelcome = false;

            //
            m_bHasHintDrag = false;

            //
            HideButtons();
        }
コード例 #15
0
ファイル: Menu6.cs プロジェクト: ShipuW/unity-study
        // Use this for initialization
        private void Start()
        {
            //
            //
            m_Menu = this.GetComponent<Menu>();

            //
            if( m_Menu == null )
            {
                Debug.LogError( "This GameObject has not assigned Component:'Menu'.", this );
                return;
            }

            //
            m_Menu.OnOpen += this.OnMenuOpen;
            m_Menu.OnOpened += this.OnMenuOpened;

            //
            if( m_ParentItems == null )
            {
                Debug.LogError("The 'ParentItems' has not assigned!");
                return;
            }

            m_UIToggleItems = m_ParentItems.GetComponentsInChildren<UIToggle>();

            if( m_UIToggleItems == null || m_UIToggleItems.Length <= 0 )
            {
                Debug.LogError("Can't find Components 'UIToggle' in " + m_ParentItems.name);
                return;
            }

            foreach( UIToggle toggle in m_UIToggleItems )
            {
                toggle.group = m_ItemGroupID;
                EventDelegate.Add( toggle.onChange, OnToggleChanged );
            }

            //
            if( m_UITextureTarget == null )
            {
                Debug.LogError("The 'UITextureTarget' has not assigned!");
                return;
            }

            //
            if( m_UITextureMask == null )
            {
                Debug.LogError("The 'UITextureMask' has not assigned!");
                return;
            }

            //
            if( m_DefaultTexture == null )
            {
                Debug.LogError("The 'DefaultTexture' has not assigned!");
                return;
            }

            //
            UIEventListener listener = UIEventListener.Get( m_UITextureTarget.gameObject );
            listener.onClick = this.OnMainTextureClick;

            //
            StartCoroutine( DelayInit() );
        }
コード例 #16
0
ファイル: Menu6.cs プロジェクト: ShipuW/unity-study
        //
        private void OnMenuOpen( Menu menu )
        {
            //
            if( !m_bInit )
                return;
            //
            m_AlertWelcome.Show( 1.0f );

            //
            m_bTweening = true;

            //
            BetterList<UIToggle> list = UIToggle.list;

            //UIToggle toggle = UIToggle.GetActiveToggle(1);

            //
            for( int i = 0; i < list.size; ++i )
            {
                UIToggle toggle = list[i];
                if (toggle != null && toggle.group == m_ItemGroupID )
                {
                    toggle.Set(false);
                }
            }

            //
            m_UITextureTarget.mainTexture = m_DefaultTexture;

            //
            if( m_bMainTextureZoom )
            {
                //
                TweenTransform tt = m_UITextureTarget.GetComponent<TweenTransform>();
                tt.PlayReverse();
                tt = m_UITextureMask.GetComponent<TweenTransform>();
                tt.PlayReverse();
                //
                m_bMainTextureZoom = false;
            }
        }