コード例 #1
0
    private void setUpdateSlide()
    {
        if (IsTouch)
        {
            Vector2 touchPos = TouchInterface.GetTouchPosition();
            //calculate last touch
            ItemMoveMent    += (touchPos.x - lastTouch.x) * (Sensitive / 10.0f);
            MoveSpeed        = (touchPos.x - lastTouch.x) * (Sensitive / 10.0f) / (Time.deltaTime);
            currentMoveSpeed = MoveSpeed;
            if (ItemMoveMent < -0.344f)
            {
                ItemMoveMent = -0.344f;
            }
            if (ItemMoveMent > 0.35f)
            {
                ItemMoveMent = 0.35f;
            }
            lastTouch = touchPos;
            SnappingMorph.morphEasein(ItemMoveMent, ItemMoveMent + currentMoveSpeed, Mathf.Abs(MoveSpeed) / 10.0f + Smooth * 30.0f);
            //if(currentMoveSpeed!=0){
            //	IsDrag = true;
            //}
            //move all item

            if (BTON == 1)
            {
                if (ItemMoveMent <= 0.0f)
                {
                    Sound.transform.localPosition = new Vector3(-0.344f, 0, 0);
                }
                else
                {
                    Sound.transform.localPosition = new Vector3(0.35f, 0, 0);
                }
            }
            else if (BTON == 2)
            {
                if (ItemMoveMent <= 0.0f)
                {
                    Tel.transform.localPosition = new Vector3(-0.344f, 0, 0);
                    TelOn = false;
                }
                else
                {
                    Tel.transform.localPosition = new Vector3(0.35f, 0, 0);
                    TelOn = true;
                }
            }
            else if (BTON == 3)
            {
                if (ItemMoveMent <= 0.0f)
                {
                    Lat.transform.localPosition = new Vector3(-0.344f, 0, 0);
                    LatOn = false;
                }
                else
                {
                    Lat.transform.localPosition = new Vector3(0.35f, 0, 0);
                    LatOn = true;
                }
            }
        }
        else
        {
            if (Sound.transform.localPosition.x <= 0.0f)
            {
                Sound.transform.localPosition = new Vector3(-0.344f, 0, 0);
                AudioListener.volume          = 0.0f;
                UserCommonData.SetSound(false);
                SoundOn = false;
            }
            else
            {
                Sound.transform.localPosition = new Vector3(0.35f, 0, 0);
                AudioListener.volume          = 1.0f;
                UserCommonData.SetSound(true);
                SoundOn = true;
            }

            if (Tel.transform.localPosition.x <= 0.0f)
            {
                Tel.transform.localPosition = new Vector3(-0.344f, 0, 0);
                UserCommonData.SetPhone(false);
                TelOn = false;
            }
            else
            {
                Tel.transform.localPosition = new Vector3(0.35f, 0, 0);
                UserCommonData.SetPhone(true);
                TelOn = true;
            }

            if (Lat.transform.localPosition.x <= 0.0f)
            {
                Lat.transform.localPosition = new Vector3(-0.344f, 0, 0);
                UserCommonData.SetGPS(false);
                LatOn = false;
            }
            else
            {
                Lat.transform.localPosition = new Vector3(0.35f, 0, 0);
                UserCommonData.SetGPS(true);
                LatOn = true;
            }
        }
    }