예제 #1
0
    // Update is called once per frame
    void Update()
    {
        if (input.GetKeyDown(KeyCode.LeftArrow))
        {
            int recordCount = recoder.GetRecordCount();
            RestoredRecordIndex = (RestoredRecordIndex + recordCount - 1) % recordCount;

            Invalidate();
        }
        else if (input.GetKeyDown(KeyCode.RightArrow))
        {
            int recordCount = recoder.GetRecordCount();
            RestoredRecordIndex = (RestoredRecordIndex + 1) % recordCount;

            Invalidate();
        }
    }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        // ダメージエフェクト中はUpdate関数での更新はしない
        if (isInDamageAnimation)
        {
            return;
        }

        Vector3 pos = transform.position;


        //移動の処理(左回転)
        if (input.GetKeyDown(KeyCode.RightArrow))
        {
            GetComponent <AudioSource>().Play();

            if (pos.x == -range)
            {
                if (pos.y != -range)
                {
                    transform.position += new Vector3(0, -range, 0);
                }
                else
                {
                    transform.position += new Vector3(range, 0, 0);
                }
            }
            else if (pos.x == 0)
            {
                if (pos.y == range)
                {
                    transform.position += new Vector3(-range, 0, 0);
                }
                else
                {
                    transform.position += new Vector3(range, 0, 0);
                }
            }
            else if (pos.x == range)
            {
                if (pos.y != range)
                {
                    transform.position += new Vector3(0, range, 0);
                }
                else
                {
                    transform.position += new Vector3(-range, 0, 0);
                }
            }
        }
        //移動(右回転)
        else if (input.GetKeyDown(KeyCode.LeftArrow))
        {
            GetComponent <AudioSource>().Play();
            if (pos.x == range)
            {
                if (pos.y != -range)
                {
                    transform.position += new Vector3(0, -range, 0);
                }
                else
                {
                    transform.position += new Vector3(-range, 0, 0);
                }
            }
            else if (pos.x == 0)
            {
                if (pos.y == range)
                {
                    transform.position += new Vector3(range, 0, 0);
                }
                else
                {
                    transform.position += new Vector3(-range, 0, 0);
                }
            }
            if (pos.x == -range)
            {
                if (pos.y == range)
                {
                    transform.position += new Vector3(range, 0, 0);
                }
                else
                {
                    transform.position += new Vector3(0, range, 0);
                }
            }
        }


        //テクスチャの処理
        if (pos.y == -range)
        {
            BottomTexture(pos.x);
        }
        else if (pos.y == 0)
        {
            MiddleTexture(pos.x);
        }
        else
        {
            TopTexture(pos.x);
        }
    }