Fix a few bugs and typos (#277)

This commit is contained in:
Casey Hofland 2021-05-04 14:20:22 +02:00 committed by GitHub
parent 64d7f773ee
commit 46400d8df9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 22 deletions

View File

@ -107,25 +107,38 @@ namespace UnityAtoms.Editor
: new GUIContent($"Select Unsafe Type", $"Select from all types, serializable or not. Be aware that some types may not be compatible with all platforms!");
var buttonStyle = GUI.skin.button;
var dropdownRect = EditorGUILayout.GetControlRect(false, buttonStyle.CalcHeight(buttonContent, 0f), buttonStyle);
var toggleLabelRect = new Rect(dropdownRect);
toggleLabelRect.width = 32f;
var toggleRect = new Rect(dropdownRect);
toggleRect.width = 16f;
toggleRect.x += 36f;
var buttonRect = new Rect(dropdownRect);
buttonRect.width -= 20f;
buttonRect.x += 20f;
buttonRect.width -= 56f;
buttonRect.x += 56f;
EditorGUILayout.BeginHorizontal();
EditorGUI.BeginChangeCheck();
safeSearch = EditorGUI.Toggle(toggleRect, safeSearch);
if(EditorGUI.EndChangeCheck())
{
RefreshDropdown();
}
EditorGUI.LabelField(toggleLabelRect, "Safe");
if(GUI.Button(buttonRect, buttonContent))
{
typeSelectorDropdown.Show(dropdownRect);
EditorGUI.BeginChangeCheck();
safeSearch = EditorGUI.Toggle(toggleRect, safeSearch);
if (EditorGUI.EndChangeCheck())
{
RefreshDropdown();
}
if (GUI.Button(buttonRect, buttonContent))
{
typeSelectorDropdown.Show(dropdownRect);
}
}
EditorGUILayout.EndHorizontal();
if(!safeSearch)
{
EditorGUILayout.HelpBox("Safe Search is turned off. Be aware that some types may not be compatible with all platforms.", MessageType.Warning);
}
EditorGUILayout.PropertyField(fullQualifiedName);
// Draw the different generator options and if a file has been generated, draw it in a disabled objectfield as well.

View File

@ -14,14 +14,12 @@ namespace UnityAtoms.Editor
);
public static readonly AtomType EVENT = new AtomType(
displayName: "Event",
templateName: "UA_Template__Event.txt",
editorTemplateName: "UA_Template_AtomEditor__Event.txt"
templateName: "UA_Template__Event.txt"
);
public static readonly AtomType PAIR_EVENT = new AtomType(
displayName: "Pair Event",
name: "Event",
templateName: "UA_Template__Event.txt",
editorTemplateName: "UA_Template_AtomEditor__Event.txt"
templateName: "UA_Template__Event.txt"
);
public static readonly AtomType VALUE_LIST = new AtomType(
displayName: "Value List",
@ -60,8 +58,7 @@ namespace UnityAtoms.Editor
);
public static readonly AtomType VARIABLE = new AtomType(
displayName: "Variable",
templateName: "UA_Template__Variable.txt",
editorTemplateName: "UA_Template_AtomEditor__Variable.txt"
templateName: "UA_Template__Variable.txt"
);
public static readonly AtomType VARIABLE_INSTANCER = new AtomType(
displayName: "Variable Instancer",
@ -71,7 +68,7 @@ namespace UnityAtoms.Editor
public static readonly AtomType EVENT_INSTANCER = new AtomType(
displayName: "Event Instancer",
templateName: "UA_Template__EventInstancer.txt",
editorTemplateName: "UA_Template__AtomEditor_EventInstancer.txt"
editorTemplateName: "UA_Template_AtomEditor__EventInstancer.txt"
);
public static readonly AtomType PAIR_EVENT_INSTANCER = new AtomType(
displayName: "Pair Event Instancer",

View File

@ -1,4 +1,3 @@
#if UNITY_2018_3_OR_NEWER
using System;
using System.Linq;
using System.Collections.Generic;
@ -9,7 +8,7 @@ using UnityEngine;
namespace UnityAtoms.Editor
{
/// <summary>
/// Generator that generates new Atom types based on the input data. Used by the `GeneratorEditor`. Only availble in `UNITY_2019_1_OR_NEWER`.
/// Generator that generates new Atom types based on the input data. Used by the `GeneratorEditor`.
/// </summary>
internal static class Generator
{
@ -163,4 +162,3 @@ namespace UnityAtoms.Editor
}
}
}
#endif

View File

@ -8,9 +8,9 @@ namespace UnityAtoms
<%ENDIF%>
{
/// <summary>
/// Constant of type `{VALUE_TYPE}`. Inherits from `AtomBaseVariable&lt;{VALUE_TYPE}&gt;`.
/// Constant of type `{VALUE_TYPE}`. Inherits from `AtomBaseVariable {VALUE_TYPE} `.
/// </summary>
[EditorIcon("atom-icon-teal")]
[CreateAssetMenu(menuName = "Unity Atoms/Constants/{VALUE_TYPE_NAME}", fileName = "{VALUE_TYPE_NAME}Constant")]
public sealed class {VALUE_TYPE_NAME}Constant : AtomBaseVariable<{VALUE_TYPE}> { }
public sealed class {VALUE_TYPE_NAME}Constant : AtomBaseVariable<{VALUE_TYPE}> {}
}