Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        if( m_BtnMore == null )
        {
            Debug.LogError("The 'BtnMore' has not assigle!" ,this);
            return;
        }

        if( m_BtnClose == null )
        {
            Debug.LogError("The 'BtnClose' has not assigle!" ,this);
            return;
        }

        if( m_MoreWidget == null )
        {
            Debug.LogError("The 'MoreWidget' has not assigle!" ,this);
            return;
        }

        //
        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;
        }

        //
        m_GridItems = m_GridApartmentLayout.GetComponentsInChildren<MainScene.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;
        }

        AddListenner();

        m_MoreWidget.gameObject.SetActive(false);

        m_bInited = true;
    }
Exemplo n.º 2
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() );
        }