HelpIcon
How do I use Help Icon
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
File name: PhotonTransformViewEditor.cs
Copy
220 private void DrawPropertyWithHelpIcon(ref Rect propertyRect, ref bool isHelpOpen, SerializedProperty property, string tooltip)
221 {
222 Rect propertyFieldRect = new Rect(propertyRect.xMin, propertyRect.yMin, propertyRect.width - 20, propertyRect.height);
223 string propertyName = ObjectNames.NicifyVariableName(property.name);
224 EditorGUI.PropertyField(propertyFieldRect, property, new GUIContent(propertyName, tooltip));
225
226 Rect helpIconRect = new Rect(propertyFieldRect.xMax + 5, propertyFieldRect.yMin, 20, propertyFieldRect.height);
227 isHelpOpen = GUI.Toggle(helpIconRect, isHelpOpen, PhotonGUI.HelpIcon, GUIStyle.none);
228
229 propertyRect.y += EDITOR_LINE_HEIGHT;
230 }
File name: PhotonTransformViewEditor.cs
Copy
232 private void DrawSynchronizePositionDataExtrapolation(ref Rect propertyRect, SerializedProperty extrapolatePositionProperty, PhotonTransformViewPositionModel.ExtrapolateOptions extrapolateOption)
233 {
234 DrawPropertyWithHelpIcon(ref propertyRect, ref this.m_ExtrapolateHelpOpen, extrapolatePositionProperty, EXTRAPOLATE_TOOLTIP);
235 DrawHelpBox(ref propertyRect, this.m_ExtrapolateHelpOpen, GetExtrapolateHelpBoxHeight(), EXTRAPOLATE_HELP, EXTRAPOLATE_HELP_URL);
236
237 if (extrapolateOption != PhotonTransformViewPositionModel.ExtrapolateOptions.Disabled)
238 {
239 EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_PositionModel.ExtrapolateIncludingRoundTripTime"));
240 propertyRect.y += EDITOR_LINE_HEIGHT;
241 }
242
243 switch (extrapolateOption)
244 {
245 case PhotonTransformViewPositionModel.ExtrapolateOptions.FixedSpeed:
246 EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_PositionModel.ExtrapolateSpeed"));
247 propertyRect.y += EDITOR_LINE_HEIGHT;
248 break;
249 }
250 }
File name: PhotonTransformViewEditor.cs
Copy
264 PhotonTransformViewPositionModel.InterpolateOptions interpolateOption)
265 {
266 DrawPropertyWithHelpIcon(ref propertyRect, ref this.m_InterpolateHelpOpen, interpolatePositionProperty, INTERPOLATE_TOOLTIP);
267 DrawHelpBox(ref propertyRect, this.m_InterpolateHelpOpen, GetInterpolateHelpBoxHeight(), INTERPOLATE_HELP, INTERPOLATE_HELP_URL);
268
269 switch (interpolateOption)
270 {
271 case PhotonTransformViewPositionModel.InterpolateOptions.FixedSpeed:
272 EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_PositionModel.InterpolateMoveTowardsSpeed"),
273 new GUIContent("MoveTowards Speed"));
274 propertyRect.y += EDITOR_LINE_HEIGHT;
275 break;
276
277 case PhotonTransformViewPositionModel.InterpolateOptions.Lerp:
278 EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_PositionModel.InterpolateLerpSpeed"), new GUIContent("Lerp Speed"));
279 propertyRect.y += EDITOR_LINE_HEIGHT;
280 break;
281
282 /*case PhotonTransformViewPositionModel.InterpolateOptions.MoveTowardsComplex:
283 Rect curveRect = new Rect(propertyRect.xMin, propertyRect.yMin, propertyRect.width - 100, propertyRect.height);
284 EditorGUI.PropertyField(curveRect, serializedObject.FindProperty("m_PositionModel.InterpolateSpeedCurve"), new GUIContent("MoveTowards Speed Curve"));
285
286 Rect labelRect = new Rect(propertyRect.xMax - 95, propertyRect.yMin, 10, propertyRect.height);
287 GUI.Label(labelRect, "x");
288
289 Rect multiplierRect = new Rect(propertyRect.xMax - 80, propertyRect.yMin, 80, propertyRect.height);
290 EditorGUI.PropertyField(multiplierRect, serializedObject.FindProperty("m_PositionModel.InterpolateMoveTowardsSpeed"), GUIContent.none);
291 propertyRect.y += EDITOR_LINE_HEIGHT;
292
293 EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_PositionModel.InterpolateMoveTowardsAcceleration"),
294 new GUIContent("Acceleration"));
295 propertyRect.y += EDITOR_LINE_HEIGHT;
296
297 EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_PositionModel.InterpolateMoveTowardsDeceleration"),
298 new GUIContent("Deceleration"));
299 propertyRect.y += EDITOR_LINE_HEIGHT;
300 break;*/
301 }
302 }
File name: PhotonTransformViewEditor.cs
Copy
309 private void DrawSynchronizeRotationData()
310 {
311 if (this.m_SynchronizeRotationProperty == null || this.m_SynchronizeRotationProperty.boolValue == false)
312 {
313 return;
314 }
315
316 SerializedProperty interpolateRotationProperty = serializedObject.FindProperty("m_RotationModel.InterpolateOption");
317 PhotonTransformViewRotationModel.InterpolateOptions interpolateOption =
318 (PhotonTransformViewRotationModel.InterpolateOptions) interpolateRotationProperty.enumValueIndex;
319
320 float containerHeight = 20;
321
322 switch (interpolateOption)
323 {
324 case PhotonTransformViewRotationModel.InterpolateOptions.RotateTowards:
325 case PhotonTransformViewRotationModel.InterpolateOptions.Lerp:
326 containerHeight += EDITOR_LINE_HEIGHT;
327 break;
328 }
329
330 if (this.m_InterpolateRotationHelpOpen == true)
331 {
332 containerHeight += GetInterpolateHelpBoxHeight();
333 }
334
335 Rect rect = PhotonGUI.ContainerBody(containerHeight);
336 Rect propertyRect = new Rect(rect.xMin + 5, rect.yMin + 2, rect.width - 10, EditorGUIUtility.singleLineHeight);
337
338 DrawPropertyWithHelpIcon(ref propertyRect, ref this.m_InterpolateRotationHelpOpen, interpolateRotationProperty, INTERPOLATE_TOOLTIP);
339 DrawHelpBox(ref propertyRect, this.m_InterpolateRotationHelpOpen, GetInterpolateHelpBoxHeight(), INTERPOLATE_HELP, INTERPOLATE_HELP_URL);
340
341 switch (interpolateOption)
342 {
343 case PhotonTransformViewRotationModel.InterpolateOptions.RotateTowards:
344 EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_RotationModel.InterpolateRotateTowardsSpeed"),
345 new GUIContent("RotateTowards Speed"));
346 break;
347 case PhotonTransformViewRotationModel.InterpolateOptions.Lerp:
348 EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_RotationModel.InterpolateLerpSpeed"), new GUIContent("Lerp Speed"));
349 break;
350 }
351 }
File name: PhotonTransformViewEditor.cs
Copy
358 private void DrawSynchronizeScaleData()
359 {
360 if (this.m_SynchronizeScaleProperty == null || this.m_SynchronizeScaleProperty.boolValue == false)
361 {
362 return;
363 }
364
365 SerializedProperty interpolateScaleProperty = serializedObject.FindProperty("m_ScaleModel.InterpolateOption");
366 PhotonTransformViewScaleModel.InterpolateOptions interpolateOption = (PhotonTransformViewScaleModel.InterpolateOptions) interpolateScaleProperty.enumValueIndex;
367
368 float containerHeight = EDITOR_LINE_HEIGHT;
369
370 switch (interpolateOption)
371 {
372 case PhotonTransformViewScaleModel.InterpolateOptions.MoveTowards:
373 case PhotonTransformViewScaleModel.InterpolateOptions.Lerp:
374 containerHeight += EDITOR_LINE_HEIGHT;
375 break;
376 }
377
378 if (this.m_InterpolateScaleHelpOpen == true)
379 {
380 containerHeight += GetInterpolateHelpBoxHeight();
381 }
382
383 Rect rect = PhotonGUI.ContainerBody(containerHeight);
384 Rect propertyRect = new Rect(rect.xMin + 5, rect.yMin + 2, rect.width - 10, EditorGUIUtility.singleLineHeight);
385
386 DrawPropertyWithHelpIcon(ref propertyRect, ref this.m_InterpolateScaleHelpOpen, interpolateScaleProperty, INTERPOLATE_TOOLTIP);
387 DrawHelpBox(ref propertyRect, this.m_InterpolateScaleHelpOpen, GetInterpolateHelpBoxHeight(), INTERPOLATE_HELP, INTERPOLATE_HELP_URL);
388
389 switch (interpolateOption)
390 {
391 case PhotonTransformViewScaleModel.InterpolateOptions.MoveTowards:
392 EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_ScaleModel.InterpolateMoveTowardsSpeed"),
393 new GUIContent("MoveTowards Speed"));
394 break;
395 case PhotonTransformViewScaleModel.InterpolateOptions.Lerp:
396 EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_ScaleModel.InterpolateLerpSpeed"), new GUIContent("Lerp Speed"));
397 break;
398 }
399 }
File name: PhotonEditor.cs
Copy
649 protected virtual void OnGuiSetupCloudAppId()
650 {
651 GUILayout.Label(CurrentLang.AppIdLabel);
652
653 GUILayout.BeginHorizontal();
654 this.cloudAppId = EditorGUILayout.TextField(this.cloudAppId);
655
656 open = GUILayout.Toggle(open, PhotonGUI.HelpIcon, GUIStyle.none, GUILayout.ExpandWidth(false));
657
658 GUILayout.EndHorizontal();
659
660 if (open) GUILayout.Label(CurrentLang.AppIdInfoLabel);
661
662
663
664 EditorGUILayout.Separator();
665
666 GUILayout.Label(CurrentLang.CloudRegionLabel);
667
668 GUILayout.BeginHorizontal();
669 int toolbarValue = GUILayout.Toolbar((int)selectedRegion, CloudServerRegionNames); // the enum CloudRegionCode is converted into a string[] in init (toolbar can't use enum)
670 helpRegion = GUILayout.Toggle( helpRegion, PhotonGUI.HelpIcon, GUIStyle.none, GUILayout.ExpandWidth( false ) );
671 GUILayout.EndHorizontal();
672
673
674 if (helpRegion) GUILayout.Label(CurrentLang.RegionalServersInfo);
675 PhotonEditor.selectedRegion = (CloudRegionCode)toolbarValue;
676
677 EditorGUILayout.Separator();
678
679 GUILayout.BeginHorizontal();
680 if (GUILayout.Button(CurrentLang.CancelButton))
681 {
682 GUIUtility.keyboardControl = 0;
683 this.ReApplySettingsToWindow();
684 }
685
686
687
688 if (GUILayout.Button(CurrentLang.SaveButton))
689 {
690 GUIUtility.keyboardControl = 0;
691 this.cloudAppId = this.cloudAppId.Trim();
692 PhotonEditor.Current.UseCloud(this.cloudAppId);
693
694 PhotonEditor.Current.PreferredRegion = PhotonEditor.selectedRegion;
695 PhotonEditor.Current.HostType = (PhotonEditor.Current.PreferredRegion == CloudRegionCode.none)
696 ? ServerSettings.HostingOption.BestRegion
697 : ServerSettings.HostingOption.PhotonCloud;
698 PhotonEditor.Save();
699
700 Inspect();
701 EditorUtility.DisplayDialog(CurrentLang.SettingsSavedTitle, CurrentLang.SettingsSavedMessage, CurrentLang.OkButton);
702 }
703
704 GUILayout.EndHorizontal();
705
706
707
708 GUILayout.Space(20);
709
710 GUILayout.Label(CurrentLang.SetupOwnServerLabel);
711
712 if (GUILayout.Button(CurrentLang.SelfHostSettingsButton))
713 {
714 //this.photonAddress = ServerSettings.DefaultServerAddress;
715 //this.photonPort = ServerSettings.DefaultMasterPort;
716 this.photonSetupState = PhotonSetupStates.SetupSelfHosted;
717 }
718
719 EditorGUILayout.Separator();
720 GUILayout.Label(CurrentLang.OwnHostCloudCompareLabel);
721 if (GUILayout.Button(CurrentLang.ComparisonPageButton))
722 {
723 Application.OpenURL(UrlCompare);
724 }
725 }
File name: PhotonGUI.cs
Copy
139 {
140 get
141 {
142 if( m_HelpIcon == null )
143 {
144 m_HelpIcon = AssetDatabase.LoadAssetAtPath( "Assets/Photon Unity Networking/Editor/PhotonNetwork/help.png", typeof( Texture2D ) ) as Texture2D;
145 }
146
147 return m_HelpIcon;
148 }
149 }
HelpIcon 135 lượt xem
Gõ tìm kiếm nhanh...