<commit_before>using UnityEditor;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Fungus;
using Rotorz.ReorderableList;
using System.Linq;

namespace Fungus.Script
{
	[CustomEditor (typeof(FungusScript))]
	public class FungusScriptEditor : Editor 
	{
		public void OnInspectorUpdate()
		{
			Repaint();
		}
		
		public override void OnInspectorGUI() 
		{
			FungusScript t = target as FungusScript;

			if (t != null)
			{
				// Hide the transform component if FungusScript is the only component on the game object
				Component[] components = t.GetComponents(typeof(Component));
				t.transform.hideFlags = (components.Length == 2) ? HideFlags.HideInInspector : HideFlags.None;
			}

			EditorGUI.BeginChangeCheck();

			float stepTime = EditorGUILayout.FloatField(new GUIContent("Step Time", "Minimum time to execute each step"), t.stepTime);<commit_msg>Fixed conditional hiding of transform component<commit_after>using UnityEditor;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Fungus;
using Rotorz.ReorderableList;
using System.Linq;

namespace Fungus.Script
{
	[CustomEditor (typeof(FungusScript))]
	public class FungusScriptEditor : Editor 
	{
		public void OnInspectorUpdate()
		{
			Repaint();
		}
		
		public override void OnInspectorGUI() 
		{
			FungusScript t = target as FungusScript;

			if (t != null)
			{
				// Hide the transform component if FungusScript & Variables are the only components on the game object
				// Gives a bit more room in inspector for editing commands. The transform will become visible if any non-Fungus 
				// components are attached to the game object.
				Component[] components = t.GetComponents(typeof(Component));
				int count = 0;
				foreach (Component component in components)
				{
					System.Type type = component.GetType();
					if (type == typeof(Transform) ||
						type == typeof(FungusScript) ||
					    type == typeof(BooleanVariable) ||
					    type == typeof(IntegerVariable) ||
					    type == typeof(FloatVariable) ||
					    type == typeof(StringVariable))
					{
						count++;
					}
				}
				t.transform.hideFlags = (count == components.Length) ? HideFlags.HideInInspector : HideFlags.None;
			}

			EditorGUI.BeginChangeCheck();

			float stepTime = EditorGUILayout.FloatField(new GUIContent("Step Time", "Minimum time to execute each step"), t.stepTime);
{'fraction_non_alphanumeric': 0.09593023255813954, 'fraction_numerical': 0.0008305647840531562, 'mean_word_length': 3.808383233532934, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1367549', 'n_tokens_mistral': 828, 'n_tokens_neox': 682, 'n_words': 201}