This repository has been archived by the owner on Jun 3, 2022. It is now read-only.
forked from AngryAnt/Path-GPL
/
Resources.cs
945 lines (714 loc) · 23.8 KB
/
Resources.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
/*
Path - pathfinding system for the Unity engine
Copyright (C) 2008 Emil E. Johansen
This file is part of Path.
Path is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Path is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Path. If not, see <http://www.gnu.org/licenses/>.
For alternative license options, contact the copyright holder.
Emil E. Johansen emil@eej.dk
*/
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Reflection;
using System.Collections;
namespace PathLibrary
{
public class Resources
{
private static GUIStyle list, selectedList, unfocusedSelectedList, listItem, selectedListItem, unfocusedSelectedListItem, textLine, title, toolbarPullDownUp, wrappedLabel, wrappedMiniLabel;
private static Texture2D logo, logoShadow, pathLogo, pathLogoWhite, scale, network, waypoint, connection, collapsed, expanded, titleBackground, help, tag;
public static Stream GetResourceStream( string resourceName, Assembly assembly )
{
if( assembly == null )
{
assembly = Assembly.GetExecutingAssembly();
}
return assembly.GetManifestResourceStream( resourceName );
}
public static Stream GetResourceStream( string resourceName )
{
return GetResourceStream( resourceName, null );
}
public static byte[] GetByteResource( string resourceName, Assembly assembly )
{
Stream byteStream;
byte[] buffer;
byteStream = GetResourceStream( resourceName, assembly );
buffer = new byte[ byteStream.Length ];
byteStream.Read( buffer, 0, ( int )byteStream.Length );
byteStream.Close();
return buffer;
}
public static byte[] GetByteResource( string resourceName )
{
return GetByteResource( resourceName, null );
}
public static Texture2D GetTextureResource( string resourceName, Assembly assembly )
{
Texture2D texture;
texture = new Texture2D( 4, 4 );
texture.hideFlags = HideFlags.HideAndDontSave;
texture.LoadImage( GetByteResource( resourceName, assembly ) );
return texture;
}
public static Texture2D GetTextureResource( string resourceName )
{
return GetTextureResource( resourceName, null );
}
public static string Version
{
get
{
#if DEBUG
return "Path 1.0.1 DEBUG";
#else
return "Path 1.0.1";
#endif
}
}
public static string License
{
get
{
#if DEBUG
return "Path.dll - distribution of the 'Path library' pathfinding system\nversion 1.0.1 DEBUG, March, 2009\n\nCopyright (C) AngryAnt, Emil Johansen\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the author be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; you must not\n claim that you wrote the original software. If you use this software\n in a product, an acknowledgment is required as stated in point 2 of\n this notice.\n2. If you use this software in a product, you are required to acknowledge\n its original creator by displaying at least one unaltered version of the\n provided software logo images in your product splash screen for no less\n than four full seconds. If your product has an \"About\" or credits view,\n this same logo image must also be displayed there. This requirement may\n be waived for an additional fee. Contact the original software author\n for details.\n3. The original software author may, in any customer reference list or in\n any press release, use the name of products, individuals and companies\n using this software.\n4. This Agreement will be governed by the laws of the State of Denmark as\n they are applied to agreements between Denmark residents entered into\n and to be performed entirely within Denmark. The United Nations\n Convention on Contracts for the International Sale of Goods is\n specifically disclaimed.\n5. Whether you are licensing the Software as an individual or on behalf of\n an entity, you may not: (a) reverse engineer, decompile, or disassemble\n the Software or attempt to discover the source code; (b) modify the\n Software runtime in whole or in part without the express written consent\n of the original software creator; (c) remove any proprietary notices or\n labels on the Software; (d) resell, lease, rent, transfer, sublicense,\n or otherwise transfer rights to the Software.\n6. You agree that this is the entire agreement between you and the original\n software creator, which supersedes any prior agreement, whether written\n or oral, and all other communications between the original software\n creator and you relating to the subject matter of this Agreement.\n7. This notice and the provided logo image files may not be removed or\n altered from any source distribution.\n\nAngryAnt, Emil Johansen emil@eej.dk";
#else
return "Path.dll - distribution of the 'Path library' pathfinding system\nversion 1.0.1, March, 2009\n\nCopyright (C) AngryAnt, Emil Johansen\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the author be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; you must not\n claim that you wrote the original software. If you use this software\n in a product, an acknowledgment is required as stated in point 2 of\n this notice.\n2. If you use this software in a product, you are required to acknowledge\n its original creator by displaying at least one unaltered version of the\n provided software logo images in your product splash screen for no less\n than four full seconds. If your product has an \"About\" or credits view,\n this same logo image must also be displayed there. This requirement may\n be waived for an additional fee. Contact the original software author\n for details.\n3. The original software author may, in any customer reference list or in\n any press release, use the name of products, individuals and companies\n using this software.\n4. This Agreement will be governed by the laws of the State of Denmark as\n they are applied to agreements between Denmark residents entered into\n and to be performed entirely within Denmark. The United Nations\n Convention on Contracts for the International Sale of Goods is\n specifically disclaimed.\n5. Whether you are licensing the Software as an individual or on behalf of\n an entity, you may not: (a) reverse engineer, decompile, or disassemble\n the Software or attempt to discover the source code; (b) modify the\n Software runtime in whole or in part without the express written consent\n of the original software creator; (c) remove any proprietary notices or\n labels on the Software; (d) resell, lease, rent, transfer, sublicense,\n or otherwise transfer rights to the Software.\n6. You agree that this is the entire agreement between you and the original\n software creator, which supersedes any prior agreement, whether written\n or oral, and all other communications between the original software\n creator and you relating to the subject matter of this Agreement.\n7. This notice and the provided logo image files may not be removed or\n altered from any source distribution.\n\nAngryAnt, Emil Johansen emil@eej.dk";
#endif
}
}
public static string Thanks
{
get
{
return "Ann-Louise Salomonsen, family and friends, unity technologies, Charles Hinshaw, Ricardo J. Mendez, the unity community and the creatures of the #unity3d freenode irc channel";
}
}
public static string Copyright
{
get
{
return "Copyright (C) Emil Johansen - AngryAnt 2009";
}
}
public static Texture2D Logo
{
get
{
if( logo == null )
{
logo = GetTextureResource( "Logo.png" );
}
return logo;
}
}
public static Texture2D LogoShadow
{
get
{
if( logoShadow == null )
{
logoShadow = GetTextureResource( "LogoShadow.png" );
}
return logoShadow;
}
}
public static Texture2D PathLogo
{
get
{
if( pathLogo == null )
{
pathLogo = GetTextureResource( "Path.png" );
}
return pathLogo;
}
}
public static Texture2D PathLogoWhite
{
get
{
if( pathLogoWhite == null )
{
pathLogoWhite = GetTextureResource( "PathWhite.png" );
}
return pathLogoWhite;
}
}
public static Texture2D Scale
{
get
{
if( scale == null )
{
scale = GetTextureResource( "Scale.png" );
}
return scale;
}
}
public static Texture2D Network
{
get
{
if( network == null )
{
network = GetTextureResource( "Network.png" );
}
return network;
}
}
public static Texture2D Waypoint
{
get
{
if( waypoint == null )
{
waypoint = GetTextureResource( "Waypoint.png" );
}
return waypoint;
}
}
public static Texture2D Connection
{
get
{
if( connection == null )
{
connection = GetTextureResource( "Connection.png" );
}
return connection;
}
}
public static Texture2D Collapsed
{
get
{
if( collapsed == null )
{
collapsed = GetTextureResource( "Collapsed.png" );
}
return collapsed;
}
}
public static Texture2D Expanded
{
get
{
if( expanded == null )
{
expanded = GetTextureResource( "Expanded.png" );
}
return expanded;
}
}
public static Texture2D TitleBackground
{
get
{
if( titleBackground == null )
{
titleBackground = GetTextureResource( "TitleBackground.png" );
}
return titleBackground;
}
}
public static Texture2D Help
{
get
{
if( help == null )
{
help = GetTextureResource( "_Help.png" );
}
return help;
}
}
public static Texture2D Tag
{
get
{
if( tag == null )
{
tag = GetTextureResource( "Tag.png" );
}
return tag;
}
}
public static GUIStyle ListStyle
{
get
{
if( list == null )
{
list = new GUIStyle();
}
return list;
}
}
public static GUIStyle SelectedListStyle
{
get
{
if( selectedList == null )
{
selectedList = new GUIStyle();
selectedList.normal.background = GetTextureResource( "SelectedListItem.png" );
}
return selectedList;
}
}
public static GUIStyle UnfocusedSelectedListStyle
{
get
{
if( unfocusedSelectedList == null )
{
unfocusedSelectedList = new GUIStyle();
unfocusedSelectedList.normal.background = GetTextureResource( "UnfocusedSelectedListItem.png" );
unfocusedSelectedList.normal.textColor = Color.white;
}
return unfocusedSelectedList;
}
}
public static GUIStyle ListItemStyle
{
get
{
if( listItem == null )
{
listItem = new GUIStyle();
listItem.padding.left = 5;
listItem.padding.right = 5;
listItem.padding.top = 5;
listItem.padding.bottom = 5;
}
return listItem;
}
}
public static GUIStyle SelectedListItemStyle
{
get
{
if( selectedListItem == null )
{
selectedListItem = new GUIStyle();
selectedListItem.normal.background = GetTextureResource( "SelectedListItem.png" );
selectedListItem.padding.left = 5;
selectedListItem.padding.right = 5;
selectedListItem.padding.top = 5;
selectedListItem.padding.bottom = 5;
}
return selectedListItem;
}
}
public static GUIStyle UnfocusedSelectedListItemStyle
{
get
{
if( unfocusedSelectedListItem == null )
{
unfocusedSelectedListItem = new GUIStyle();
unfocusedSelectedListItem.normal.background = GetTextureResource( "UnfocusedSelectedListItem.png" );
unfocusedSelectedListItem.normal.textColor = Color.white;
unfocusedSelectedListItem.padding.left = 5;
unfocusedSelectedListItem.padding.right = 5;
unfocusedSelectedListItem.padding.top = 5;
unfocusedSelectedListItem.padding.bottom = 5;
}
return unfocusedSelectedListItem;
}
}
public static GUIStyle TextLineStyle
{
get
{
if( textLine == null )
{
textLine = new GUIStyle();
textLine.normal.background = GetTextureResource( "TextLine.png" );
textLine.normal.textColor = Color.white;
}
return textLine;
}
}
public static GUIStyle TitleStyle
{
get
{
if( title == null )
{
title = new GUIStyle( "Box" );
//title.normal.background = TitleBackground;
title.padding.left = title.padding.right = title.padding.top = title.padding.bottom = 5;
title.margin.left = title.margin.right = title.margin.top = title.margin.bottom = 0;
}
return title;
}
}
public static GUIStyle ToolbarPullDownUpStyle
{
get
{
if( toolbarPullDownUp == null )
{
toolbarPullDownUp = new GUIStyle( GUI.skin.GetStyle( "ToolbarPullDown" ) );
toolbarPullDownUp.name = "ToolbarPullDownUp";
toolbarPullDownUp.hover = toolbarPullDownUp.normal;
toolbarPullDownUp.active = toolbarPullDownUp.normal;
toolbarPullDownUp.onNormal = toolbarPullDownUp.normal;
toolbarPullDownUp.onHover = toolbarPullDownUp.normal;
toolbarPullDownUp.onActive = toolbarPullDownUp.normal;
toolbarPullDownUp.focused = toolbarPullDownUp.normal;
toolbarPullDownUp.onFocused = toolbarPullDownUp.normal;
}
return toolbarPullDownUp;
}
}
public static GUIStyle WrappedLabelStyle
{
get
{
if( wrappedLabel == null )
{
wrappedLabel = new GUIStyle( GUI.skin.GetStyle( "Label" ) );
wrappedLabel.wordWrap = true;
}
return wrappedLabel;
}
}
public static GUIStyle WrappedMiniLabelStyle
{
get
{
if( wrappedMiniLabel == null )
{
wrappedMiniLabel = new GUIStyle( GUI.skin.GetStyle( "MiniLabel" ) );
wrappedMiniLabel.wordWrap = true;
}
return wrappedMiniLabel;
}
}
public static float FloatField( float value )
{
string text;
text = "" + value;
text = GUILayout.TextField( text );
if( text != "" )
{
return System.Single.Parse( text );
}
return 0.0f;
}
public static Vector3 Vector3Field( Vector3 vector )
{
GUILayout.BeginHorizontal();
vector = new Vector3( FloatField( vector.x ), FloatField( vector.y ), FloatField( vector.z ) );
GUILayout.EndHorizontal();
return vector;
}
public static int DefaultListItemHeight
{
get
{
return 14;
}
}
public static float DefaultLeftColumnWidth
{
get
{
return 100.0f;
}
}
public static bool MultiSelectKey
{
get
{
switch( Application.platform )
{
case RuntimePlatform.OSXEditor:
case RuntimePlatform.OSXPlayer:
case RuntimePlatform.OSXWebPlayer:
case RuntimePlatform.OSXDashboardPlayer:
return Event.current.command;
default:
return Event.current.control;
}
}
}
public delegate bool OnListItemGUI( object item, bool selected, ICollection list );
private static bool OnDefaultListItemGUI( object item, bool selected, ICollection list )
{
if( GUILayout.Button( item.ToString(), selected ? SelectedListStyle : ListStyle ) )
{
selected = !selected;
}
return selected;
}
/*public static ICollection SelectList( ICollection list, ICollection selected, int maxSelection, OnListItemGUI itemHandler )
{
ArrayList newSelection;
newSelection = new ArrayList( selected );
foreach( object item in list )
{
if( itemHandler( item, newSelection.Contains( item ), list ) )
// If the item is now/still selected
{
if( !newSelection.Contains( item ) )
{
if( MultiSelectKey )
{
if( newSelection.Count < maxSelection )
{
newSelection.Add( item );
}
}
else
{
newSelection.Clear();
newSelection.Add( item );
}
}
}
else if( newSelection.Contains( item ) )
// If the item has just been deselected
{
if( MultiSelectKey )
{
newSelection.Remove( item );
}
else
{
newSelection.Clear();
}
}
}
return newSelection;
}*/
public static ICollection SelectList( ICollection list, ICollection selected, int maxSelection, OnListItemGUI itemHandler )
{
object[] oldSelection;
ArrayList newSelection = new ArrayList( maxSelection );
oldSelection = new object[ selected.Count ];
selected.CopyTo( oldSelection, 0 );
foreach( object item in list )
{
if( itemHandler( item, System.Array.IndexOf( oldSelection, item ) > -1, list ) )
// If the item is now/still selected
{
if( MultiSelectKey )
{
if( newSelection.Count < maxSelection )
{
newSelection.Add( item );
}
}
else
{
//newSelection.Clear(); //not arsure if needed
newSelection.Add( item );
}
}
}
return newSelection;
}
public static object SelectList( ICollection list, object selected, OnListItemGUI itemHandler )
{
ArrayList selectionList;
selectionList = new ArrayList();
if( selected != null )
{
selectionList.Add( selected );
}
selectionList = new ArrayList( SelectList( list, selectionList, 1, itemHandler ) );
return ( selectionList.Count > 0 ) ? selectionList[ 0 ] : null;
}
public static ICollection SelectList( ICollection list, ICollection selected, int maxSelection )
{
return SelectList( list, selected, maxSelection, OnDefaultListItemGUI );
}
public static object SelectList( ICollection list, object selected )
{
return SelectList( list, selected, OnDefaultListItemGUI );
}
public static object PulldownPopup( string label, ArrayList list, string emptyString )
{
string[] popupList;
int popupSelection;
popupSelection = 0;
if( list.Count == 0 )
{
popupList = new string[ 2 ];
popupList[ 0 ] = label;
popupList[ 1 ] = emptyString;
EditorGUILayout.Popup( 0, popupList/*, Resources.ToolbarPullDownUpStyle*/ );
}
else
{
popupList = new string[ list.Count + 1 ];
popupList[ 0 ] = label;
for( int i = 0; i < list.Count; i++ )
{
if( list[ i ] == null )
{
continue;
}
popupList[ i + 1 ] = list[ i ].ToString();
}
popupSelection = EditorGUILayout.Popup( popupSelection, popupList/*, Resources.ToolbarPullDownUpStyle*/ );
if( popupSelection != 0 )
{
return list[ popupSelection - 1 ];
}
}
return null;
}
public static ArrayList LayerNames
{
get
{
ArrayList layers;
string layer;
layers = new ArrayList();
for( int i = 0; i <= 31; i++ )
{
layer = LayerMask.LayerToName( i );
if( layer != "" )
{
layers.Add( layer );
}
}
return layers;
}
}
public static LayerMask LayerMaskField( LayerMask value )
{
ArrayList layers;
string[] popupList;
int index;
layers = LayerNames;
layers.Insert( 0, "All" );
popupList = new string[ layers.Count ];
for( int i = 0; i < layers.Count; i++ )
{
popupList[ i ] = layers[ i ].ToString();
}
index = ( value == -1 ) ? 0 : System.Array.IndexOf( popupList, LayerMask.LayerToName( value ) );
index = EditorGUILayout.Popup( index, popupList );
value = ( index > 0 ) ? LayerMask.NameToLayer( popupList[ index ] ) : -1;
return value;
}
public static Vector3 About( Vector3 scroll )
{
GUILayout.BeginHorizontal();
GUILayout.Label( Resources.LogoShadow );
GUILayout.BeginVertical();
GUILayout.BeginVertical( GUILayout.Height( 70.0f ) );
GUILayout.FlexibleSpace();
GUILayout.Label( Resources.PathLogo );
GUILayout.Label( Resources.Version );
GUILayout.EndVertical();
GUILayout.EndVertical();
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
GUILayout.Space( 20.0f );
//GUILayout.Label( "", TextLineStyle, GUILayout.Height( 1.0f ) );
GUILayout.BeginHorizontal();
GUILayout.Space( 5.0f );
GUILayout.BeginVertical();
scroll = GUILayout.BeginScrollView( scroll, GUI.skin.GetStyle( "Box" ) );
GUILayout.Label( Resources.License, Resources.WrappedMiniLabelStyle );
GUILayout.EndScrollView();
GUILayout.EndVertical();
GUILayout.EndHorizontal();
//GUILayout.Label( "", TextLineStyle, GUILayout.Height( 1.0f ) );
GUILayout.FlexibleSpace();
GUILayout.Space( 20.0f );
GUILayout.BeginHorizontal();
GUILayout.Space( 5.0f );
GUILayout.BeginVertical();
GUILayout.Label( "Thanks to " + Resources.Thanks + ".", Resources.WrappedLabelStyle );
GUILayout.Space( 10.0f );
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
GUILayout.Label( Resources.Copyright );
GUILayout.EndHorizontal();
GUILayout.EndVertical();
GUILayout.Space( 5.0f );
GUILayout.EndHorizontal();
return scroll;
}
public static void Documentation( string topic )
{
System.Diagnostics.Process browserProcess;
try
{
browserProcess = new System.Diagnostics.Process();
browserProcess.EnableRaisingEvents = false;
switch( Application.platform )
{
case RuntimePlatform.OSXEditor:
case RuntimePlatform.OSXPlayer:
case RuntimePlatform.OSXWebPlayer:
case RuntimePlatform.OSXDashboardPlayer:
browserProcess.StartInfo.FileName = ( ( topic == "" ) ? "open http://angryant.com/pathdoc.html" : ( "open http://angryant.com/pathdoc.html#" + topic ) );
break;
default:
browserProcess.StartInfo.FileName = ( ( topic == "" ) ? "start http://angryant.com/pathdoc.html" : ( "start http://angryant.com/pathdoc.html#" + topic ) );
break;
}
browserProcess.Start();
}
catch( System.Exception e )
{
Debug.LogError( "Unable to launch help documentation: " + e );
}
}
public static void Documentation()
{
Documentation( "" );
}
public static int[] SharedTags( ICollection assets )
{
int[] result;
ArrayList tags;
bool shared;
tags = new ArrayList();
foreach( TaggedAsset asset in assets )
{
foreach( int tag in asset.Tags )
{
if( tags.Contains( tag ) )
{
continue;
}
shared = true;
foreach( TaggedAsset other in assets )
{
if( !other.HasTag( tag ) )
{
shared = false;
break;
}
}
if( shared )
{
tags.Add( tag );
}
}
}
result = new int[ tags.Count ];
System.Array.Copy( tags.ToArray(), result, tags.Count );
return result;
}
}
}