using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor.AddressableAssets.HostingServices;
using UnityEditor.AddressableAssets.Settings;
using UnityEditor.IMGUI.Controls;
using UnityEngine;
using UnityEngine.Serialization;
namespace UnityEditor.AddressableAssets.GUI
{
using Object = UnityEngine.Object;
///
/// Configuration GUI for
///
[DefaultExecutionOrder(-1)]
public class HostingServicesWindow : EditorWindow, ISerializationCallbackReceiver, ILogHandler
{
const float k_DefaultVerticalSplitterRatio = 0.67f;
const float k_DefaultHorizontalSplitterRatio = 0.33f;
const int k_SplitterThickness = 2;
const int k_ToolbarHeight = 20;
const int k_ItemRectPadding = 15;
const int k_LogRectPadding = 5;
GUIStyle m_ItemRectPadding;
GUIStyle m_LogRectPadding;
[FormerlySerializedAs("m_logText")]
[SerializeField]
string m_LogText;
[FormerlySerializedAs("m_logScrollPos")]
[SerializeField]
Vector2 m_LogScrollPos;
[FormerlySerializedAs("m_servicesScrollPos")]
[SerializeField]
Vector2 m_ServicesScrollPos;
[FormerlySerializedAs("m_splitterRatio")]
[SerializeField]
float m_VerticalSplitterRatio = k_DefaultVerticalSplitterRatio;
float m_HorizontalSplitterRatio = k_DefaultHorizontalSplitterRatio;
[FormerlySerializedAs("m_settings")]
[SerializeField]
AddressableAssetSettings m_Settings;
ILogger m_Logger;
bool m_NewLogContent;
bool m_IsResizingVerticalSplitter;
bool m_IsResizingHorizontalSplitter;
bool m_Reload = false;
int m_serviceIndex = -1;
///
/// Returns the index of the currently selected hosting service.
///
public int ServiceIndex
{
get { return m_serviceIndex; }
set { m_serviceIndex = value; }
}
readonly Dictionary