Beispiel #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;
        }
    }
Beispiel #2
0
 void ColSwitchOff()
 {
     DownCol.SetActive(false);
     RightCol.SetActive(false);
     LeftCol.SetActive(false);
     UpCol.SetActive(false);
 }
Beispiel #3
0
 // コライダーの初期化メソッド
 void colInit()
 {
     RightCol.SetActive(false);
     LeftCol.SetActive(false);
     UpCol.SetActive(false);
     DownCol.SetActive(false);
 }
Beispiel #4
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;
        }
    }