Skip to content

Commit 0564381

Browse files
committed
Changes to align the package to others from DFT Games Studios
1 parent ea3d351 commit 0564381

138 files changed

Lines changed: 542 additions & 288 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Assets/DFT_Games/Localization/README.pdf.meta renamed to Assets/DFTGames.meta

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/DFTGames/Common/Editor.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* DFT Games Studios
3+
* All rights reserved 2009-Present
4+
*/
5+
using UnityEditor;
6+
using UnityEngine;
7+
8+
namespace DFTGames
9+
{
10+
[CustomEditor(typeof(MonoBehaviour), false)]
11+
public class BaseCommonInspector : Editor
12+
{
13+
internal string headerText = "Header Text";
14+
internal string logoPath = "Assets/DFTGames/Common/Editor/DFTGLogo.png";
15+
private Texture2D logo;
16+
17+
18+
public override void OnInspectorGUI()
19+
{
20+
if (logo == null)
21+
{
22+
// Load the logo from the Assets/Editor folder
23+
logo = AssetDatabase.LoadAssetAtPath<Texture2D>(logoPath);
24+
}
25+
DrawCustomHeader();
26+
DrawDefaultInspector();
27+
}
28+
29+
private void DrawCustomHeader()
30+
{
31+
// Add a bar with the header text
32+
GUIStyle style = new GUIStyle(GUI.skin.box)
33+
{
34+
alignment = TextAnchor.MiddleCenter,
35+
fontSize = 14,
36+
fontStyle = FontStyle.Bold,
37+
normal = { textColor = Color.yellow }
38+
};
39+
40+
// Set the height for the header
41+
GUILayout.Space(10);
42+
Rect rect = GUILayoutUtility.GetRect(0, 58, GUILayout.ExpandWidth(true));
43+
44+
// Draw the background
45+
EditorGUI.DrawRect(rect, new Color(.10f, .12f, .12f, 1f));
46+
47+
// Draw the logo
48+
if (logo != null)
49+
{
50+
Rect logoRect = new Rect(rect.x + 10, rect.y + 10, 60, 37); // Adjust size and position
51+
GUI.DrawTexture(logoRect, logo, ScaleMode.ScaleToFit);
52+
}
53+
54+
// Draw the title
55+
Rect textRect = new Rect(rect.x, rect.y, rect.width, rect.height);
56+
EditorGUI.LabelField(textRect, headerText, style);
57+
GUILayout.Space(10);
58+
59+
// Draw the default inspector below
60+
}
61+
}
62+
}

Assets/DFTGames/Common/Editor/BaseCommonInspector.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
27.9 KB

Assets/DFTGames/Common/Editor/DFTGLogo.png.meta

Lines changed: 169 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

0 commit comments

Comments
 (0)