From 6fb0c358e1c90746a5f97e841537ca42aa62990d Mon Sep 17 00:00:00 2001 From: Pasha Date: Thu, 15 Jan 2026 17:27:52 +0000 Subject: [PATCH] Small code cleanup --- Assets/Scripts/.idea/workspace.xml | 16 ++++++++-------- Assets/Scripts/Ext/MonoScriptPropertyDrawer.cs | 7 ++++--- Assets/Scripts/WindowSpawner.cs | 6 +++--- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Assets/Scripts/.idea/workspace.xml b/Assets/Scripts/.idea/workspace.xml index 251db1f..ac542ad 100644 --- a/Assets/Scripts/.idea/workspace.xml +++ b/Assets/Scripts/.idea/workspace.xml @@ -1,10 +1,7 @@ - - - - + - + { + "associatedIndex": 3 +} @@ -42,6 +41,7 @@ diff --git a/Assets/Scripts/Ext/MonoScriptPropertyDrawer.cs b/Assets/Scripts/Ext/MonoScriptPropertyDrawer.cs index 2f249d7..6743379 100644 --- a/Assets/Scripts/Ext/MonoScriptPropertyDrawer.cs +++ b/Assets/Scripts/Ext/MonoScriptPropertyDrawer.cs @@ -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(); - var scripts = Resources.FindObjectsOfTypeAll(); + MonoScript[] scripts = Resources.FindObjectsOfTypeAll(); 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; diff --git a/Assets/Scripts/WindowSpawner.cs b/Assets/Scripts/WindowSpawner.cs index da22ddf..728a355 100644 --- a/Assets/Scripts/WindowSpawner.cs +++ b/Assets/Scripts/WindowSpawner.cs @@ -75,7 +75,7 @@ namespace InterfaceOff return; } - /* Makes sure the WindowInteractions and WindowComponents are setup before passing to user code */ + /* Makes sure the WindowInteractions and WindowComponents are set up before passing to user code */ windowBase.Interactions = go.GetComponent(); windowBase.Interactions.SetAttachedTo(windowBase); @@ -88,8 +88,8 @@ namespace InterfaceOff if (AutoSpawn) { const int TICKS_PER_SECOND = 20; - const int MINIMUM_SPAWN_TIME = 2 * 20; - const int MAXIMUM_SPAWN_TIME = 5 * 20; + const int MINIMUM_SPAWN_TIME = 2 * TICKS_PER_SECOND; + const int MAXIMUM_SPAWN_TIME = 5 * TICKS_PER_SECOND; /* Decreases the spawn counter and spawns if at 0 */ SpawnCounter = Math.Max(0, SpawnCounter - 1);