FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PatcherHub/Editor/PatcherAutoOpenDetector.cs at main · PawlygonStudio/PatcherHub · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
PawlygonStudio
/
PatcherHub
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
PatcherHub
/
Editor
/
PatcherAutoOpenDetector.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (38 loc) · 1.44 KB
Breadcrumbs
PatcherHub
/
Editor
/
PatcherAutoOpenDetector.cs
Copy path
File metadata and controls
42 lines (38 loc) · 1.44 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
using
UnityEditor
;
namespace
Pawlygon
.
PatcherHub
.
Editor
{
/// <summary>
/// Automatically opens the Patcher Hub window on the first project import.
/// Uses project-specific EditorPrefs to ensure the window only opens once per project.
/// </summary>
[
InitializeOnLoad
]
public
static
class
PatcherAutoOpenDetector
{
/// <summary>
/// Generates a unique key for this project to track first-run status.
/// </summary>
/// <returns>Project-specific key for EditorPrefs storage</returns>
private
static
string
GetAssemblyKey
(
)
{
string
projectPath
=
UnityEngine
.
Application
.
dataPath
;
string
assemblyName
=
typeof
(
PatcherAutoOpenDetector
)
.
Assembly
.
GetName
(
)
.
Name
;
return
$
"PatcherHub_FirstRun_
{
projectPath
.
GetHashCode
(
)
}
_
{
assemblyName
}
"
;
}
/// <summary>
/// Static constructor that runs when the class is first loaded.
/// Opens the Patcher Hub window automatically on first project import.
/// </summary>
static
PatcherAutoOpenDetector
(
)
{
string
assemblyKey
=
GetAssemblyKey
(
)
;
if
(
!
EditorPrefs
.
GetBool
(
assemblyKey
,
false
)
)
{
EditorApplication
.
delayCall
+=
(
)
=>
{
PatcherHubWindow
.
ShowWindow
(
)
;
EditorPrefs
.
SetBool
(
assemblyKey
,
true
)
;
}
;
}
}
}
}
Back
|
FazBrowse Home
|
New Git URL