// Clicked(UIButton から呼び出される)
        internal protected void OnClicked(bool tWaitForTransition)
        {
            if (m_State != State.Clicked && m_State != State.Finished)
            {
                m_WaitForTransition = tWaitForTransition;
                if (m_WaitForTransition == true)
                {
//					Debug.LogWarning( "------- クリックされたのでクリック後のトランジション発動" ) ;
                    UIEventSystem.Disable(31);
                }

                // 押されたボタンを同階層で最も手前に表示する
                if (transform.parent != null)
                {
                    UIView tParent = transform.parent.GetComponent <UIView>();
                    if (tParent != null)
                    {
                        Vector3 p = transform.localPosition;
                        p.z = 10;
                        transform.localPosition = p;
                        tParent.SortChildByZ();
                    }
                }

                ChangeTransitionState(State.Clicked, State.Clicked);
                m_Press = false;
            }
        }
Exemple #2
0
        //-------------------------------------------------------------------
        // トランジジョンの状態を変える
        private bool ChangeTransitionState(State tState, State tEaseState)
        {
            if (m_State == tState)
            {
                // 状態が同じなので処理しない
                return(true);
            }

            // 現在の RectTransform の状態を退避する

            if (m_RectTransform == null)
            {
                m_RectTransform = GetComponent <RectTransform>();
            }
            if (m_RectTransform == null)
            {
                // RectTransform がアタッチされていない
                return(false);
            }


            // 現在変化中の状態を変化前の状態とする
            //		m_BasePosition	= m_MovePosition ;
            m_BaseRotation = m_MoveRotation;
            m_BaseScale    = m_MoveScale;

            m_State      = tState;
            m_EaseState  = tEaseState;
            m_BaseTime   = Time.realtimeSinceStartup;
            m_Processing = true;

            if (spriteOverwriteEnabled == true)
            {
                UIImage tImage = GetComponent <UIImage>();
                if (tImage != null && tImage.atlasSprite != null)
                {
                    // 画像を変更する

                    Transition tData = transition[( int )m_State];

                    if (tData.sprite != null)
                    {
                        tImage.SetSpriteInAtlas(tData.sprite.name);
                    }
                }
            }

            if (m_State == State.Clicked)
            {
                UIEventSystem.Disable(31);
            }

            return(true);
        }