teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

A

2017/09/19 17:13

投稿

BitCoin
BitCoin

スコア53

title CHANGED
File without changes
body CHANGED
@@ -25,11 +25,7 @@
25
25
  using System;
26
26
  using System.Collections.Generic;
27
27
  public class ScrollButton : MonoBehaviour {
28
- [SerializeField]
28
+
29
- private GameObject btnPref; //ボタンプレハブ
30
- //ボタン表示数
31
- const int BUTTON_COUNT = 7;
32
-
33
29
  public string[] DayOftheWeek = new string[60] ;
34
30
 
35
31
  public List<string> Listdow = new List<string>();
@@ -37,10 +33,9 @@
37
33
  System.DateTime nowDT = System.DateTime.Now;
38
34
 
39
35
  [SerializeField]
40
- public RectTransform content;
36
+
41
37
 
42
38
 
43
-
44
39
  void Start ()
45
40
  {
46
41
 
@@ -51,16 +46,10 @@
51
46
  switch (dow)
52
47
  {
53
48
  case "Sunday":
54
- for (int i = 6; i > 12; i++) {
49
+
55
-
56
- DayOftheWeek[i] = PlayerPrefs.GetString ("key_id"+i);
57
- }
58
50
  break;
59
51
  case "Monday":
60
- for (int i = 12; i > 18; i++) {
52
+
61
-
62
- DayOftheWeek[i] = PlayerPrefs.GetString ("key_id"+i);
63
- }
64
53
  break;
65
54
  case "Tuesday":
66
55
  Debug.Log("");
@@ -96,34 +85,7 @@
96
85
  break;
97
86
  }
98
87
 
99
- for (int i = 1; i < BUTTON_COUNT; i++)
100
- {
101
- int no = i;
102
- //ボタン生成
103
- GameObject btn = (GameObject)Instantiate(btnPref);
104
- //ボタンをContentの子に設定
105
- btn.transform.SetParent(content, false);
106
- //ボタンのテキスト変更
107
- btn.GetComponentInChildren<Text>().text = no+"限";
108
88
 
109
-
110
-
111
- //btn.transform.Find("Text1").GetComponent<Text>().text = Listdow[i-1];
112
- Listdow.Add(PlayerPrefs.GetString("key_id1"));
113
- //Debug.Log ("ZZX"+Listdow[2]);
114
-
115
- Debug.Log ("XXXX"+DayOftheWeek[0]);
116
-
117
- Debug.Log ("XYXY"+PlayerPrefs.GetString("key_id1"));
118
- //ボタンのクリックイベント登録
119
- btn.GetComponent<Button>().onClick.AddListener(() => OnClick(no));
120
- }
121
- }
122
- public void OnClick(int no)
123
- {
124
- Debug.Log(no);
125
- }
126
-
127
89
  public void loop(){
128
90
 
129
91
  for (int i = 0; i > 25; i++) {

1

A

2017/09/19 17:13

投稿

BitCoin
BitCoin

スコア53

title CHANGED
File without changes
body CHANGED
@@ -65,6 +65,9 @@
65
65
  case "Tuesday":
66
66
  Debug.Log("");
67
67
  break;
68
+
69
+
70
+ /////////////////////ここです!////////////////////////////
68
71
  case "Wednesday":
69
72
  Debug.Log ("XRR");
70
73
  Debug.Log ("XRR");
@@ -76,6 +79,8 @@
76
79
  }
77
80
  Debug.Log("");
78
81
  break;
82
+
83
+ ////////////////////////////////////////////////////////////////////
79
84
  case "Thursday":
80
85
  Debug.Log("The color is blue");
81
86
  break;