画像のところでPushButtonleftが選択できるようになるはずなのですが、候補に出て来ません、改善点などお教えして頂けると幸いです。質問があれば何でもお答えします。
C#
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4 5public class GameManager : MonoBehaviour 6{ 7 public const int WALL_FRONT = 1; 8 public const int WALL_RIGHT = 2; 9 public const int WALL_BACK = 3; 10 public const int WALL_LEFT = 4; 11 12 public GameObject panelWalls; 13 14 private int wallNO; 15 // Start is called before the first frame update 16 void Start() 17 { 18 wallNO = WALL_FRONT; 19 } 20 21 // Update is called once per frame 22 void Update() 23 { 24 public void PushButtonRight() 25 { 26 wallNO++; 27 28 if (wallNO > WALL_LEFT) 29 { 30 wallNO = WALL_FRONT; 31 } 32 DisplayWall(); 33 } 34 public void PushButtonLeft() 35 { 36 wallNO--; 37 38 if (wallNO > WALL_FRONT) 39 { 40 wallNO = WALL_LEFT; 41 } 42 DisplayWall(); 43 } 44 void DisplayWall() 45 { 46 switch (wallNO) 47 { 48 case WALL_FRONT: 49 panelWalls.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f); 50 break; 51 52 case WALL_RIGHT: 53 panelWalls.transform.localPosition = new Vector3(-1000.0f, 0.0f, 0.0f); 54 break; 55 56 case WALL_BACK: 57 panelWalls.transform.localPosition = new Vector3(-2000.0f, 0.0f, 0.0f); 58 break; 59 60 case WALL_LEFT: 61 panelWalls.transform.localPosition = new Vector3(-3000.0f, 0.0f, 0.0f); 62 break; 63 } 64 } 65 } 66} 67
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/04/08 13:14
2019/04/09 02:57