Skip to content

Commit b5a3fd2

Browse files
committed
Updated to 2.0.1 - New Asset Store Version - Unity 3.3 LTS
1 parent 898ec8f commit b5a3fd2

File tree

940 files changed

+74750
-13481
lines changed

Some content is hidden

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

940 files changed

+74750
-13481
lines changed

ASMedia/CardImage.png

-1.9 KB
Loading

ASMedia/CardImage.psd

-36.6 KB
Binary file not shown.

ASMedia/CoverImage.png

2.92 KB
Loading

ASMedia/CoverImage.psd

-112 KB
Binary file not shown.

ASMedia/Screenshot1.png

-21.5 KB
Loading

ASMedia/Screenshot1.psd

-110 KB
Binary file not shown.

ASMedia/SocialMediaImage.png

-11.4 KB
Loading

ASMedia/SocialMediaImage.psd

-74.8 KB
Binary file not shown.
Lines changed: 69 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,89 @@
1-
/*
2-
* DFT Games Studios
3-
* All rights reserved 2009-Present
4-
*/
1+
// SPDX-License-Identifier: Apache-2.0
2+
// Copyright (c) 2012-present Giuseppe "Pino" De Francesco (DFT Games Studios)
3+
//
4+
// Project: Unity Localization System
5+
// File: BaseCommonInspector.cs
6+
// Summary: Base Custom inspector class
7+
//
8+
// Licensed under the Apache License, Version 2.0 (the "License");
9+
// you may not use this file except in compliance with the License.
10+
// You may obtain a copy of the License at
11+
// http://www.apache.org/licenses/LICENSE-2.0
12+
//
13+
// Attribution: Please retain this header and the NOTICE file when redistributing.
14+
// Citation: If you use this work in a publication, please cite it (see CITATION.cff).
15+
516
using UnityEditor;
617
using UnityEngine;
718

819
namespace DFTGames
920
{
21+
/// <summary>
22+
/// Base class for custom Unity Editor inspectors used across DFT Games components.
23+
/// Provides a consistent branded header with logo and title for all derived inspectors.
24+
///
25+
/// Usage:
26+
/// 1. Derive your custom inspector from this class instead of Editor
27+
/// 2. In OnEnable(), set the headerText field to customize the title
28+
/// 3. Optionally override logoPath to use a different logo
29+
///
30+
/// The inspector automatically displays:
31+
/// - A styled header bar with dark background
32+
/// - DFT Games logo on the left
33+
/// - Custom header text centered
34+
/// - All default inspector properties below
35+
/// </summary>
1036
[CustomEditor(typeof(MonoBehaviour), false)]
1137
public class BaseCommonInspector : Editor
1238
{
39+
/// <summary>
40+
/// The text to display in the inspector header. Set this in derived classes' OnEnable() method.
41+
/// Default value: "Header Text"
42+
/// </summary>
1343
internal string headerText = "Header Text";
44+
45+
/// <summary>
46+
/// Asset path to the logo image file. Can be overridden in derived classes to use a custom logo.
47+
/// Default path: "Assets/DFTGames/Common/Editor/DFTGLogo.png"
48+
/// </summary>
1449
internal string logoPath = "Assets/DFTGames/Common/Editor/DFTGLogo.png";
50+
51+
/// <summary>
52+
/// Cached reference to the loaded logo texture. Loaded once during the first OnInspectorGUI() call.
53+
/// </summary>
1554
private Texture2D logo;
1655

1756

57+
/// <summary>
58+
/// Renders the custom inspector GUI. First draws the branded header, then the default inspector.
59+
/// </summary>
1860
public override void OnInspectorGUI()
1961
{
62+
// Lazy load the logo texture if not already loaded
2063
if (logo == null)
2164
{
2265
// Load the logo from the Assets/Editor folder
2366
logo = AssetDatabase.LoadAssetAtPath<Texture2D>(logoPath);
2467
}
68+
69+
// Draw the custom header with logo and title
2570
DrawCustomHeader();
71+
72+
// Draw all the default inspector properties
2673
DrawDefaultInspector();
2774
}
2875

76+
/// <summary>
77+
/// Draws the custom header bar with logo and title text.
78+
/// The header features:
79+
/// - Dark gray background (RGB: 0.10, 0.12, 0.12)
80+
/// - DFT Games logo positioned on the left (60x37 pixels)
81+
/// - Centered title text in yellow, bold, 14pt font
82+
/// - 58 pixels total height with spacing
83+
/// </summary>
2984
private void DrawCustomHeader()
3085
{
31-
// Add a bar with the header text
86+
// Configure the text style for the header title
3287
GUIStyle style = new GUIStyle(GUI.skin.box)
3388
{
3489
alignment = TextAnchor.MiddleCenter,
@@ -37,26 +92,28 @@ private void DrawCustomHeader()
3792
normal = { textColor = Color.yellow }
3893
};
3994

40-
// Set the height for the header
95+
// Add spacing above the header
4196
GUILayout.Space(10);
97+
98+
// Reserve space for the header (58 pixels height, full width)
4299
Rect rect = GUILayoutUtility.GetRect(0, 58, GUILayout.ExpandWidth(true));
43100

44-
// Draw the background
101+
// Draw the dark background
45102
EditorGUI.DrawRect(rect, new Color(.10f, .12f, .12f, 1f));
46103

47-
// Draw the logo
104+
// Draw the logo on the left side if available
48105
if (logo != null)
49106
{
50-
Rect logoRect = new Rect(rect.x + 10, rect.y + 10, 60, 37); // Adjust size and position
107+
Rect logoRect = new Rect(rect.x + 10, rect.y + 10, 60, 37); // Position and size
51108
GUI.DrawTexture(logoRect, logo, ScaleMode.ScaleToFit);
52109
}
53110

54-
// Draw the title
111+
// Draw the centered title text
55112
Rect textRect = new Rect(rect.x, rect.y, rect.width, rect.height);
56113
EditorGUI.LabelField(textRect, headerText, style);
114+
115+
// Add spacing below the header
57116
GUILayout.Space(10);
58-
59-
// Draw the default inspector below
60117
}
61118
}
62119
}

Assets/DFTGames/Localization/Demo/Resources/localization/AllText.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,15 @@ title=私の素晴らしい\nゲーム
1010
play=プレイ
1111
opts=オプション
1212
info=インフォ
13+
title My Great\nGame
14+
play Play
15+
opts Settings
16+
info Info
17+
title=Il mio grande\ngioco
18+
play=Gioca
19+
opts=Impostazioni
20+
info=Informazioni
21+
title=私の素晴らしい\nゲーム
22+
play=プレイ
23+
opts=オプション
24+
info=インフォ

0 commit comments

Comments
 (0)