GetValues
How do I use Get Values
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
File name: frmKetQua.cs
Copy
18 public frmKetQua(string strten, string strma, string strdiem, string strsocaudung)
19 {
20 string strCon = "server=.\\SQLEXPRESS;database=QL_Thitracnghiem;integrated security=true";
21 ObjCon = new SqlConnection(strCon);
22 ObjCon.Open();
23 InitializeComponent();
24
25
26 getvalueformdienten = strten;//ten
27 getvalueformdienma = strma;//ma thi sinh
28 getvaluediem = strdiem;//diem
29 getvaluesocaudung = strsocaudung;//so cau dung
30 socausai = 50 - int.Parse(strsocaudung);//so cau sai
31 lbsocausai.Text = socausai.ToString();
32 }
File name: PhotonEditor.cs
Copy
215 static PhotonEditor()
216 {
217 EditorApplication.projectWindowChanged += EditorUpdate;
218 EditorApplication.hierarchyWindowChanged += EditorUpdate;
219 EditorApplication.playmodeStateChanged += PlaymodeStateChanged;
220 EditorApplication.update += OnUpdate;
221
222 WizardIcon = AssetDatabase.LoadAssetAtPath("Assets/Photon Unity Networking/photoncloud-icon.png", typeof(Texture2D)) as Texture2D;
223
224 // to be used in toolbar, the enum needs conversion to string[] being done here, once.
225 Array enumValues = Enum.GetValues(typeof(CloudRegionCode));
226 CloudServerRegionNames = new string[enumValues.Length];
227 for (int i = 0; i < CloudServerRegionNames.Length; i++)
228 {
229 CloudServerRegionNames[i] = enumValues.GetValue(i).ToString();
230 if (CloudServerRegionNames[i].Equals("none"))
231 {
232 CloudServerRegionNames[i] = PhotonEditor.CurrentLang.BestRegionLabel;
233 }
234 }
235
236 // detect optional packages
237 PhotonEditor.CheckPunPlus();
238
239 }
File name: PunTeams.cs
Copy
30 public void Start()
31 {
32 PlayersPerTeam = new Dictionary
33 Array enumVals = Enum.GetValues(typeof (Team));
34 foreach (var enumVal in enumVals)
35 {
36 PlayersPerTeam[(Team)enumVal] = new List
37 }
38 }
File name: PunTeams.cs
Copy
59 public void UpdateTeams()
60 {
61 Array enumVals = Enum.GetValues(typeof(Team));
62 foreach (var enumVal in enumVals)
63 {
64 PlayersPerTeam[(Team)enumVal].Clear();
65 }
66
67 for (int i = 0; i < PhotonNetwork.playerList.Length; i++)
68 {
69 PhotonPlayer player = PhotonNetwork.playerList[i];
70 Team playerTeam = player.GetTeam();
71 PlayersPerTeam[playerTeam].Add(player);
72 }
73 }
File name: AnimationTestScriptInspector.cs
Copy
9 public override void OnInspectorGUI()
10 {
11 AnimationTestScript myTarget = (AnimationTestScript)target;
12
13 EditorGUILayout.LabelField("Set a trigger:");
14
15 foreach (AnimationTestScript.TriggerType trigger in Enum.GetValues(typeof(AnimationTestScript.TriggerType)))
16 {
17 if (GUILayout.Button(trigger.ToString()))
18 {
19 myTarget.SetTrigger(trigger);
20 }
21 }
22
23 EditorGUILayout.Space();
24 myTarget.Speed = EditorGUILayout.Slider("Movement Speed", myTarget.Speed, 0, 10);
25 }
GetValues 131 lượt xem
Gõ tìm kiếm nhanh...