Full









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

Featured Snippets


File name: crBaoCao.cs Copy
42         public override string FullResourceName {
43             get {
44                 return "QuanLyDiem.crBaoCao.rpt";
45             }
46             set {
47                 // Do nothing
48             }
49         }
File name: rptThisinh.cs Copy
42         public override string FullResourceName {
43             get {
44                 return "Doan.rptThisinh.rpt";
45             }
46             set {
47                 // Do nothing
48             }
49         }
File name: ChatGui.cs Copy
58     public void Start()
59     {
60         DontDestroyOnLoad(this.gameObject);
61         Application.runInBackground = true; // this must run in background or it will drop connection if not focussed.
62
63         if (string.IsNullOrEmpty(this.UserName))
64         {
65             this.UserName = "user" + Environment.TickCount%99; //made-up username
66         }
67
68         chatClient = new ChatClient(this);
69         chatClient.Connect(ChatAppId, "1.0", this.UserName, null);
70
71         if (this.AlignBottom)
72         {
73             this.GuiRect.y = Screen.height - this.GuiRect.height;
74         }
75         if (this.FullScreen)
76         {
77             this.GuiRect.x = 0;
78             this.GuiRect.y = 0;
79             this.GuiRect.width = Screen.width;
80             this.GuiRect.height = Screen.height;
81         }
82
83         Debug.Log(this.UserName);
84     }
File name: PickupDemoGui.cs Copy
15     public void OnGUI()
16     {
17         if (!PhotonNetwork.inRoom)
18         {
19             return;
20         }
21
22
23         if (this.ShowScores)
24         {
25             GUILayout.Label("Your Score: " + PhotonNetwork.player.GetScore());
26         }
27
28
29         if (this.ShowDropButton)
30         {
31             foreach (PickupItem item in PickupItem.DisabledPickupItems)
32             {
33                 if (item.PickupIsMine && item.SecondsBeforeRespawn <= 0)
34                 {
35                     if (GUILayout.Button("Drop " + item.name))
36                     {
37                         item.Drop(); // drops the item at the place where it originates
38                     }
39
40                     GameObject playerCharGo = PhotonNetwork.player.TagObject as GameObject;
41                     if (playerCharGo != null && GUILayout.Button("Drop here " + item.name))
42                     {
43                         // drop the item at some other place. next to the user's character would be fine...
44                         Vector3 random = Random.insideUnitSphere;
45                         random.y = 0;
46                         random = random.normalized;
47                         Vector3 itempos = playerCharGo.transform.position + this.DropOffset * random;
48
49                         item.Drop(itempos);
50                     }
51                 }
52             }
53         }
54
55
56         if (this.ShowTeams)
57         {
58             foreach (var teamName in PunTeams.PlayersPerTeam.Keys)
59             {
60                 GUILayout.Label("Team: " + teamName.ToString());
61                 List teamPlayers = PunTeams.PlayersPerTeam[teamName];
62                 foreach (PhotonPlayer player in teamPlayers)
63                 {
64                     GUILayout.Label(" " + player.ToStringFull() + " Score: " + player.GetScore());
65                 }
66             }
67
68             if (GUILayout.Button("to red"))
69             {
70                 PhotonNetwork.player.SetTeam(PunTeams.Team.red);
71             }
72             if (GUILayout.Button("to blue"))
73             {
74                 PhotonNetwork.player.SetTeam(PunTeams.Team.blue);
75             }
76         }
77     }
File name: WorkerInGame.cs Copy
26     public void OnGUI()
27     {
28         if (GUILayout.Button("Return to Lobby"))
29         {
30             PhotonNetwork.LeaveRoom(); // we will load the menu level when we successfully left the room
31         }
32     }
File name: WorkerMenu.cs Copy
212     public void OnPhotonJoinRoomFailed()
213     {
214         this.ErrorDialog = "Error: Can't join room (full or unknown room name).";
215         Debug.Log("OnPhotonJoinRoomFailed got called. This can happen if the room is not existing or full or closed.");
216     }
File name: WorkerMenu.cs Copy
217     public void OnPhotonRandomJoinFailed()
218     {
219         this.ErrorDialog = "Error: Can't join random room (none found).";
220         Debug.Log("OnPhotonRandomJoinFailed got called. Happens if no room is available (or all full or invisible or closed). JoinrRandom filter-options can limit available rooms.");
221     }
File name: PhotonEditor.cs Copy
909     public static void UpdateRpcList()
910     {
911         List additionalRpcs = new List();
912         HashSet currentRpcs = new HashSet();
913
914         var types = GetAllSubTypesInScripts(typeof(MonoBehaviour));
915
916         foreach (var mono in types)
917         {
918             MethodInfo[] methods = mono.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
919
920             foreach (MethodInfo method in methods)
921             {
922                 if (method.IsDefined(typeof(UnityEngine.RPC), false))
923                 {
924                     currentRpcs.Add(method.Name);
925
926                     if (!additionalRpcs.Contains(method.Name) && !PhotonEditor.Current.RpcList.Contains(method.Name))
927                     {
928                         additionalRpcs.Add(method.Name);
929                     }
930                 }
931             }
932         }
933
934         if (additionalRpcs.Count > 0)
935         {
936             // LIMITS RPC COUNT
937             if (additionalRpcs.Count + PhotonEditor.Current.RpcList.Count >= byte.MaxValue)
938             {
939                 if (currentRpcs.Count <= byte.MaxValue)
940                 {
941                     bool clearList = EditorUtility.DisplayDialog(CurrentLang.IncorrectRPCListTitle, CurrentLang.IncorrectRPCListLabel, CurrentLang.RemoveOutdatedRPCsLabel, CurrentLang.CancelButton);
942                     if (clearList)
943                     {
944                         PhotonEditor.Current.RpcList.Clear();
945                         PhotonEditor.Current.RpcList.AddRange(currentRpcs);
946                     }
947                     else
948                     {
949                         return;
950                     }
951                 }
952                 else
953                 {
954                     EditorUtility.DisplayDialog(CurrentLang.FullRPCListTitle, CurrentLang.FullRPCListLabel, CurrentLang.SkipRPCListUpdateLabel);
955                     return;
956                 }
957             }
958
959             additionalRpcs.Sort();
960             PhotonEditor.Current.RpcList.AddRange(additionalRpcs);
961             EditorUtility.SetDirty(PhotonEditor.Current);
962         }
963     }
File name: PhotonEditor.cs Copy
975     public static System.Type[] GetAllSubTypesInScripts(System.Type aBaseClass)
976     {
977         var result = new System.Collections.Generic.List();
978         System.Reflection.Assembly[] AS = System.AppDomain.CurrentDomain.GetAssemblies();
979         foreach (var A in AS)
980         {
981             // this skips all but the Unity-scripted assemblies for RPC-list creation. You could remove this to search all assemblies in project
982             if (!A.FullName.StartsWith("Assembly-"))
983             {
984                 // Debug.Log("Skipping Assembly: " + A);
985                 continue;
986             }
987
988             //Debug.Log("Assembly: " + A.FullName);
989             System.Type[] types = A.GetTypes();
990             foreach (var T in types)
991             {
992                 if (T.IsSubclassOf(aBaseClass))
993                     result.Add(T);
994             }
995         }
996         return result.ToArray();
997     }
File name: Extensions.cs Copy
105     public static string ToStringFull(this IDictionary origin)
106     {
107         return SupportClass.DictionaryToString(origin, false);
108     }

Download file with original file name:Full

Full 139 lượt xem

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