Small code cleanup
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
|
||||
#if UNITY_EDITOR
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections.Generic;
|
||||
@@ -44,10 +45,10 @@ namespace Ext.B83.Unity.Editor.PropertyDrawers
|
||||
static MonoScriptPropertyDrawer()
|
||||
{
|
||||
m_ScriptCache = new Dictionary<string, MonoScript>();
|
||||
var scripts = Resources.FindObjectsOfTypeAll<MonoScript>();
|
||||
MonoScript[] scripts = Resources.FindObjectsOfTypeAll<MonoScript>();
|
||||
for (int i = 0; i < scripts.Length; i++)
|
||||
{
|
||||
var type = scripts[i].GetClass();
|
||||
Type type = scripts[i].GetClass();
|
||||
if (type != null && !m_ScriptCache.ContainsKey(type.FullName))
|
||||
{
|
||||
m_ScriptCache.Add(type.FullName, scripts[i]);
|
||||
@@ -84,7 +85,7 @@ namespace Ext.B83.Unity.Editor.PropertyDrawers
|
||||
{
|
||||
if (script != null)
|
||||
{
|
||||
var type = script.GetClass();
|
||||
Type type = script.GetClass();
|
||||
MonoScriptAttribute attr = (MonoScriptAttribute)attribute;
|
||||
if (attr.type != null && !attr.type.IsAssignableFrom(type))
|
||||
type = null;
|
||||
|
||||
Reference in New Issue
Block a user