File tree Expand file tree Collapse file tree 2 files changed +9
-13
lines changed
Assets/FishNet/Runtime/Editor/NewNetworkBehaviour Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -16,16 +16,7 @@ internal sealed class CreateNewNetworkBehaviour : MonoBehaviour
1616 [ MenuItem ( "Assets/Create/NetworkBehaviour Script" , false , - 220 ) ]
1717 private static void CreateNewAsset ( )
1818 {
19- string templatePath ;
20- if ( Directory . Exists ( Application . dataPath + "/FishNet" ) )
21- {
22- templatePath = Application . dataPath + "/FishNet/Assets/FishNet/Runtime/Editor/NewNetworkBehaviour/template.txt" ;
23- }
24- else
25- {
26- templatePath = "Packages/com.firstgeargames.fishnet/Runtime/Editor/NewNetworkBehaviour/template.txt" ;
27- }
28-
19+ string templatePath = Application . dataPath + "/FishnetNBTemplate.txt" ;
2920 if ( ! File . Exists ( templatePath ) )
3021 {
3122
Original file line number Diff line number Diff line change 77using UnitySettingsProvider = UnityEditor . SettingsProvider ;
88using FishNet . Configuring ;
99using System . IO ;
10+ using System . Xml . Linq ;
1011
1112
1213namespace FishNet . Editing . NewNetworkBehaviourScript
@@ -16,8 +17,7 @@ internal static class SettingsProvider
1617
1718
1819 private static PrefabGeneratorConfigurations _settings ;
19- static string templatePath = Application . dataPath + "/FishNet/Assets/FishNet/Runtime/Editor/NewNetworkBehaviour/template.txt" ;
20-
20+ static string templatePath ;
2121 [ UnitySettingsProvider ]
2222 private static UnitySettingsProvider Create ( )
2323 {
@@ -39,14 +39,19 @@ private static UnitySettingsProvider Create()
3939
4040 private static void OnGUI ( string searchContext )
4141 {
42- if ( GUILayout . Button ( "Edit template" ) )
42+ if ( templatePath == null ) templatePath = Application . dataPath + "/FishnetNBTemplate.txt" ;
43+
44+ if ( GUILayout . Button ( "Edit template" ) )
4345 {
4446 if ( ! File . Exists ( templatePath ) )
4547 {
4648 CreateNewNetworkBehaviour . CopyExistingTemplate ( templatePath ) ;
4749 }
4850 System . Diagnostics . Process . Start ( templatePath ) ;
4951 }
52+
53+ EditorGUILayout . LabelField ( $ "Template path: { templatePath } ") ;
54+
5055 }
5156
5257
You can’t perform that action at this time.
0 commit comments