少年修仙传客户端基础资源
dabaoji
2025-06-04 34d28a982a741d63f183884881b0bea73f8c8b47
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
using System;
using UnityEditor;
using UnityEngine;
 
namespace PigeonCoopToolkit.Generic.Editor
{
    public class InfoDialogue : EditorWindow
    {
        public VersionInformation versionInformation;
        public Texture2D banner;
        public string UserGuidePath;
        public string AssetStoreContentID;
        public bool IsAbout;
 
        void OnGUI()
        {
            if(banner == null)
            {
                return;
            }
 
 
            GUI.DrawTexture(new Rect(0, 0, banner.width, banner.height), banner);
            GUILayout.Space(banner.height - 18);
            if (versionInformation != null) GUILayout.Label(versionInformation.ToString(), EditorStyles.whiteMiniLabel);
            GUIStyle lessPaddingNotif = new GUIStyle("NotificationText");
            lessPaddingNotif.padding = new RectOffset(10,10,10,10);
            lessPaddingNotif.margin = new RectOffset(10, 10, 10, 10);
            lessPaddingNotif.stretchWidth = true;
 
            if (!IsAbout) 
                GUILayout.Label("Thanks for your purchase! ♥", lessPaddingNotif);
            else
                GUILayout.FlexibleSpace();
 
            GUILayout.BeginHorizontal();
            GUILayout.Space(16);
            GUILayout.BeginVertical();
            GUILayout.Label("We hope you enjoy this tool. Feel free to contact us at our twitter or email - send us feature requests, get some help from us, or just say hi!", "WordWrapLabel");
            GUILayout.Label("Don't forget to rate or review "+ (versionInformation != null ? versionInformation.Name : "us") +" on the asset store once you've had a chance to evaluate it", "WordWrapLabel");
            GUILayout.EndVertical();
            GUILayout.Space(16);
            GUILayout.EndHorizontal(); 
            
 
            GUILayout.FlexibleSpace();
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
 
            GUILayout.BeginVertical();
 
            if (!string.IsNullOrEmpty(AssetStoreContentID))
            if (GUILayout.Button("Review us on the Asset Store!", "LargeButton"))
            {
                Application.OpenURL("com.unity3d.kharma:content/" + AssetStoreContentID);
            }
            GUILayout.Space(5);
            if (!string.IsNullOrEmpty(UserGuidePath))
            {
                if (GUILayout.Button("Need help? Read the user guide!","LargeButton"))
                {
                    Application.OpenURL(UserGuidePath);
                };
 
            }
            GUILayout.Space(5);
            if (GUILayout.Button("Want to say hello? @PigeonCoopAU", "LargeButton"))
            {
                Application.OpenURL("http://www.twitter.com/PigeonCoopAU");
            }
 
            GUILayout.EndVertical();
            GUILayout.FlexibleSpace();
 
            GUILayout.EndHorizontal();
 
            GUILayout.FlexibleSpace();
            GUILayout.Label("© 2014-" + DateTime.Now.Year + " Pigeon Coop ", EditorStyles.miniLabel);
 
        }
 
        public void Init(Texture2D _banner, VersionInformation _versionInformation, string userGuidePath, string assetStoreContentID = null, bool isAbout = false)
        {
            banner = _banner;
 
            //ensure the banner is not null.
            if (banner == null)
                banner = EditorGUIUtility.whiteTexture;
 
            UserGuidePath = userGuidePath;
            IsAbout = isAbout;
            AssetStoreContentID = assetStoreContentID;
 
            if (System.IO.File.Exists(FileUtil.GetProjectRelativePath(userGuidePath)) == false)
                UserGuidePath = null;
 
            versionInformation = _versionInformation;
            minSize = maxSize = new Vector2(banner == EditorGUIUtility.whiteTexture ? 350 : banner.width, 500);
        }
    }
 
    public class InfoDialogueSpawner
    {
        public InfoDialogueSpawner()
        {
            EditorApplication.update += Update;
        }
 
        private string _projectName;
        private string _bannerLocation;
        private VersionInformation _versionInfo;
        private string _documentationLocation;
        private string _projectID;
 
        protected void SetParams(
            string projectName,
            string bannerLocation,
            VersionInformation versionInfo,
            string documentationLocation,
            string projectID
        )
        {
            _projectName = projectName;
            _bannerLocation = bannerLocation;
            _versionInfo = versionInfo;
            _documentationLocation = documentationLocation;
            _projectID = projectID;
        }
 
        public virtual void LaunchAbout()
        {
            InfoDialogue dialogue = EditorWindow.GetWindow<InfoDialogue>(
                true, 
                _projectName);
                dialogue.Init(Resources.Load(_bannerLocation) as Texture2D,_versionInfo,
                Application.dataPath + _documentationLocation,
                _projectID,
                true
            );
        }
 
        void Update()
        {
            if (EditorPrefs.GetBool("PCTK/" + _projectID+"/IntroDialogueLaunched") == false)
            {
                EditorPrefs.SetBool("PCTK/" + _projectID + "/IntroDialogueLaunched", true);
 
                InfoDialogue dialogue = EditorWindow.GetWindow<InfoDialogue>(
                    true,
                    _projectName);
                    dialogue.Init(Resources.Load(_bannerLocation) as Texture2D, _versionInfo,
                    Application.dataPath + _documentationLocation,
                    _projectID
                );    
            
            }
            else
            {
                EditorApplication.update -= Update;
            }
        }
    }
 
}