-
Notifications
You must be signed in to change notification settings - Fork 1
/
dropdown.cs
47 lines (35 loc) · 1019 Bytes
/
dropdown.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
public class dropdown : MonoBehaviour
{
List<string> ans = new List<string>() { "初始狀態", "上層十字","上層角塊","中層邊塊","下層十字","下層角塊" };
public Dropdown drop;
// Use this for initialization
void Start()
{ drop.ClearOptions();
popliatelist();
}
// Update is called once per frame
void Update()
{
}
public void setans_mode(int index)
{
Debug.Log(index);
GameObject targetObject;
object[] msgArrCS = new object[1];
msgArrCS[0] = index;
targetObject = GameObject.Find("MagicCube");
targetObject.SendMessage("set_anscount", msgArrCS);
}
void popliatelist()
{
drop.AddOptions(ans);
}
void Refresh()
{
drop.ClearOptions();
}
}