commit
95fa00c675
@ -37,8 +37,9 @@ namespace AsmdefHelper.CustomCreate.Editor {
|
|||||||
var NameTextField = root.Q<TextField>(className: "NameTextField");
|
var NameTextField = root.Q<TextField>(className: "NameTextField");
|
||||||
var AllowUnsafeToggle = root.Q<Toggle>(className: "AllowUnsafeToggle");
|
var AllowUnsafeToggle = root.Q<Toggle>(className: "AllowUnsafeToggle");
|
||||||
var AutoReferencedToggle = root.Q<Toggle>(className: "AutoReferencedToggle");
|
var AutoReferencedToggle = root.Q<Toggle>(className: "AutoReferencedToggle");
|
||||||
var OverrideReferencesToggle = root.Q<Toggle>(className: "OverrideReferencesToggle");
|
|
||||||
var NoEngineReferencesToggle = root.Q<Toggle>(className: "NoEngineReferencesToggle");
|
var NoEngineReferencesToggle = root.Q<Toggle>(className: "NoEngineReferencesToggle");
|
||||||
|
var OverrideReferencesToggle = root.Q<Toggle>(className: "OverrideReferencesToggle");
|
||||||
|
var RootNamespaceTextField = root.Q<TextField>(className: "RootNamespaceTextField");
|
||||||
var IsEditorToggle = root.Q<Toggle>(className: "IsEditorToggle");
|
var IsEditorToggle = root.Q<Toggle>(className: "IsEditorToggle");
|
||||||
var CreateButton = root.Q<Button>(className: "CreateButton");
|
var CreateButton = root.Q<Button>(className: "CreateButton");
|
||||||
|
|
||||||
@ -47,13 +48,23 @@ namespace AsmdefHelper.CustomCreate.Editor {
|
|||||||
var assetPath = AssetDatabase.GetAssetPath(asset);
|
var assetPath = AssetDatabase.GetAssetPath(asset);
|
||||||
var directory = string.IsNullOrWhiteSpace(assetPath) ? "Assets/" : assetPath;
|
var directory = string.IsNullOrWhiteSpace(assetPath) ? "Assets/" : assetPath;
|
||||||
PathTextField.value = directory;
|
PathTextField.value = directory;
|
||||||
NameTextField.value = directory.Replace("Assets/", "").Replace('/', '.');
|
var defaultName = directory.Replace("Assets/", "").Replace('/', '.');
|
||||||
|
NameTextField.value = defaultName;
|
||||||
|
|
||||||
|
// RootNamespace が設定できるのは2020.2以降
|
||||||
|
#if UNITY_2020_2_OR_NEWER
|
||||||
|
RootNamespaceTextField.value = defaultName;
|
||||||
|
#else
|
||||||
|
root.Q<Box>(className: "Box").Remove(RootNamespaceTextField);
|
||||||
|
#endif
|
||||||
// .asmdefを作成して閉じる
|
// .asmdefを作成して閉じる
|
||||||
CreateButton.clickable.clicked += () => {
|
CreateButton.clickable.clicked += () => {
|
||||||
var asmdefName = NameTextField.value;
|
var asmdefName = NameTextField.value;
|
||||||
var asmdef = new AssemblyDefinitionJson {
|
var asmdef = new AssemblyDefinitionJson {
|
||||||
name = asmdefName,
|
name = asmdefName,
|
||||||
|
#if UNITY_2020_2_OR_NEWER
|
||||||
|
rootNamespace = RootNamespaceTextField.value,
|
||||||
|
#endif
|
||||||
allowUnsafeCode = AllowUnsafeToggle.value,
|
allowUnsafeCode = AllowUnsafeToggle.value,
|
||||||
autoReferenced = AutoReferencedToggle.value,
|
autoReferenced = AutoReferencedToggle.value,
|
||||||
overrideReferences = OverrideReferencesToggle.value,
|
overrideReferences = OverrideReferencesToggle.value,
|
||||||
|
@ -6,13 +6,14 @@
|
|||||||
xsi:noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd"
|
xsi:noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd"
|
||||||
>
|
>
|
||||||
<engine:Label class="AsmdefInfo" text="Input your asmdef info"/>
|
<engine:Label class="AsmdefInfo" text="Input your asmdef info"/>
|
||||||
<engine:Box>
|
<engine:Box class="Box">
|
||||||
<engine:TextField class="PathTextField" label="Path" text="ASMDEF_PATH_HERE" readonly="true"/>
|
<engine:TextField class="PathTextField" label="Path" text="ASMDEF_PATH_HERE" readonly="true"/>
|
||||||
<engine:TextField class="NameTextField" label="Name" text="ASMDEF_NAME_HERE"/>
|
<engine:TextField class="NameTextField" label="Name" text="ASMDEF_NAME_HERE"/>
|
||||||
<engine:Toggle class="AllowUnsafeToggle" label="Allow 'unsafe' Code" value="false"/>
|
<engine:Toggle class="AllowUnsafeToggle" label="Allow 'unsafe' Code" value="false"/>
|
||||||
<engine:Toggle class="AutoReferencedToggle" label="Auto Referenced" value="true"/>
|
<engine:Toggle class="AutoReferencedToggle" label="Auto Referenced" value="true"/>
|
||||||
<engine:Toggle class="OverrideReferencesToggle" label="Override Referenced" value="false"/>
|
|
||||||
<engine:Toggle class="NoEngineReferencesToggle" label="No Engine References" value="false"/>
|
<engine:Toggle class="NoEngineReferencesToggle" label="No Engine References" value="false"/>
|
||||||
|
<engine:Toggle class="OverrideReferencesToggle" label="Override Referenced" value="false"/>
|
||||||
|
<engine:TextField class="RootNamespaceTextField" label="Root Namespace" text="ROOT_NAMESPACE_HERE"/>
|
||||||
<engine:Toggle class="IsEditorToggle" label="Is Editor" value="false"/>
|
<engine:Toggle class="IsEditorToggle" label="Is Editor" value="false"/>
|
||||||
<engine:Button class="CreateButton" text="Create" />
|
<engine:Button class="CreateButton" text="Create" />
|
||||||
</engine:Box>
|
</engine:Box>
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
namespace AsmdefHelper.CustomCreate.Editor {
|
namespace AsmdefHelper.CustomCreate.Editor {
|
||||||
public class AssemblyDefinitionJson {
|
public class AssemblyDefinitionJson {
|
||||||
public string name = string.Empty;
|
public string name = string.Empty;
|
||||||
|
#if UNITY_2020_2_OR_NEWER
|
||||||
|
public string rootNamespace = string.Empty;
|
||||||
|
#endif
|
||||||
public string[] references = new string[0];
|
public string[] references = new string[0];
|
||||||
public string[] includePlatforms = new string[0];
|
public string[] includePlatforms = new string[0];
|
||||||
public string[] excludePlatforms = new string[0];
|
public string[] excludePlatforms = new string[0];
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEditor.Experimental.AssetImporters;
|
|
||||||
|
|
||||||
namespace AsmdefHelper.UnityInternal {
|
namespace AsmdefHelper.UnityInternal {
|
||||||
public class InspectorWindowWrapper : EditorWindow{
|
public class InspectorWindowWrapper : EditorWindow{
|
||||||
@ -17,7 +17,7 @@ namespace AsmdefHelper.UnityInternal {
|
|||||||
|
|
||||||
public void AllApply() {
|
public void AllApply() {
|
||||||
foreach (var editor in inspectorWindow.tracker.activeEditors) {
|
foreach (var editor in inspectorWindow.tracker.activeEditors) {
|
||||||
var assetImporterEditor = editor as AssetImporterEditor;
|
var assetImporterEditor = editor as UnityEditor.AssetImporters.AssetImporterEditor;
|
||||||
|
|
||||||
if (assetImporterEditor != null && assetImporterEditor.HasModified()) {
|
if (assetImporterEditor != null && assetImporterEditor.HasModified()) {
|
||||||
assetImporterEditor.ApplyAndImport();
|
assetImporterEditor.ApplyAndImport();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "dev.n5y.asmdefhelper",
|
"name": "dev.n5y.asmdefhelper",
|
||||||
"displayName": "AsmdefHelper",
|
"displayName": "AsmdefHelper",
|
||||||
"version": "0.4.0",
|
"version": "0.4.1",
|
||||||
"unity": "2019.3",
|
"unity": "2019.3",
|
||||||
"description": "Unity assembly definition utilities.",
|
"description": "Unity assembly definition utilities.",
|
||||||
"keywords": ["asmdef", "editor"],
|
"keywords": ["asmdef", "editor"],
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.ide.rider": "1.2.1",
|
"com.unity.ide.rider": "2.0.7",
|
||||||
"com.unity.ide.visualstudio": "2.0.2",
|
"com.unity.ide.visualstudio": "2.0.5",
|
||||||
"com.unity.test-framework": "1.1.16",
|
"com.unity.test-framework": "1.1.19",
|
||||||
"com.unity.modules.ai": "1.0.0",
|
"com.unity.modules.ai": "1.0.0",
|
||||||
"com.unity.modules.androidjni": "1.0.0",
|
"com.unity.modules.androidjni": "1.0.0",
|
||||||
"com.unity.modules.animation": "1.0.0",
|
"com.unity.modules.animation": "1.0.0",
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.ext.nunit": {
|
"com.unity.ext.nunit": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.5",
|
||||||
"depth": 1,
|
"depth": 1,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
"com.unity.ide.rider": {
|
"com.unity.ide.rider": {
|
||||||
"version": "1.2.1",
|
"version": "2.0.7",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -17,18 +17,18 @@
|
|||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
"com.unity.ide.visualstudio": {
|
"com.unity.ide.visualstudio": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.5",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
"com.unity.test-framework": {
|
"com.unity.test-framework": {
|
||||||
"version": "1.1.16",
|
"version": "1.1.19",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.ext.nunit": "1.0.0",
|
"com.unity.ext.nunit": "1.0.5",
|
||||||
"com.unity.modules.imgui": "1.0.0",
|
"com.unity.modules.imgui": "1.0.0",
|
||||||
"com.unity.modules.jsonserialize": "1.0.0"
|
"com.unity.modules.jsonserialize": "1.0.0"
|
||||||
},
|
},
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
m_EditorVersion: 2020.1.6f1
|
m_EditorVersion: 2020.2.0f1
|
||||||
m_EditorVersionWithRevision: 2020.1.6f1 (fc477ca6df10)
|
m_EditorVersionWithRevision: 2020.2.0f1 (3721df5a8b28)
|
||||||
|
@ -72,7 +72,7 @@ And you can also rename an asmdef by one action.
|
|||||||
___
|
___
|
||||||
|
|
||||||
## Environment
|
## Environment
|
||||||
Unity 2020.1.6f1
|
Unity 2020.2.0f1
|
||||||
|
|
||||||
This library use unity internal class, so may be not work (or couse build error) depending your unity vresion.
|
This library use unity internal class, so may be not work (or couse build error) depending your unity vresion.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user