示例#1
0
    // 入れた矢印の向きに応じて「コライダーを表示」、「矢印のテクスチャを取得」、「移動後の位置を取得」するメソッド
    void SetUpdateTexture()
    {
        if (MainTexture == RightTexture && !Right)
        {
            ColSwitchOff();
            RightCol.SetActive(true);
            UpdateMaterial.GetComponent <Renderer>().material = PlayerMaterial.GetComponent <Renderer>().material;
            return;
        }

        if (MainTexture == LeftTexture && !Left)
        {
            ColSwitchOff();
            LeftCol.SetActive(true);
            UpdateMaterial.GetComponent <Renderer>().material = PlayerMaterial.GetComponent <Renderer>().material;
            return;
        }

        if (MainTexture == UpTexture && !Up)
        {
            ColSwitchOff();
            UpCol.SetActive(true);
            UpdateMaterial.GetComponent <Renderer>().material = PlayerMaterial.GetComponent <Renderer>().material;
            return;
        }

        if (MainTexture == DownTexture && !Down)
        {
            ColSwitchOff();
            DownCol.SetActive(true);
            UpdateMaterial.GetComponent <Renderer>().material = PlayerMaterial.GetComponent <Renderer>().material;
            return;
        }
    }
示例#2
0
    void SetUpdateTexture()
    {
        if (MainTexture == RightTexture && !Right)
        {
            ColSwitchOff();
            RightCol.SetActive(true);
            RotateModel.transform.rotation = Quaternion.Euler(0f, 0f, 0f);
            UpdateMaterial.GetComponent <Renderer>().material = PlayerMaterial.GetComponent <Renderer>().material;
            return;
        }

        if (MainTexture == LeftTexture && !Left)
        {
            ColSwitchOff();
            LeftCol.SetActive(true);
            RotateModel.transform.rotation = Quaternion.Euler(0f, 180f, 0f);
            UpdateMaterial.GetComponent <Renderer>().material = PlayerMaterial.GetComponent <Renderer>().material;
            return;
        }

        if (MainTexture == UpTexture && !Up)
        {
            ColSwitchOff();
            UpCol.SetActive(true);
            RotateModel.transform.rotation = Quaternion.Euler(0f, 270f, 0f);
            UpdateMaterial.GetComponent <Renderer>().material = PlayerMaterial.GetComponent <Renderer>().material;
            return;
        }

        if (MainTexture == DownTexture && !Down)
        {
            ColSwitchOff();
            DownCol.SetActive(true);
            RotateModel.transform.rotation = Quaternion.Euler(0f, 90f, 0f);
            UpdateMaterial.GetComponent <Renderer>().material = PlayerMaterial.GetComponent <Renderer>().material;
            return;
        }
    }