Create
How do I use Create
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
File name: crBaoCao.cs
Copy
139 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
140 crBaoCao rpt = new crBaoCao();
141 rpt.Site = this.Site;
142 return rpt;
143 }
File name: rptThisinh.cs
Copy
131 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
132 rptThisinh rpt = new rptThisinh();
133 rpt.Site = this.Site;
134 return rpt;
135 }
File name: GUIFriendFinding.cs
Copy
52 public void OnGUI()
53 {
54 if (!PhotonNetwork.insideLobby)
55 {
56 // this feature is only available on the Master Client. Check either: insideLobby or
57 // PhotonNetwork.connectionStateDetailed == PeerState.Authenticated or
58 // PhotonNetwork.connectionStateDetailed == PeerState.JoinedLobby
59
60 // for simplicity (and cause we know we WILL join the lobby, we can just check that)
61 return;
62 }
63
64
65 GUILayout.BeginArea(GuiRect);
66
67 GUILayout.Label("Your (random) name: " + PhotonNetwork.playerName);
68 GUILayout.Label("Your friends: " + string.Join(", ",this.friendListOfSomeCommunity));
69
70
71 GUILayout.BeginHorizontal();
72 if (GUILayout.Button("Find Friends"))
73 {
74 PhotonNetwork.FindFriends(this.friendListOfSomeCommunity);
75 }
76 if (GUILayout.Button("Create Room"))
77 {
78 PhotonNetwork.CreateRoom(null); // just a random room
79 }
80 GUILayout.EndHorizontal();
81
82
83 if (PhotonNetwork.Friends != null)
84 {
85 foreach (FriendInfo info in PhotonNetwork.Friends)
86 {
87 GUILayout.BeginHorizontal();
88 GUILayout.Label(info.ToString());
89 if (info.IsInRoom)
90 {
91 if (GUILayout.Button("join"))
92 {
93 PhotonNetwork.JoinRoom(info.Room);
94 }
95 }
96 GUILayout.EndHorizontal();
97 }
98 }
99
100 GUILayout.EndArea();
101 }
File name: HubGui.cs
Copy
28 void OnGUI()
29 {
30 GUI.skin = this.Skin;
31 GUILayout.Space(10);
32
33 GUILayout.BeginHorizontal();
34 GUILayout.Space(10);
35 scrollPos = GUILayout.BeginScrollView(scrollPos, GUILayout.Width(320));
36
37 GUILayout.Label("Basics", m_Headline);
38 if (GUILayout.Button("Demo Boxes", GUILayout.Width(280)))
39 {
40 demoDescription = "
41 demoBtn = new DemoBtn() { Text = "Start", Link = "DemoBoxes-Scene" };
42 }
43 if (GUILayout.Button("Demo Worker", GUILayout.Width(280)))
44 {
45 demoDescription = "
46 demoBtn = new DemoBtn() { Text = "Start", Link = "DemoWorker-Scene" };
47 }
48 if (GUILayout.Button("Movement Smoothing", GUILayout.Width(280)))
49 {
50 demoDescription = "
51 demoBtn = new DemoBtn() { Text = "Start", Link = "DemoSynchronization-Scene" };
52 }
53
54 GUILayout.Label("Advanced", m_Headline);
55 if (GUILayout.Button("Ownership Transfer", GUILayout.Width(280)))
56 {
57 demoDescription = "
58 this.demoBtn = new DemoBtn() { Text = "Start", Link = "DemoChangeOwner-Scene" };
59 this.webLink = new DemoBtn();
60 }
61 if (GUILayout.Button("Pickup, Teams, Scores", GUILayout.Width(280)))
62 {
63 demoDescription = "
64 this.demoBtn = new DemoBtn() { Text = "Start", Link = "DemoPickup-Scene" };
65 this.webLink = new DemoBtn();
66 }
67
68 GUILayout.Label("Feature Demos", m_Headline);
69 if (GUILayout.Button("Chat", GUILayout.Width(280)))
70 {
71 demoDescription = "
72 this.demoBtn = new DemoBtn() { Text = "Start", Link = "DemoChat-Scene" };
73 this.webLink = new DemoBtn();
74 }
75 if (GUILayout.Button("RPG Movement", GUILayout.Width(280)))
76 {
77 demoDescription = "
78 this.demoBtn = new DemoBtn() { Text = "Start", Link = "DemoRPGMovement-Scene" };
79 this.webLink = new DemoBtn();
80 }
81 if (GUILayout.Button("Mecanim Animations", GUILayout.Width(280)))
82 {
83 demoDescription = "
84 this.demoBtn = new DemoBtn() { Text = "Start", Link = "DemoMecanim-Scene" };
85 this.webLink = new DemoBtn();
86 }
87 if (GUILayout.Button("2D Game", GUILayout.Width(280)))
88 {
89 demoDescription = "
90 this.demoBtn = new DemoBtn() { Text = "Start", Link = "Demo2DJumpAndRunWithPhysics-Scene" };
91 this.webLink = new DemoBtn();
92 }
93 if (GUILayout.Button("Friends & Authentication", GUILayout.Width(280)))
94 {
95 demoDescription = "
96 this.demoBtn = new DemoBtn() { Text = "Start", Link = "DemoFriends-Scene" };
97 this.webLink = new DemoBtn();
98 }
99
100 GUILayout.Label("Tutorial", m_Headline);
101 if (GUILayout.Button("Marco Polo Tutorial", GUILayout.Width(280)))
102 {
103 demoDescription = "
104 this.demoBtn = new DemoBtn() { Text = "Start", Link = "MarcoPolo-Scene" };
105 this.webLink = new DemoBtn() { Text = "Open Tutorial (www)", Link = "http://tinyurl.com/nmylf44" };
106 }
107 GUILayout.EndScrollView();
108
109 GUILayout.BeginVertical(GUILayout.Width(Screen.width - 345));
110 GUILayout.Label(demoDescription);
111 GUILayout.Space(10);
112 if (!string.IsNullOrEmpty(this.demoBtn.Text))
113 {
114 if (GUILayout.Button(this.demoBtn.Text))
115 {
116 Application.LoadLevel(this.demoBtn.Link);
117 }
118 }
119 if (!string.IsNullOrEmpty(this.webLink.Text))
120 {
121 if (GUILayout.Button(this.webLink.Text))
122 {
123 Application.OpenURL(this.webLink.Link);
124 }
125 }
126 GUILayout.EndVertical();
127
128
129 GUILayout.EndHorizontal();
130 }
File name: DemoMecanimGUI.cs
Copy
16 private PhotonAnimatorView m_AnimatorView; // local animatorView. set when we create our character in CreatePlayerObject()
17 private Animator m_RemoteAnimator; // to display the synchronized values on the right side in the GUI. A third player will simply be ignored (until the second player leaves)
28 public void Awake()
29 {
30
31 }
File name: DemoMecanimGUI.cs
Copy
187 public override void OnJoinedRoom()
188 {
189 CreatePlayerObject();
190 }
File name: DemoMecanimGUI.cs
Copy
192 private void CreatePlayerObject()
193 {
194 Vector3 position = new Vector3( -2, 0, 0 );
195 position.x += Random.Range( -3f, 3f );
196 position.z += Random.Range( -4f, 4f );
197
198 GameObject newPlayerObject = PhotonNetwork.Instantiate( "Robot Kyle Mecanim", position, Quaternion.identity, 0 );
199 m_AnimatorView = newPlayerObject.GetComponent
200 }
File name: DemoRPGMovement.cs
Copy
13 void CreatePlayerObject()
14 {
15 Vector3 position = new Vector3( 33.5f, 1.5f, 20.5f );
16
17 GameObject newPlayerObject = PhotonNetwork.Instantiate( "Robot Kyle RPG", position, Quaternion.identity, 0 );
18
19 Camera.Target = newPlayerObject.transform;
20 }
File name: IELdemo.cs
Copy
27 // This is one of the callback/event methods called by PUN (read more in PhotonNetworkingMessage enumeration)
28 public void OnPhotonRandomJoinFailed()
29 {
30 PhotonNetwork.CreateRoom(null, new RoomOptions() {maxPlayers = 4}, null);
31 }
Download file with original file name:Create
Create 118 lượt xem
Gõ tìm kiếm nhanh...