High









How do I use High
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: PhotonEditor.cs Copy
543     protected virtual void OnGuiMainWizard()
544     {
545         GUILayout.BeginHorizontal();
546         GUILayout.FlexibleSpace();
547         GUILayout.Label(WizardIcon);
548         GUILayout.FlexibleSpace();
549         GUILayout.EndHorizontal();
550
551         EditorGUILayout.Separator();
552
553         GUILayout.Label(CurrentLang.PUNWizardLabel, EditorStyles.boldLabel);
554         if (isPunPlus)
555         {
556             GUILayout.Label(CurrentLang.MobilePunPlusExportNoteLabel);
557         }
558         else if (!InternalEditorUtility.HasAdvancedLicenseOnBuildTarget(BuildTarget.Android) || !InternalEditorUtility.HasAdvancedLicenseOnBuildTarget(BuildTarget.iOS))
559         {
560             GUILayout.Label(CurrentLang.MobileExportNoteLabel);
561         }
562         EditorGUILayout.Separator();
563
564
565         // settings button
566         GUILayout.BeginHorizontal();
567         GUILayout.Label(CurrentLang.SettingsButton, EditorStyles.boldLabel, GUILayout.Width(100));
568         if (GUILayout.Button(new GUIContent(CurrentLang.SetupButton, CurrentLang.SetupServerCloudLabel)))
569         {
570             this.InitPhotonSetupWindow();
571         }
572
573         GUILayout.EndHorizontal();
574         EditorGUILayout.Separator();
575
576
577         // find / select settings asset
578         GUILayout.BeginHorizontal();
579         GUILayout.Label(CurrentLang.SettingsFileLabel, EditorStyles.boldLabel, GUILayout.Width(100));
580         if (GUILayout.Button(new GUIContent(CurrentLang.LocateSettingsButton, CurrentLang.SettingsHighlightLabel)))
581         {
582             EditorGUIUtility.PingObject(PhotonEditor.Current);
583         }
584
585         GUILayout.EndHorizontal();
586
587
588         GUILayout.FlexibleSpace();
589
590         // converter
591         GUILayout.BeginHorizontal();
592         GUILayout.Label(CurrentLang.ConverterLabel, EditorStyles.boldLabel, GUILayout.Width(100));
593         if (GUILayout.Button(new GUIContent(CurrentLang.StartButton, CurrentLang.UNtoPUNLabel)))
594         {
595             PhotonConverter.RunConversion();
596         }
597
598         GUILayout.EndHorizontal();
599         EditorGUILayout.Separator();
600
601
602         // documentation
603         GUILayout.BeginHorizontal();
604         GUILayout.Label(CurrentLang.DocumentationLabel, EditorStyles.boldLabel, GUILayout.Width(100));
605         GUILayout.BeginVertical();
606         if (GUILayout.Button(new GUIContent(CurrentLang.OpenPDFText, CurrentLang.OpenPDFTooltip)))
607         {
608             EditorUtility.OpenWithDefaultApp(DocumentationLocation);
609         }
610
611         if (GUILayout.Button(new GUIContent(CurrentLang.OpenDevNetText, CurrentLang.OpenDevNetTooltip)))
612         {
613             EditorUtility.OpenWithDefaultApp(UrlDevNet);
614         }
615
616         if (GUILayout.Button(new GUIContent(CurrentLang.OpenCloudDashboardText, CurrentLang.OpenCloudDashboardTooltip)))
617         {
618             EditorUtility.OpenWithDefaultApp(UrlCloudDashboard + Uri.EscapeUriString(this.emailAddress));
619         }
620
621         if (GUILayout.Button(new GUIContent(CurrentLang.OpenForumText, CurrentLang.OpenForumTooltip)))
622         {
623             EditorUtility.OpenWithDefaultApp(UrlForum);
624         }
625
626         GUILayout.EndVertical();
627         GUILayout.EndHorizontal();
628     }
File name: PhotonPlayer.cs Copy
241     public PhotonPlayer GetNextFor(int currentPlayerId)
242     {
243         if (PhotonNetwork.networkingPeer == null || PhotonNetwork.networkingPeer.mActors == null || PhotonNetwork.networkingPeer.mActors.Count < 2)
244         {
245             return null;
246         }
247
248         Dictionary players = PhotonNetwork.networkingPeer.mActors;
249         int nextHigherId = int.MaxValue; // we look for the next higher ID
250         int lowestId = currentPlayerId; // if we are the player with the highest ID, there is no higher and we return to the lowest player's id
251
252         foreach (int playerid in players.Keys)
253         {
254             if (playerid < lowestId)
255             {
256                 lowestId = playerid; // less than any other ID (which must be at least less than this player's id).
257             }
258             else if (playerid > currentPlayerId && playerid < nextHigherId)
259             {
260                 nextHigherId = playerid; // more than our ID and less than those found so far.
261             }
262         }
263
264         //UnityEngine.Debug.LogWarning("Debug. " + currentPlayerId + " lower: " + lowestId + " higher: " + nextHigherId + " ");
265         //UnityEngine.Debug.LogWarning(this.RoomReference.GetPlayer(currentPlayerId));
266         //UnityEngine.Debug.LogWarning(this.RoomReference.GetPlayer(lowestId));
267         //if (nextHigherId != int.MaxValue) UnityEngine.Debug.LogWarning(this.RoomReference.GetPlayer(nextHigherId));
268         return (nextHigherId != int.MaxValue) ? players[nextHigherId] : players[lowestId];
269     }
File name: Node.cs Copy
35  public void HighlightMove() {
36   if (renderer.sharedMaterial != origMaterial) return;
37   SetMaterial(GameManager.Instance.HighlightMoveMaterial);
38  }
File name: Node.cs Copy
40  public void HighlightEat() {
41   if (renderer.sharedMaterial != origMaterial) return;
42   SetMaterial(GameManager.Instance.HighlightEatMaterial);
43  }
File name: Node.cs Copy
45  public void HighlightCheck() {
46   if (renderer.sharedMaterial != origMaterial) return;
47   SetMaterial(GameManager.Instance.HighlightCheckMaterial);
48  }
File name: Node.cs Copy
50  public void UnhighlightMove() {
51   Unhiglight(GameManager.Instance.HighlightMoveMaterial);
52  }
File name: Node.cs Copy
54  public void UnhighlightEat() {
55   Unhiglight(GameManager.Instance.HighlightEatMaterial);
56  }
File name: Node.cs Copy
58  public void UnhighlightCheck() {
59   Unhiglight(GameManager.Instance.HighlightCheckMaterial);
60  }
File name: GameManager.cs Copy
70  public Material HighlightCheckMaterial {
71   get {return highlightCheckMaterial;}
72  }
File name: GameManager.cs Copy
74  public Material HighlightEatMaterial {
75   get {return highlightEatMaterial;}
76  }

Download file with original file name:High

High 119 lượt xem

Gõ tìm kiếm nhanh...