虚拟列表和循环列表提交
This commit is contained in:
@@ -71,8 +71,12 @@ namespace CreatGame.AssetBundle
|
|||||||
IsInitializeAsync = true;
|
IsInitializeAsync = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
public void LoadGameObject(string assetBundleName, Action<GameObject> callback)
|
/// 异步加载资源
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="assetBundleName"></param>
|
||||||
|
/// <param name="callback"></param>
|
||||||
|
public void LoadGameObjectAsync(string assetBundleName, Action<GameObject> callback)
|
||||||
{
|
{
|
||||||
if (assetBundles.TryGetValue(assetBundleName, out var bundle))
|
if (assetBundles.TryGetValue(assetBundleName, out var bundle))
|
||||||
{
|
{
|
||||||
@@ -84,9 +88,9 @@ namespace CreatGame.AssetBundle
|
|||||||
{
|
{
|
||||||
if (handle.Status == AsyncOperationStatus.Succeeded)
|
if (handle.Status == AsyncOperationStatus.Succeeded)
|
||||||
{
|
{
|
||||||
var asset = handle.Result;
|
var assetData = CacheAssetBundles(assetBundleName, handle.Result);
|
||||||
assetBundles.Add(assetBundleName, new AssetBundleData { assetBundleName = assetBundleName, assetBundle = asset });
|
Addressables.Release(handle);
|
||||||
callback?.Invoke(GameObject.Instantiate(asset));
|
callback?.Invoke(GameObject.Instantiate(assetData.assetBundle));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -95,5 +99,41 @@ namespace CreatGame.AssetBundle
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 同步等待加载资源
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="assetBundleName"></param>
|
||||||
|
public GameObject LoadGameObject(string assetBundleName)
|
||||||
|
{
|
||||||
|
if (assetBundles.TryGetValue(assetBundleName, out var bundle))
|
||||||
|
{
|
||||||
|
return GameObject.Instantiate(bundle.assetBundle);
|
||||||
|
}
|
||||||
|
|
||||||
|
var handle = Addressables.LoadAssetAsync<GameObject>(assetBundleName);
|
||||||
|
handle.WaitForCompletion();
|
||||||
|
if (handle.Status == AsyncOperationStatus.Succeeded)
|
||||||
|
{
|
||||||
|
bundle = CacheAssetBundles(assetBundleName, handle.Result);
|
||||||
|
Addressables.Release(handle);
|
||||||
|
|
||||||
|
return GameObject.Instantiate(bundle.assetBundle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.LogError("资源加载失败");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 缓存加载出来的资源
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bundleName"></param>
|
||||||
|
/// <param name="bundle"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private AssetBundleData CacheAssetBundles(string bundleName, GameObject bundle = null)
|
||||||
|
{
|
||||||
|
var data = new AssetBundleData(){assetBundleName = bundleName, assetBundle = GameObject.Instantiate(bundle)};
|
||||||
|
assetBundles.Add(bundleName, data);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -52,7 +52,7 @@ namespace CreatGame.UI
|
|||||||
{
|
{
|
||||||
var view = new T();
|
var view = new T();
|
||||||
//加载预制件
|
//加载预制件
|
||||||
AssetBundleManager.Instance.LoadGameObject(view.PrefabPath, (obj) =>
|
AssetBundleManager.Instance.LoadGameObjectAsync(view.PrefabPath, (obj) =>
|
||||||
{
|
{
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
{
|
{
|
||||||
|
|||||||
8
UnityGame/Assets/Scripts/ThirdParty/LoopList.meta
vendored
Normal file
8
UnityGame/Assets/Scripts/ThirdParty/LoopList.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 42130aa0870f6df4bb6217cc2e5805c3
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
UnityGame/Assets/Scripts/ThirdParty/LoopList/Editor.meta
vendored
Normal file
8
UnityGame/Assets/Scripts/ThirdParty/LoopList/Editor.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b10ceda9bec25b14ea5e190eb9bb0341
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
311
UnityGame/Assets/Scripts/ThirdParty/LoopList/Editor/LoopScrollRectInspector.cs
vendored
Normal file
311
UnityGame/Assets/Scripts/ThirdParty/LoopList/Editor/LoopScrollRectInspector.cs
vendored
Normal file
@@ -0,0 +1,311 @@
|
|||||||
|
using UnityEditor;
|
||||||
|
using UnityEditor.AnimatedValues;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
using UnityEngine.UIElements;
|
||||||
|
|
||||||
|
namespace UnityEditor.UI
|
||||||
|
{
|
||||||
|
[CustomEditor(typeof(LoopScrollRectBase), true)]
|
||||||
|
public class LoopScrollRectInspector : Editor
|
||||||
|
{
|
||||||
|
SerializedProperty m_Content;
|
||||||
|
SerializedProperty m_Horizontal;
|
||||||
|
SerializedProperty m_Vertical;
|
||||||
|
SerializedProperty m_MovementType;
|
||||||
|
SerializedProperty m_Elasticity;
|
||||||
|
SerializedProperty m_Inertia;
|
||||||
|
SerializedProperty m_DecelerationRate;
|
||||||
|
SerializedProperty m_ScrollSensitivity;
|
||||||
|
SerializedProperty m_Viewport;
|
||||||
|
SerializedProperty m_HorizontalScrollbar;
|
||||||
|
SerializedProperty m_VerticalScrollbar;
|
||||||
|
SerializedProperty m_HorizontalScrollbarVisibility;
|
||||||
|
SerializedProperty m_VerticalScrollbarVisibility;
|
||||||
|
SerializedProperty m_HorizontalScrollbarSpacing;
|
||||||
|
SerializedProperty m_VerticalScrollbarSpacing;
|
||||||
|
SerializedProperty m_OnValueChanged;
|
||||||
|
AnimBool m_ShowElasticity;
|
||||||
|
AnimBool m_ShowDecelerationRate;
|
||||||
|
bool m_ViewportIsNotChild, m_HScrollbarIsNotChild, m_VScrollbarIsNotChild;
|
||||||
|
static string s_HError = "For this visibility mode, the Viewport property and the Horizontal Scrollbar property both needs to be set to a Rect Transform that is a child to the Scroll Rect.";
|
||||||
|
static string s_VError = "For this visibility mode, the Viewport property and the Vertical Scrollbar property both needs to be set to a Rect Transform that is a child to the Scroll Rect.";
|
||||||
|
|
||||||
|
//==========LoopScrollRect==========
|
||||||
|
SerializedProperty totalCount;
|
||||||
|
SerializedProperty reverseDirection;
|
||||||
|
|
||||||
|
int firstItem = 0, lastItem = 0, scrollIndex = 0;
|
||||||
|
float firstOffset = 0.0f, lastOffset = 0.0f, scrollOffset = 0;
|
||||||
|
LoopScrollRectBase.ScrollMode scrollMode = LoopScrollRectBase.ScrollMode.ToStart;
|
||||||
|
float scrollSpeed = 1000, scrollTime = 1;
|
||||||
|
|
||||||
|
protected virtual void OnEnable()
|
||||||
|
{
|
||||||
|
m_Content = serializedObject.FindProperty("m_Content");
|
||||||
|
m_Horizontal = serializedObject.FindProperty("m_Horizontal");
|
||||||
|
m_Vertical = serializedObject.FindProperty("m_Vertical");
|
||||||
|
m_MovementType = serializedObject.FindProperty("m_MovementType");
|
||||||
|
m_Elasticity = serializedObject.FindProperty("m_Elasticity");
|
||||||
|
m_Inertia = serializedObject.FindProperty("m_Inertia");
|
||||||
|
m_DecelerationRate = serializedObject.FindProperty("m_DecelerationRate");
|
||||||
|
m_ScrollSensitivity = serializedObject.FindProperty("m_ScrollSensitivity");
|
||||||
|
m_Viewport = serializedObject.FindProperty("m_Viewport");
|
||||||
|
m_HorizontalScrollbar = serializedObject.FindProperty("m_HorizontalScrollbar");
|
||||||
|
m_VerticalScrollbar = serializedObject.FindProperty("m_VerticalScrollbar");
|
||||||
|
m_HorizontalScrollbarVisibility = serializedObject.FindProperty("m_HorizontalScrollbarVisibility");
|
||||||
|
m_VerticalScrollbarVisibility = serializedObject.FindProperty("m_VerticalScrollbarVisibility");
|
||||||
|
m_HorizontalScrollbarSpacing = serializedObject.FindProperty("m_HorizontalScrollbarSpacing");
|
||||||
|
m_VerticalScrollbarSpacing = serializedObject.FindProperty("m_VerticalScrollbarSpacing");
|
||||||
|
m_OnValueChanged = serializedObject.FindProperty("m_OnValueChanged");
|
||||||
|
|
||||||
|
m_ShowElasticity = new AnimBool(Repaint);
|
||||||
|
m_ShowDecelerationRate = new AnimBool(Repaint);
|
||||||
|
SetAnimBools(true);
|
||||||
|
|
||||||
|
//==========LoopScrollRect==========
|
||||||
|
totalCount = serializedObject.FindProperty("totalCount");
|
||||||
|
reverseDirection = serializedObject.FindProperty("reverseDirection");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void OnDisable()
|
||||||
|
{
|
||||||
|
m_ShowElasticity.valueChanged.RemoveListener(Repaint);
|
||||||
|
m_ShowDecelerationRate.valueChanged.RemoveListener(Repaint);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetAnimBools(bool instant)
|
||||||
|
{
|
||||||
|
SetAnimBool(m_ShowElasticity, !m_MovementType.hasMultipleDifferentValues && m_MovementType.enumValueIndex == (int)ScrollRect.MovementType.Elastic, instant);
|
||||||
|
SetAnimBool(m_ShowDecelerationRate, !m_Inertia.hasMultipleDifferentValues && m_Inertia.boolValue == true, instant);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetAnimBool(AnimBool a, bool value, bool instant)
|
||||||
|
{
|
||||||
|
if (instant)
|
||||||
|
a.value = value;
|
||||||
|
else
|
||||||
|
a.target = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CalculateCachedValues()
|
||||||
|
{
|
||||||
|
m_ViewportIsNotChild = false;
|
||||||
|
m_HScrollbarIsNotChild = false;
|
||||||
|
m_VScrollbarIsNotChild = false;
|
||||||
|
if (targets.Length == 1)
|
||||||
|
{
|
||||||
|
Transform transform = ((LoopScrollRectBase)target).transform;
|
||||||
|
if (m_Viewport.objectReferenceValue == null || ((RectTransform)m_Viewport.objectReferenceValue).transform.parent != transform)
|
||||||
|
m_ViewportIsNotChild = true;
|
||||||
|
if (m_HorizontalScrollbar.objectReferenceValue == null || ((Scrollbar)m_HorizontalScrollbar.objectReferenceValue).transform.parent != transform)
|
||||||
|
m_HScrollbarIsNotChild = true;
|
||||||
|
if (m_VerticalScrollbar.objectReferenceValue == null || ((Scrollbar)m_VerticalScrollbar.objectReferenceValue).transform.parent != transform)
|
||||||
|
m_VScrollbarIsNotChild = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnInspectorGUI()
|
||||||
|
{
|
||||||
|
SetAnimBools(false);
|
||||||
|
|
||||||
|
serializedObject.Update();
|
||||||
|
// Once we have a reliable way to know if the object changed, only re-cache in that case.
|
||||||
|
CalculateCachedValues();
|
||||||
|
|
||||||
|
EditorGUILayout.LabelField("Scroll Rect", EditorStyles.boldLabel);
|
||||||
|
EditorGUILayout.PropertyField(m_Content);
|
||||||
|
|
||||||
|
EditorGUILayout.PropertyField(m_Horizontal);
|
||||||
|
EditorGUILayout.PropertyField(m_Vertical);
|
||||||
|
|
||||||
|
EditorGUILayout.PropertyField(m_MovementType);
|
||||||
|
if (EditorGUILayout.BeginFadeGroup(m_ShowElasticity.faded))
|
||||||
|
{
|
||||||
|
EditorGUI.indentLevel++;
|
||||||
|
EditorGUILayout.PropertyField(m_Elasticity);
|
||||||
|
EditorGUI.indentLevel--;
|
||||||
|
}
|
||||||
|
EditorGUILayout.EndFadeGroup();
|
||||||
|
|
||||||
|
EditorGUILayout.PropertyField(m_Inertia);
|
||||||
|
if (EditorGUILayout.BeginFadeGroup(m_ShowDecelerationRate.faded))
|
||||||
|
{
|
||||||
|
EditorGUI.indentLevel++;
|
||||||
|
EditorGUILayout.PropertyField(m_DecelerationRate);
|
||||||
|
EditorGUI.indentLevel--;
|
||||||
|
}
|
||||||
|
EditorGUILayout.EndFadeGroup();
|
||||||
|
|
||||||
|
EditorGUILayout.PropertyField(m_ScrollSensitivity);
|
||||||
|
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
|
EditorGUILayout.PropertyField(m_Viewport);
|
||||||
|
|
||||||
|
EditorGUILayout.PropertyField(m_HorizontalScrollbar);
|
||||||
|
if (m_HorizontalScrollbar.objectReferenceValue && !m_HorizontalScrollbar.hasMultipleDifferentValues)
|
||||||
|
{
|
||||||
|
EditorGUI.indentLevel++;
|
||||||
|
EditorGUILayout.PropertyField(m_HorizontalScrollbarVisibility, EditorGUIUtility.TrTextContent("Visibility"));
|
||||||
|
|
||||||
|
if ((ScrollRect.ScrollbarVisibility)m_HorizontalScrollbarVisibility.enumValueIndex == ScrollRect.ScrollbarVisibility.AutoHideAndExpandViewport
|
||||||
|
&& !m_HorizontalScrollbarVisibility.hasMultipleDifferentValues)
|
||||||
|
{
|
||||||
|
if (m_ViewportIsNotChild || m_HScrollbarIsNotChild)
|
||||||
|
EditorGUILayout.HelpBox(s_HError, MessageType.Error);
|
||||||
|
EditorGUILayout.PropertyField(m_HorizontalScrollbarSpacing, EditorGUIUtility.TrTextContent("Spacing"));
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorGUI.indentLevel--;
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorGUILayout.PropertyField(m_VerticalScrollbar);
|
||||||
|
if (m_VerticalScrollbar.objectReferenceValue && !m_VerticalScrollbar.hasMultipleDifferentValues)
|
||||||
|
{
|
||||||
|
EditorGUI.indentLevel++;
|
||||||
|
EditorGUILayout.PropertyField(m_VerticalScrollbarVisibility, EditorGUIUtility.TrTextContent("Visibility"));
|
||||||
|
|
||||||
|
if ((ScrollRect.ScrollbarVisibility)m_VerticalScrollbarVisibility.enumValueIndex == ScrollRect.ScrollbarVisibility.AutoHideAndExpandViewport
|
||||||
|
&& !m_VerticalScrollbarVisibility.hasMultipleDifferentValues)
|
||||||
|
{
|
||||||
|
if (m_ViewportIsNotChild || m_VScrollbarIsNotChild)
|
||||||
|
EditorGUILayout.HelpBox(s_VError, MessageType.Error);
|
||||||
|
EditorGUILayout.PropertyField(m_VerticalScrollbarSpacing, EditorGUIUtility.TrTextContent("Spacing"));
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorGUI.indentLevel--;
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorGUILayout.PropertyField(m_OnValueChanged);
|
||||||
|
|
||||||
|
//==========LoopScrollRect==========
|
||||||
|
EditorGUILayout.LabelField("Loop Scroll Rect", EditorStyles.boldLabel);
|
||||||
|
EditorGUILayout.PropertyField(totalCount);
|
||||||
|
EditorGUILayout.PropertyField(reverseDirection);
|
||||||
|
|
||||||
|
serializedObject.ApplyModifiedProperties();
|
||||||
|
|
||||||
|
LoopScrollRectBase scroll = (LoopScrollRectBase)target;
|
||||||
|
GUI.enabled = Application.isPlaying;
|
||||||
|
const float buttonWidth = 100f;
|
||||||
|
|
||||||
|
#region Basic Test
|
||||||
|
EditorGUILayout.LabelField("Basic Test", EditorStyles.boldLabel);
|
||||||
|
|
||||||
|
EditorGUILayout.BeginHorizontal();
|
||||||
|
EditorGUILayout.LabelField("Clear existing items");
|
||||||
|
GUILayout.FlexibleSpace();
|
||||||
|
if (GUILayout.Button("Clear", GUILayout.Width(buttonWidth)))
|
||||||
|
{
|
||||||
|
scroll.ClearCells();
|
||||||
|
}
|
||||||
|
EditorGUILayout.EndHorizontal();
|
||||||
|
|
||||||
|
EditorGUILayout.BeginHorizontal();
|
||||||
|
EditorGUILayout.LabelField("Refresh existing items(only update data)");
|
||||||
|
GUILayout.FlexibleSpace();
|
||||||
|
if (GUILayout.Button("Refresh", GUILayout.Width(buttonWidth)))
|
||||||
|
{
|
||||||
|
scroll.RefreshCells();
|
||||||
|
}
|
||||||
|
EditorGUILayout.EndHorizontal();
|
||||||
|
|
||||||
|
EditorGUILayout.BeginHorizontal();
|
||||||
|
EditorGUILayout.LabelField("Refill(0, 0.0f)");
|
||||||
|
GUILayout.FlexibleSpace();
|
||||||
|
if(GUILayout.Button("Refill", GUILayout.Width(buttonWidth)))
|
||||||
|
{
|
||||||
|
scroll.RefillCells();
|
||||||
|
}
|
||||||
|
EditorGUILayout.EndHorizontal();
|
||||||
|
|
||||||
|
EditorGUILayout.BeginHorizontal();
|
||||||
|
EditorGUILayout.LabelField("RefillFromEnd(0, 0.0f)");
|
||||||
|
GUILayout.FlexibleSpace();
|
||||||
|
if(GUILayout.Button("RefillFromEnd", GUILayout.Width(buttonWidth)))
|
||||||
|
{
|
||||||
|
scroll.RefillCellsFromEnd();
|
||||||
|
}
|
||||||
|
EditorGUILayout.EndHorizontal();
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Refill Test
|
||||||
|
EditorGUILayout.LabelField("Refill Test", EditorStyles.boldLabel);
|
||||||
|
|
||||||
|
firstItem = EditorGUILayout.IntField("FirstItem", firstItem);
|
||||||
|
firstOffset = EditorGUILayout.FloatField("FirstOffset", firstOffset);
|
||||||
|
|
||||||
|
EditorGUILayout.BeginHorizontal();
|
||||||
|
EditorGUILayout.LabelField("Get first item and offset");
|
||||||
|
GUILayout.FlexibleSpace();
|
||||||
|
if (GUILayout.Button("GetFirstItem", GUILayout.Width(buttonWidth)))
|
||||||
|
{
|
||||||
|
firstItem = scroll.GetFirstItem(out firstOffset);
|
||||||
|
}
|
||||||
|
EditorGUILayout.EndHorizontal();
|
||||||
|
|
||||||
|
EditorGUILayout.BeginHorizontal();
|
||||||
|
EditorGUILayout.LabelField("Refill with first item and offset");
|
||||||
|
GUILayout.FlexibleSpace();
|
||||||
|
if(GUILayout.Button("Refill", GUILayout.Width(buttonWidth)))
|
||||||
|
{
|
||||||
|
scroll.RefillCells(scroll.reverseDirection ? (scroll.totalCount - firstItem) : firstItem, firstOffset);
|
||||||
|
}
|
||||||
|
EditorGUILayout.EndHorizontal();
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Refill Test
|
||||||
|
EditorGUILayout.LabelField("RefillFromEnd Test", EditorStyles.boldLabel);
|
||||||
|
|
||||||
|
lastItem = EditorGUILayout.IntField("LastItem", lastItem);
|
||||||
|
lastOffset = EditorGUILayout.FloatField("LastOffset", lastOffset);
|
||||||
|
|
||||||
|
EditorGUILayout.BeginHorizontal();
|
||||||
|
EditorGUILayout.LabelField("Get last item and offset");
|
||||||
|
GUILayout.FlexibleSpace();
|
||||||
|
if (GUILayout.Button("GetLastItem", GUILayout.Width(buttonWidth)))
|
||||||
|
{
|
||||||
|
lastItem = scroll.GetLastItem(out lastOffset);
|
||||||
|
}
|
||||||
|
EditorGUILayout.EndHorizontal();
|
||||||
|
|
||||||
|
EditorGUILayout.BeginHorizontal();
|
||||||
|
EditorGUILayout.LabelField("RefillFromEnd with last item and offset");
|
||||||
|
GUILayout.FlexibleSpace();
|
||||||
|
if(GUILayout.Button("RefillFromEnd", GUILayout.Width(buttonWidth)))
|
||||||
|
{
|
||||||
|
scroll.RefillCellsFromEnd(scroll.reverseDirection ? lastItem : (scroll.totalCount - lastItem), lastOffset);
|
||||||
|
}
|
||||||
|
EditorGUILayout.EndHorizontal();
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Scroll Test
|
||||||
|
EditorGUILayout.LabelField("Scroll Test", EditorStyles.boldLabel);
|
||||||
|
scrollIndex = EditorGUILayout.IntField("ScrollIndex", scrollIndex);
|
||||||
|
scrollOffset = EditorGUILayout.FloatField("ScrollOffset", scrollOffset);
|
||||||
|
scrollMode = (LoopScrollRectBase.ScrollMode)EditorGUILayout.EnumPopup("Mode", scrollMode);
|
||||||
|
|
||||||
|
scrollSpeed = EditorGUILayout.FloatField("Speed", scrollSpeed);
|
||||||
|
EditorGUILayout.BeginHorizontal();
|
||||||
|
EditorGUILayout.LabelField("Scroll to index and offset with speed");
|
||||||
|
GUILayout.FlexibleSpace();
|
||||||
|
if(GUILayout.Button("ScrollToCell", GUILayout.Width(buttonWidth)))
|
||||||
|
{
|
||||||
|
scroll.ScrollToCell(scrollIndex, scrollSpeed, scrollOffset, scrollMode);
|
||||||
|
}
|
||||||
|
EditorGUILayout.EndHorizontal();
|
||||||
|
|
||||||
|
scrollTime = EditorGUILayout.FloatField("Time", scrollTime);
|
||||||
|
EditorGUILayout.BeginHorizontal();
|
||||||
|
EditorGUILayout.LabelField("Scroll to index and offset whtin time");
|
||||||
|
GUILayout.FlexibleSpace();
|
||||||
|
if(GUILayout.Button("ScrollToCellWithinTime", GUILayout.Width(buttonWidth)))
|
||||||
|
{
|
||||||
|
scroll.ScrollToCellWithinTime(scrollIndex, scrollTime, scrollOffset, scrollMode);
|
||||||
|
}
|
||||||
|
EditorGUILayout.EndHorizontal();
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Editor/LoopScrollRectInspector.cs.meta
vendored
Normal file
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Editor/LoopScrollRectInspector.cs.meta
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 216d44a40b90b944db6c5f4624768e58
|
||||||
|
timeCreated: 1439395663
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
182
UnityGame/Assets/Scripts/ThirdParty/LoopList/Editor/SGDefaultControls.cs
vendored
Normal file
182
UnityGame/Assets/Scripts/ThirdParty/LoopList/Editor/SGDefaultControls.cs
vendored
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace UnityEngine.UI
|
||||||
|
{
|
||||||
|
public static class SGDefaultControls
|
||||||
|
{
|
||||||
|
#region code from DefaultControls.cs
|
||||||
|
public struct Resources
|
||||||
|
{
|
||||||
|
public Sprite standard;
|
||||||
|
public Sprite background;
|
||||||
|
public Sprite inputField;
|
||||||
|
public Sprite knob;
|
||||||
|
public Sprite checkmark;
|
||||||
|
public Sprite dropdown;
|
||||||
|
public Sprite mask;
|
||||||
|
}
|
||||||
|
|
||||||
|
private const float kWidth = 160f;
|
||||||
|
private const float kThickHeight = 30f;
|
||||||
|
private const float kThinHeight = 20f;
|
||||||
|
//private static Vector2 s_ThickElementSize = new Vector2(kWidth, kThickHeight);
|
||||||
|
//private static Vector2 s_ThinElementSize = new Vector2(kWidth, kThinHeight);
|
||||||
|
//private static Vector2 s_ImageElementSize = new Vector2(100f, 100f);
|
||||||
|
//private static Color s_DefaultSelectableColor = new Color(1f, 1f, 1f, 1f);
|
||||||
|
//private static Color s_PanelColor = new Color(1f, 1f, 1f, 0.392f);
|
||||||
|
private static Color s_TextColor = new Color(50f / 255f, 50f / 255f, 50f / 255f, 1f);
|
||||||
|
|
||||||
|
// Helper methods at top
|
||||||
|
|
||||||
|
private static GameObject CreateUIElementRoot(string name, Vector2 size)
|
||||||
|
{
|
||||||
|
GameObject child = new GameObject(name);
|
||||||
|
RectTransform rectTransform = child.AddComponent<RectTransform>();
|
||||||
|
rectTransform.sizeDelta = size;
|
||||||
|
return child;
|
||||||
|
}
|
||||||
|
|
||||||
|
static GameObject CreateUIObject(string name, GameObject parent)
|
||||||
|
{
|
||||||
|
GameObject go = new GameObject(name);
|
||||||
|
go.AddComponent<RectTransform>();
|
||||||
|
SetParentAndAlign(go, parent);
|
||||||
|
return go;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SetDefaultTextValues(Text lbl)
|
||||||
|
{
|
||||||
|
// Set text values we want across UI elements in default controls.
|
||||||
|
// Don't set values which are the same as the default values for the Text component,
|
||||||
|
// since there's no point in that, and it's good to keep them as consistent as possible.
|
||||||
|
lbl.color = s_TextColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SetDefaultColorTransitionValues(Selectable slider)
|
||||||
|
{
|
||||||
|
ColorBlock colors = slider.colors;
|
||||||
|
colors.highlightedColor = new Color(0.882f, 0.882f, 0.882f);
|
||||||
|
colors.pressedColor = new Color(0.698f, 0.698f, 0.698f);
|
||||||
|
colors.disabledColor = new Color(0.521f, 0.521f, 0.521f);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SetParentAndAlign(GameObject child, GameObject parent)
|
||||||
|
{
|
||||||
|
if (parent == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
child.transform.SetParent(parent.transform, false);
|
||||||
|
SetLayerRecursively(child, parent.layer);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SetLayerRecursively(GameObject go, int layer)
|
||||||
|
{
|
||||||
|
go.layer = layer;
|
||||||
|
Transform t = go.transform;
|
||||||
|
for (int i = 0; i < t.childCount; i++)
|
||||||
|
SetLayerRecursively(t.GetChild(i).gameObject, layer);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public static GameObject CreateLoopHorizontalScrollRect(DefaultControls.Resources resources)
|
||||||
|
{
|
||||||
|
GameObject root = CreateUIElementRoot("Loop Horizontal Scroll Rect", new Vector2(200, 200));
|
||||||
|
|
||||||
|
GameObject viewport = CreateUIObject("Viewport", root);
|
||||||
|
|
||||||
|
RectTransform viewportRT = viewport.GetComponent<RectTransform>();
|
||||||
|
viewportRT.anchorMin = new Vector2(0, 0);
|
||||||
|
viewportRT.anchorMax = new Vector2(1, 1);
|
||||||
|
viewportRT.sizeDelta = new Vector2(0, 0);
|
||||||
|
viewportRT.pivot = new Vector2(0.5f, 0.5f);
|
||||||
|
|
||||||
|
viewport.AddComponent<RectMask2D>();
|
||||||
|
|
||||||
|
GameObject content = CreateUIObject("Content", viewport);
|
||||||
|
|
||||||
|
RectTransform contentRT = content.GetComponent<RectTransform>();
|
||||||
|
contentRT.anchorMin = new Vector2(0, 0);
|
||||||
|
contentRT.anchorMax = new Vector2(0, 1);
|
||||||
|
contentRT.sizeDelta = new Vector2(0, 0);
|
||||||
|
contentRT.pivot = new Vector2(0, 0.5f);
|
||||||
|
|
||||||
|
// Setup UI components.
|
||||||
|
|
||||||
|
LoopHorizontalScrollRect scrollRect = root.AddComponent<LoopHorizontalScrollRect>();
|
||||||
|
scrollRect.content = contentRT;
|
||||||
|
scrollRect.viewport = viewportRT;
|
||||||
|
scrollRect.horizontalScrollbar = null;
|
||||||
|
scrollRect.verticalScrollbar = null;
|
||||||
|
scrollRect.horizontal = true;
|
||||||
|
scrollRect.vertical = false;
|
||||||
|
scrollRect.horizontalScrollbarVisibility = LoopScrollRect.ScrollbarVisibility.Permanent;
|
||||||
|
scrollRect.verticalScrollbarVisibility = LoopScrollRect.ScrollbarVisibility.Permanent;
|
||||||
|
scrollRect.horizontalScrollbarSpacing = 0;
|
||||||
|
scrollRect.verticalScrollbarSpacing = 0;
|
||||||
|
|
||||||
|
root.AddComponent<CreatGame.UI.UILoopList>();
|
||||||
|
|
||||||
|
HorizontalLayoutGroup layoutGroup = content.AddComponent<HorizontalLayoutGroup>();
|
||||||
|
layoutGroup.childAlignment = TextAnchor.MiddleLeft;
|
||||||
|
layoutGroup.childForceExpandWidth = false;
|
||||||
|
layoutGroup.childForceExpandHeight = true;
|
||||||
|
|
||||||
|
ContentSizeFitter sizeFitter = content.AddComponent<ContentSizeFitter>();
|
||||||
|
sizeFitter.horizontalFit = ContentSizeFitter.FitMode.PreferredSize;
|
||||||
|
sizeFitter.verticalFit = ContentSizeFitter.FitMode.Unconstrained;
|
||||||
|
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GameObject CreateLoopVerticalScrollRect(DefaultControls.Resources resources)
|
||||||
|
{
|
||||||
|
GameObject root = CreateUIElementRoot("Loop Vertical Scroll Rect", new Vector2(200, 200));
|
||||||
|
|
||||||
|
GameObject viewport = CreateUIObject("Viewport", root);
|
||||||
|
|
||||||
|
RectTransform viewportRT = viewport.GetComponent<RectTransform>();
|
||||||
|
viewportRT.anchorMin = new Vector2(0, 0);
|
||||||
|
viewportRT.anchorMax = new Vector2(1, 1);
|
||||||
|
viewportRT.sizeDelta = new Vector2(0, 0);
|
||||||
|
viewportRT.pivot = new Vector2(0.5f, 0.5f);
|
||||||
|
|
||||||
|
viewport.AddComponent<RectMask2D>();
|
||||||
|
|
||||||
|
GameObject content = CreateUIObject("Content", viewport);
|
||||||
|
|
||||||
|
RectTransform contentRT = content.GetComponent<RectTransform>();
|
||||||
|
contentRT.anchorMin = new Vector2(0, 1);
|
||||||
|
contentRT.anchorMax = new Vector2(1, 1);
|
||||||
|
contentRT.sizeDelta = new Vector2(0, 0);
|
||||||
|
contentRT.pivot = new Vector2(0.5f, 1);
|
||||||
|
|
||||||
|
// Setup UI components.
|
||||||
|
|
||||||
|
LoopVerticalScrollRect scrollRect = root.AddComponent<LoopVerticalScrollRect>();
|
||||||
|
scrollRect.content = contentRT;
|
||||||
|
scrollRect.viewport = viewportRT;
|
||||||
|
scrollRect.horizontalScrollbar = null;
|
||||||
|
scrollRect.verticalScrollbar = null;
|
||||||
|
scrollRect.horizontal = false;
|
||||||
|
scrollRect.vertical = true;
|
||||||
|
scrollRect.horizontalScrollbarVisibility = LoopScrollRect.ScrollbarVisibility.Permanent;
|
||||||
|
scrollRect.verticalScrollbarVisibility = LoopScrollRect.ScrollbarVisibility.Permanent;
|
||||||
|
scrollRect.horizontalScrollbarSpacing = 0;
|
||||||
|
scrollRect.verticalScrollbarSpacing = 0;
|
||||||
|
|
||||||
|
root.AddComponent<CreatGame.UI.UILoopList>();
|
||||||
|
|
||||||
|
VerticalLayoutGroup layoutGroup = content.AddComponent<VerticalLayoutGroup>();
|
||||||
|
layoutGroup.childAlignment = TextAnchor.UpperCenter;
|
||||||
|
layoutGroup.childForceExpandWidth = true;
|
||||||
|
layoutGroup.childForceExpandHeight = false;
|
||||||
|
|
||||||
|
ContentSizeFitter sizeFitter = content.AddComponent<ContentSizeFitter>();
|
||||||
|
sizeFitter.horizontalFit = ContentSizeFitter.FitMode.Unconstrained;
|
||||||
|
sizeFitter.verticalFit = ContentSizeFitter.FitMode.PreferredSize;
|
||||||
|
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Editor/SGDefaultControls.cs.meta
vendored
Normal file
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Editor/SGDefaultControls.cs.meta
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9e2cfa47387224a4eb069fc6dc8ac8b3
|
||||||
|
timeCreated: 1476279563
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
151
UnityGame/Assets/Scripts/ThirdParty/LoopList/Editor/SGMenuOptions.cs
vendored
Normal file
151
UnityGame/Assets/Scripts/ThirdParty/LoopList/Editor/SGMenuOptions.cs
vendored
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace UnityEditor.UI
|
||||||
|
{
|
||||||
|
static internal class SGMenuOptions
|
||||||
|
{
|
||||||
|
#region code from MenuOptions.cs
|
||||||
|
private const string kUILayerName = "UI";
|
||||||
|
|
||||||
|
private const string kStandardSpritePath = "UI/Skin/UISprite.psd";
|
||||||
|
private const string kBackgroundSpritePath = "UI/Skin/Background.psd";
|
||||||
|
private const string kInputFieldBackgroundPath = "UI/Skin/InputFieldBackground.psd";
|
||||||
|
private const string kKnobPath = "UI/Skin/Knob.psd";
|
||||||
|
private const string kCheckmarkPath = "UI/Skin/Checkmark.psd";
|
||||||
|
private const string kDropdownArrowPath = "UI/Skin/DropdownArrow.psd";
|
||||||
|
private const string kMaskPath = "UI/Skin/UIMask.psd";
|
||||||
|
|
||||||
|
static private DefaultControls.Resources s_StandardResources;
|
||||||
|
|
||||||
|
static private DefaultControls.Resources GetStandardResources()
|
||||||
|
{
|
||||||
|
if (s_StandardResources.standard == null)
|
||||||
|
{
|
||||||
|
s_StandardResources.standard = AssetDatabase.GetBuiltinExtraResource<Sprite>(kStandardSpritePath);
|
||||||
|
s_StandardResources.background = AssetDatabase.GetBuiltinExtraResource<Sprite>(kBackgroundSpritePath);
|
||||||
|
s_StandardResources.inputField = AssetDatabase.GetBuiltinExtraResource<Sprite>(kInputFieldBackgroundPath);
|
||||||
|
s_StandardResources.knob = AssetDatabase.GetBuiltinExtraResource<Sprite>(kKnobPath);
|
||||||
|
s_StandardResources.checkmark = AssetDatabase.GetBuiltinExtraResource<Sprite>(kCheckmarkPath);
|
||||||
|
s_StandardResources.dropdown = AssetDatabase.GetBuiltinExtraResource<Sprite>(kDropdownArrowPath);
|
||||||
|
s_StandardResources.mask = AssetDatabase.GetBuiltinExtraResource<Sprite>(kMaskPath);
|
||||||
|
}
|
||||||
|
return s_StandardResources;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SetPositionVisibleinSceneView(RectTransform canvasRTransform, RectTransform itemTransform)
|
||||||
|
{
|
||||||
|
// Find the best scene view
|
||||||
|
SceneView sceneView = SceneView.lastActiveSceneView;
|
||||||
|
if (sceneView == null && SceneView.sceneViews.Count > 0)
|
||||||
|
sceneView = SceneView.sceneViews[0] as SceneView;
|
||||||
|
|
||||||
|
// Couldn't find a SceneView. Don't set position.
|
||||||
|
if (sceneView == null || sceneView.camera == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Create world space Plane from canvas position.
|
||||||
|
Vector2 localPlanePosition;
|
||||||
|
Camera camera = sceneView.camera;
|
||||||
|
Vector3 position = Vector3.zero;
|
||||||
|
if (RectTransformUtility.ScreenPointToLocalPointInRectangle(canvasRTransform, new Vector2(camera.pixelWidth / 2, camera.pixelHeight / 2), camera, out localPlanePosition))
|
||||||
|
{
|
||||||
|
// Adjust for canvas pivot
|
||||||
|
localPlanePosition.x = localPlanePosition.x + canvasRTransform.sizeDelta.x * canvasRTransform.pivot.x;
|
||||||
|
localPlanePosition.y = localPlanePosition.y + canvasRTransform.sizeDelta.y * canvasRTransform.pivot.y;
|
||||||
|
|
||||||
|
localPlanePosition.x = Mathf.Clamp(localPlanePosition.x, 0, canvasRTransform.sizeDelta.x);
|
||||||
|
localPlanePosition.y = Mathf.Clamp(localPlanePosition.y, 0, canvasRTransform.sizeDelta.y);
|
||||||
|
|
||||||
|
// Adjust for anchoring
|
||||||
|
position.x = localPlanePosition.x - canvasRTransform.sizeDelta.x * itemTransform.anchorMin.x;
|
||||||
|
position.y = localPlanePosition.y - canvasRTransform.sizeDelta.y * itemTransform.anchorMin.y;
|
||||||
|
|
||||||
|
Vector3 minLocalPosition;
|
||||||
|
minLocalPosition.x = canvasRTransform.sizeDelta.x * (0 - canvasRTransform.pivot.x) + itemTransform.sizeDelta.x * itemTransform.pivot.x;
|
||||||
|
minLocalPosition.y = canvasRTransform.sizeDelta.y * (0 - canvasRTransform.pivot.y) + itemTransform.sizeDelta.y * itemTransform.pivot.y;
|
||||||
|
|
||||||
|
Vector3 maxLocalPosition;
|
||||||
|
maxLocalPosition.x = canvasRTransform.sizeDelta.x * (1 - canvasRTransform.pivot.x) - itemTransform.sizeDelta.x * itemTransform.pivot.x;
|
||||||
|
maxLocalPosition.y = canvasRTransform.sizeDelta.y * (1 - canvasRTransform.pivot.y) - itemTransform.sizeDelta.y * itemTransform.pivot.y;
|
||||||
|
|
||||||
|
position.x = Mathf.Clamp(position.x, minLocalPosition.x, maxLocalPosition.x);
|
||||||
|
position.y = Mathf.Clamp(position.y, minLocalPosition.y, maxLocalPosition.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
itemTransform.anchoredPosition = position;
|
||||||
|
itemTransform.localRotation = Quaternion.identity;
|
||||||
|
itemTransform.localScale = Vector3.one;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void PlaceUIElementRoot(GameObject element, MenuCommand menuCommand)
|
||||||
|
{
|
||||||
|
GameObject parent = menuCommand.context as GameObject;
|
||||||
|
if (parent == null || parent.GetComponentInParent<Canvas>() == null)
|
||||||
|
{
|
||||||
|
parent = GetOrCreateCanvasGameObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
string uniqueName = GameObjectUtility.GetUniqueNameForSibling(parent.transform, element.name);
|
||||||
|
element.name = uniqueName;
|
||||||
|
Undo.RegisterCreatedObjectUndo(element, "Create " + element.name);
|
||||||
|
Undo.SetTransformParent(element.transform, parent.transform, "Parent " + element.name);
|
||||||
|
GameObjectUtility.SetParentAndAlign(element, parent);
|
||||||
|
if (parent != menuCommand.context) // not a context click, so center in sceneview
|
||||||
|
SetPositionVisibleinSceneView(parent.GetComponent<RectTransform>(), element.GetComponent<RectTransform>());
|
||||||
|
|
||||||
|
Selection.activeGameObject = element;
|
||||||
|
}
|
||||||
|
|
||||||
|
static public GameObject CreateNewUI()
|
||||||
|
{
|
||||||
|
// Root for the UI
|
||||||
|
var root = new GameObject("Canvas");
|
||||||
|
root.layer = LayerMask.NameToLayer(kUILayerName);
|
||||||
|
Canvas canvas = root.AddComponent<Canvas>();
|
||||||
|
canvas.renderMode = RenderMode.ScreenSpaceOverlay;
|
||||||
|
root.AddComponent<CanvasScaler>();
|
||||||
|
root.AddComponent<GraphicRaycaster>();
|
||||||
|
Undo.RegisterCreatedObjectUndo(root, "Create " + root.name);
|
||||||
|
|
||||||
|
// if there is no event system add one...
|
||||||
|
// CreateEventSystem(false);
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function that returns a Canvas GameObject; preferably a parent of the selection, or other existing Canvas.
|
||||||
|
static public GameObject GetOrCreateCanvasGameObject()
|
||||||
|
{
|
||||||
|
GameObject selectedGo = Selection.activeGameObject;
|
||||||
|
|
||||||
|
// Try to find a gameobject that is the selected GO or one if its parents.
|
||||||
|
Canvas canvas = (selectedGo != null) ? selectedGo.GetComponentInParent<Canvas>() : null;
|
||||||
|
if (canvas != null && canvas.gameObject.activeInHierarchy)
|
||||||
|
return canvas.gameObject;
|
||||||
|
|
||||||
|
// No canvas in selection or its parents? Then use just any canvas..
|
||||||
|
canvas = Object.FindObjectOfType(typeof(Canvas)) as Canvas;
|
||||||
|
if (canvas != null && canvas.gameObject.activeInHierarchy)
|
||||||
|
return canvas.gameObject;
|
||||||
|
|
||||||
|
// No canvas in the scene at all? Then create a new one.
|
||||||
|
return SGMenuOptions.CreateNewUI();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
[MenuItem("GameObject/UI/Loop Horizontal Scroll Rect", false, 2151)]
|
||||||
|
static public void AddLoopHorizontalScrollRect(MenuCommand menuCommand)
|
||||||
|
{
|
||||||
|
GameObject go = SGDefaultControls.CreateLoopHorizontalScrollRect(GetStandardResources());
|
||||||
|
PlaceUIElementRoot(go, menuCommand);
|
||||||
|
}
|
||||||
|
|
||||||
|
[MenuItem("GameObject/UI/Loop Vertical Scroll Rect", false, 2152)]
|
||||||
|
static public void AddLoopVerticalScrollRect(MenuCommand menuCommand)
|
||||||
|
{
|
||||||
|
GameObject go = SGDefaultControls.CreateLoopVerticalScrollRect(GetStandardResources());
|
||||||
|
PlaceUIElementRoot(go, menuCommand);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Editor/SGMenuOptions.cs.meta
vendored
Normal file
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Editor/SGMenuOptions.cs.meta
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c4b63bf28f5af0e42a464ac316fef603
|
||||||
|
timeCreated: 1476279563
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime.meta
vendored
Normal file
8
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ec0ddcd49b026ab4fb6b7d49fd693e57
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
188
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopHorizontalScrollRect.cs
vendored
Normal file
188
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopHorizontalScrollRect.cs
vendored
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
namespace UnityEngine.UI
|
||||||
|
{
|
||||||
|
[AddComponentMenu("UI/Loop Horizontal Scroll Rect", 50)]
|
||||||
|
[DisallowMultipleComponent]
|
||||||
|
public class LoopHorizontalScrollRect : LoopScrollRect
|
||||||
|
{
|
||||||
|
protected LoopHorizontalScrollRect()
|
||||||
|
{
|
||||||
|
direction = LoopScrollRectDirection.Horizontal;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override float GetSize(RectTransform item, bool includeSpacing)
|
||||||
|
{
|
||||||
|
float size = includeSpacing ? contentSpacing : 0;
|
||||||
|
if (m_GridLayout != null)
|
||||||
|
{
|
||||||
|
size += m_GridLayout.cellSize.x;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
size += LoopScrollSizeUtils.GetPreferredWidth(item);
|
||||||
|
}
|
||||||
|
size *= m_Content.localScale.x;
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override float GetDimension(Vector2 vector)
|
||||||
|
{
|
||||||
|
return -vector.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override float GetAbsDimension(Vector2 vector)
|
||||||
|
{
|
||||||
|
return vector.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Vector2 GetVector(float value)
|
||||||
|
{
|
||||||
|
return new Vector2(-value, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Awake()
|
||||||
|
{
|
||||||
|
base.Awake();
|
||||||
|
if (m_Content)
|
||||||
|
{
|
||||||
|
GridLayoutGroup layout = m_Content.GetComponent<GridLayoutGroup>();
|
||||||
|
if (layout != null && layout.constraint != GridLayoutGroup.Constraint.FixedRowCount)
|
||||||
|
{
|
||||||
|
Debug.LogError("[LoopScrollRect] unsupported GridLayoutGroup constraint");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool UpdateItems(ref Bounds viewBounds, ref Bounds contentBounds)
|
||||||
|
{
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
|
// special case: handling move several page in one frame
|
||||||
|
if ((viewBounds.size.x < contentBounds.min.x - viewBounds.max.x) && itemTypeEnd > itemTypeStart)
|
||||||
|
{
|
||||||
|
float currentSize = contentBounds.size.x;
|
||||||
|
float elementSize = EstimiateElementSize();
|
||||||
|
ReturnToTempPool(false, itemTypeEnd - itemTypeStart);
|
||||||
|
itemTypeEnd = itemTypeStart;
|
||||||
|
|
||||||
|
int offsetCount = Mathf.FloorToInt((contentBounds.min.x - viewBounds.max.x) / (elementSize + contentSpacing));
|
||||||
|
if (totalCount >= 0 && itemTypeStart - offsetCount * contentConstraintCount < 0)
|
||||||
|
{
|
||||||
|
offsetCount = Mathf.FloorToInt((float)(itemTypeStart) / contentConstraintCount);
|
||||||
|
}
|
||||||
|
itemTypeStart -= offsetCount * contentConstraintCount;
|
||||||
|
if (totalCount >= 0)
|
||||||
|
{
|
||||||
|
itemTypeStart = Mathf.Max(itemTypeStart, 0);
|
||||||
|
}
|
||||||
|
itemTypeEnd = itemTypeStart;
|
||||||
|
itemTypeSize = 0;
|
||||||
|
|
||||||
|
float offset = offsetCount * (elementSize + contentSpacing);
|
||||||
|
m_Content.anchoredPosition -= new Vector2(offset + (reverseDirection ? currentSize : 0), 0);
|
||||||
|
contentBounds.center -= new Vector3(offset + currentSize / 2, 0, 0);
|
||||||
|
contentBounds.size = Vector3.zero;
|
||||||
|
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((viewBounds.min.x - contentBounds.max.x > viewBounds.size.x) && itemTypeEnd > itemTypeStart)
|
||||||
|
{
|
||||||
|
int maxItemTypeStart = -1;
|
||||||
|
if (totalCount >= 0)
|
||||||
|
{
|
||||||
|
maxItemTypeStart = Mathf.Max(0, totalCount - (itemTypeEnd - itemTypeStart));
|
||||||
|
maxItemTypeStart = (maxItemTypeStart / contentConstraintCount) * contentConstraintCount;
|
||||||
|
}
|
||||||
|
float currentSize = contentBounds.size.x;
|
||||||
|
float elementSize = EstimiateElementSize();
|
||||||
|
ReturnToTempPool(true, itemTypeEnd - itemTypeStart);
|
||||||
|
// TODO: fix with contentConstraint?
|
||||||
|
itemTypeStart = itemTypeEnd;
|
||||||
|
|
||||||
|
int offsetCount = Mathf.FloorToInt((viewBounds.min.x - contentBounds.max.x) / (elementSize + contentSpacing));
|
||||||
|
if (maxItemTypeStart >= 0 && itemTypeStart + offsetCount * contentConstraintCount > maxItemTypeStart)
|
||||||
|
{
|
||||||
|
offsetCount = Mathf.FloorToInt((float)(maxItemTypeStart - itemTypeStart) / contentConstraintCount);
|
||||||
|
}
|
||||||
|
itemTypeStart += offsetCount * contentConstraintCount;
|
||||||
|
if (totalCount >= 0)
|
||||||
|
{
|
||||||
|
itemTypeStart = Mathf.Max(itemTypeStart, 0);
|
||||||
|
}
|
||||||
|
itemTypeEnd = itemTypeStart;
|
||||||
|
itemTypeSize = 0;
|
||||||
|
|
||||||
|
float offset = offsetCount * (elementSize + contentSpacing);
|
||||||
|
m_Content.anchoredPosition += new Vector2(offset + (reverseDirection ? 0 : currentSize), 0);
|
||||||
|
contentBounds.center += new Vector3(offset + currentSize / 2, 0, 0);
|
||||||
|
contentBounds.size = Vector3.zero;
|
||||||
|
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewBounds.max.x > contentBounds.max.x - m_ContentRightPadding)
|
||||||
|
{
|
||||||
|
float size = NewItemAtEnd(), totalSize = size;
|
||||||
|
while (size > 0 && viewBounds.max.x > contentBounds.max.x - m_ContentRightPadding + totalSize)
|
||||||
|
{
|
||||||
|
size = NewItemAtEnd();
|
||||||
|
totalSize += size;
|
||||||
|
}
|
||||||
|
if (totalSize > 0)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
else if ((itemTypeEnd % contentConstraintCount != 0) && (itemTypeEnd < totalCount || totalCount < 0))
|
||||||
|
{
|
||||||
|
NewItemAtEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewBounds.min.x < contentBounds.min.x + m_ContentLeftPadding)
|
||||||
|
{
|
||||||
|
float size = NewItemAtStart(), totalSize = size;
|
||||||
|
while (size > 0 && viewBounds.min.x < contentBounds.min.x + m_ContentLeftPadding - totalSize)
|
||||||
|
{
|
||||||
|
size = NewItemAtStart();
|
||||||
|
totalSize += size;
|
||||||
|
}
|
||||||
|
if (totalSize > 0)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewBounds.max.x < contentBounds.max.x - threshold - m_ContentRightPadding
|
||||||
|
&& viewBounds.size.x < contentBounds.size.x - threshold)
|
||||||
|
{
|
||||||
|
float size = DeleteItemAtEnd(), totalSize = size;
|
||||||
|
while (size > 0 && viewBounds.max.x < contentBounds.max.x - threshold - m_ContentRightPadding - totalSize)
|
||||||
|
{
|
||||||
|
size = DeleteItemAtEnd();
|
||||||
|
totalSize += size;
|
||||||
|
}
|
||||||
|
if (totalSize > 0)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewBounds.min.x > contentBounds.min.x + threshold + m_ContentLeftPadding
|
||||||
|
&& viewBounds.size.x < contentBounds.size.x - threshold)
|
||||||
|
{
|
||||||
|
float size = DeleteItemAtStart(), totalSize = size;
|
||||||
|
while (size > 0 && viewBounds.min.x > contentBounds.min.x + threshold + m_ContentLeftPadding + totalSize)
|
||||||
|
{
|
||||||
|
size = DeleteItemAtStart();
|
||||||
|
totalSize += size;
|
||||||
|
}
|
||||||
|
if (totalSize > 0)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed)
|
||||||
|
{
|
||||||
|
ClearTempPool();
|
||||||
|
}
|
||||||
|
|
||||||
|
return changed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopHorizontalScrollRect.cs.meta
vendored
Normal file
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopHorizontalScrollRect.cs.meta
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ab7b38d60c9f6a944831d24146f39793
|
||||||
|
timeCreated: 1439395663
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
188
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopHorizontalScrollRectMulti.cs
vendored
Normal file
188
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopHorizontalScrollRectMulti.cs
vendored
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
namespace UnityEngine.UI
|
||||||
|
{
|
||||||
|
[AddComponentMenu("UI/Loop Horizontal Scroll Rect(MultiPrefab)", 52)]
|
||||||
|
[DisallowMultipleComponent]
|
||||||
|
public class LoopHorizontalScrollRectMulti : LoopScrollRectMulti
|
||||||
|
{
|
||||||
|
protected LoopHorizontalScrollRectMulti()
|
||||||
|
{
|
||||||
|
direction = LoopScrollRectDirection.Horizontal;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override float GetSize(RectTransform item, bool includeSpacing)
|
||||||
|
{
|
||||||
|
float size = includeSpacing ? contentSpacing : 0;
|
||||||
|
if (m_GridLayout != null)
|
||||||
|
{
|
||||||
|
size += m_GridLayout.cellSize.x;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
size += LoopScrollSizeUtils.GetPreferredWidth(item);
|
||||||
|
}
|
||||||
|
size *= m_Content.localScale.x;
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override float GetDimension(Vector2 vector)
|
||||||
|
{
|
||||||
|
return -vector.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override float GetAbsDimension(Vector2 vector)
|
||||||
|
{
|
||||||
|
return vector.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Vector2 GetVector(float value)
|
||||||
|
{
|
||||||
|
return new Vector2(-value, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Awake()
|
||||||
|
{
|
||||||
|
base.Awake();
|
||||||
|
if (m_Content)
|
||||||
|
{
|
||||||
|
GridLayoutGroup layout = m_Content.GetComponent<GridLayoutGroup>();
|
||||||
|
if (layout != null && layout.constraint != GridLayoutGroup.Constraint.FixedRowCount)
|
||||||
|
{
|
||||||
|
Debug.LogError("[LoopScrollRect] unsupported GridLayoutGroup constraint");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool UpdateItems(ref Bounds viewBounds, ref Bounds contentBounds)
|
||||||
|
{
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
|
// special case: handling move several page in one frame
|
||||||
|
if ((viewBounds.size.x < contentBounds.min.x - viewBounds.max.x) && itemTypeEnd > itemTypeStart)
|
||||||
|
{
|
||||||
|
float currentSize = contentBounds.size.x;
|
||||||
|
float elementSize = EstimiateElementSize();
|
||||||
|
ReturnToTempPool(false, itemTypeEnd - itemTypeStart);
|
||||||
|
itemTypeEnd = itemTypeStart;
|
||||||
|
|
||||||
|
int offsetCount = Mathf.FloorToInt((contentBounds.min.x - viewBounds.max.x) / (elementSize + contentSpacing));
|
||||||
|
if (totalCount >= 0 && itemTypeStart - offsetCount * contentConstraintCount < 0)
|
||||||
|
{
|
||||||
|
offsetCount = Mathf.FloorToInt((float)(itemTypeStart) / contentConstraintCount);
|
||||||
|
}
|
||||||
|
itemTypeStart -= offsetCount * contentConstraintCount;
|
||||||
|
if (totalCount >= 0)
|
||||||
|
{
|
||||||
|
itemTypeStart = Mathf.Max(itemTypeStart, 0);
|
||||||
|
}
|
||||||
|
itemTypeEnd = itemTypeStart;
|
||||||
|
itemTypeSize = 0;
|
||||||
|
|
||||||
|
float offset = offsetCount * (elementSize + contentSpacing);
|
||||||
|
m_Content.anchoredPosition -= new Vector2(offset + (reverseDirection ? currentSize : 0), 0);
|
||||||
|
contentBounds.center -= new Vector3(offset + currentSize / 2, 0, 0);
|
||||||
|
contentBounds.size = Vector3.zero;
|
||||||
|
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((viewBounds.min.x - contentBounds.max.x > viewBounds.size.x) && itemTypeEnd > itemTypeStart)
|
||||||
|
{
|
||||||
|
int maxItemTypeStart = -1;
|
||||||
|
if (totalCount >= 0)
|
||||||
|
{
|
||||||
|
maxItemTypeStart = Mathf.Max(0, totalCount - (itemTypeEnd - itemTypeStart));
|
||||||
|
maxItemTypeStart = (maxItemTypeStart / contentConstraintCount) * contentConstraintCount;
|
||||||
|
}
|
||||||
|
float currentSize = contentBounds.size.x;
|
||||||
|
float elementSize = EstimiateElementSize();
|
||||||
|
ReturnToTempPool(true, itemTypeEnd - itemTypeStart);
|
||||||
|
// TODO: fix with contentConstraint?
|
||||||
|
itemTypeStart = itemTypeEnd;
|
||||||
|
|
||||||
|
int offsetCount = Mathf.FloorToInt((viewBounds.min.x - contentBounds.max.x) / (elementSize + contentSpacing));
|
||||||
|
if (maxItemTypeStart >= 0 && itemTypeStart + offsetCount * contentConstraintCount > maxItemTypeStart)
|
||||||
|
{
|
||||||
|
offsetCount = Mathf.FloorToInt((float)(maxItemTypeStart - itemTypeStart) / contentConstraintCount);
|
||||||
|
}
|
||||||
|
itemTypeStart += offsetCount * contentConstraintCount;
|
||||||
|
if (totalCount >= 0)
|
||||||
|
{
|
||||||
|
itemTypeStart = Mathf.Max(itemTypeStart, 0);
|
||||||
|
}
|
||||||
|
itemTypeEnd = itemTypeStart;
|
||||||
|
itemTypeSize = 0;
|
||||||
|
|
||||||
|
float offset = offsetCount * (elementSize + contentSpacing);
|
||||||
|
m_Content.anchoredPosition += new Vector2(offset + (reverseDirection ? 0 : currentSize), 0);
|
||||||
|
contentBounds.center += new Vector3(offset + currentSize / 2, 0, 0);
|
||||||
|
contentBounds.size = Vector3.zero;
|
||||||
|
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewBounds.max.x > contentBounds.max.x - m_ContentRightPadding)
|
||||||
|
{
|
||||||
|
float size = NewItemAtEnd(), totalSize = size;
|
||||||
|
while (size > 0 && viewBounds.max.x > contentBounds.max.x - m_ContentRightPadding + totalSize)
|
||||||
|
{
|
||||||
|
size = NewItemAtEnd();
|
||||||
|
totalSize += size;
|
||||||
|
}
|
||||||
|
if (totalSize > 0)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
else if ((itemTypeEnd % contentConstraintCount != 0) && (itemTypeEnd < totalCount || totalCount < 0))
|
||||||
|
{
|
||||||
|
NewItemAtEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewBounds.min.x < contentBounds.min.x + m_ContentLeftPadding)
|
||||||
|
{
|
||||||
|
float size = NewItemAtStart(), totalSize = size;
|
||||||
|
while (size > 0 && viewBounds.min.x < contentBounds.min.x + m_ContentLeftPadding - totalSize)
|
||||||
|
{
|
||||||
|
size = NewItemAtStart();
|
||||||
|
totalSize += size;
|
||||||
|
}
|
||||||
|
if (totalSize > 0)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewBounds.max.x < contentBounds.max.x - threshold - m_ContentRightPadding
|
||||||
|
&& viewBounds.size.x < contentBounds.size.x - threshold)
|
||||||
|
{
|
||||||
|
float size = DeleteItemAtEnd(), totalSize = size;
|
||||||
|
while (size > 0 && viewBounds.max.x < contentBounds.max.x - threshold - m_ContentRightPadding - totalSize)
|
||||||
|
{
|
||||||
|
size = DeleteItemAtEnd();
|
||||||
|
totalSize += size;
|
||||||
|
}
|
||||||
|
if (totalSize > 0)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewBounds.min.x > contentBounds.min.x + threshold + m_ContentLeftPadding
|
||||||
|
&& viewBounds.size.x < contentBounds.size.x - threshold)
|
||||||
|
{
|
||||||
|
float size = DeleteItemAtStart(), totalSize = size;
|
||||||
|
while (size > 0 && viewBounds.min.x > contentBounds.min.x + threshold + m_ContentLeftPadding + totalSize)
|
||||||
|
{
|
||||||
|
size = DeleteItemAtStart();
|
||||||
|
totalSize += size;
|
||||||
|
}
|
||||||
|
if (totalSize > 0)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed)
|
||||||
|
{
|
||||||
|
ClearTempPool();
|
||||||
|
}
|
||||||
|
|
||||||
|
return changed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopHorizontalScrollRectMulti.cs.meta
vendored
Normal file
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopHorizontalScrollRectMulti.cs.meta
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0aa64ab4e86f574469b5d4fda2e9c85f
|
||||||
|
timeCreated: 1439395663
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
10
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollDataSource.cs
vendored
Normal file
10
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollDataSource.cs
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
namespace UnityEngine.UI
|
||||||
|
{
|
||||||
|
public interface LoopScrollDataSource
|
||||||
|
{
|
||||||
|
void ProvideData(Transform transform, int idx);
|
||||||
|
}
|
||||||
|
}
|
||||||
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollDataSource.cs.meta
vendored
Normal file
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollDataSource.cs.meta
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: be1ddd0ddf17846f0b38566071ee623e
|
||||||
|
timeCreated: 1500356133
|
||||||
|
licenseType: Pro
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
10
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollMultiDataSource.cs
vendored
Normal file
10
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollMultiDataSource.cs
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
namespace UnityEngine.UI
|
||||||
|
{
|
||||||
|
public interface LoopScrollMultiDataSource
|
||||||
|
{
|
||||||
|
void ProvideData(Transform transform, int index);
|
||||||
|
}
|
||||||
|
}
|
||||||
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollMultiDataSource.cs.meta
vendored
Normal file
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollMultiDataSource.cs.meta
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8730c6d35f93cb946b80539f595b48c1
|
||||||
|
timeCreated: 1500356133
|
||||||
|
licenseType: Pro
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollPrefabSource.cs
vendored
Normal file
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollPrefabSource.cs
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
namespace UnityEngine.UI
|
||||||
|
{
|
||||||
|
public interface LoopScrollPrefabSource
|
||||||
|
{
|
||||||
|
GameObject GetObject(int index);
|
||||||
|
|
||||||
|
void ReturnObject(Transform trans);
|
||||||
|
}
|
||||||
|
}
|
||||||
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollPrefabSource.cs.meta
vendored
Normal file
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollPrefabSource.cs.meta
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4cea3807a046c4500be20219e5c46432
|
||||||
|
timeCreated: 1500356133
|
||||||
|
licenseType: Pro
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
76
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollRect.cs
vendored
Normal file
76
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollRect.cs
vendored
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Events;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace UnityEngine.UI
|
||||||
|
{
|
||||||
|
public abstract class LoopScrollRect : LoopScrollRectBase
|
||||||
|
{
|
||||||
|
[HideInInspector]
|
||||||
|
[NonSerialized]
|
||||||
|
public LoopScrollDataSource dataSource = null;
|
||||||
|
|
||||||
|
protected override void ProvideData(Transform transform, int index)
|
||||||
|
{
|
||||||
|
dataSource.ProvideData(transform, index);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override RectTransform GetFromTempPool(int itemIdx)
|
||||||
|
{
|
||||||
|
RectTransform nextItem = null;
|
||||||
|
if (deletedItemTypeStart > 0)
|
||||||
|
{
|
||||||
|
deletedItemTypeStart--;
|
||||||
|
nextItem = m_Content.GetChild(0) as RectTransform;
|
||||||
|
nextItem.SetSiblingIndex(itemIdx - itemTypeStart + deletedItemTypeStart);
|
||||||
|
}
|
||||||
|
else if (deletedItemTypeEnd > 0)
|
||||||
|
{
|
||||||
|
deletedItemTypeEnd--;
|
||||||
|
nextItem = m_Content.GetChild(m_Content.childCount - 1) as RectTransform;
|
||||||
|
nextItem.SetSiblingIndex(itemIdx - itemTypeStart + deletedItemTypeStart);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nextItem = prefabSource.GetObject(itemIdx).transform as RectTransform;
|
||||||
|
nextItem.transform.SetParent(m_Content, false);
|
||||||
|
nextItem.gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
ProvideData(nextItem, itemIdx);
|
||||||
|
return nextItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void ReturnToTempPool(bool fromStart, int count)
|
||||||
|
{
|
||||||
|
if (fromStart)
|
||||||
|
deletedItemTypeStart += count;
|
||||||
|
else
|
||||||
|
deletedItemTypeEnd += count;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void ClearTempPool()
|
||||||
|
{
|
||||||
|
Debug.Assert(m_Content.childCount >= deletedItemTypeStart + deletedItemTypeEnd);
|
||||||
|
if (deletedItemTypeStart > 0)
|
||||||
|
{
|
||||||
|
for (int i = deletedItemTypeStart - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
prefabSource.ReturnObject(m_Content.GetChild(i));
|
||||||
|
}
|
||||||
|
deletedItemTypeStart = 0;
|
||||||
|
}
|
||||||
|
if (deletedItemTypeEnd > 0)
|
||||||
|
{
|
||||||
|
int t = m_Content.childCount - deletedItemTypeEnd;
|
||||||
|
for (int i = m_Content.childCount - 1; i >= t; i--)
|
||||||
|
{
|
||||||
|
prefabSource.ReturnObject(m_Content.GetChild(i));
|
||||||
|
}
|
||||||
|
deletedItemTypeEnd = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollRect.cs.meta
vendored
Normal file
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollRect.cs.meta
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4ec983a492fb0204bacc07738659994f
|
||||||
|
timeCreated: 1439395663
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
2401
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollRectBase.cs
vendored
Normal file
2401
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollRectBase.cs
vendored
Normal file
File diff suppressed because it is too large
Load Diff
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollRectBase.cs.meta
vendored
Normal file
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollRectBase.cs.meta
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 33aaabb8aa0854047a50d2d2b0c6f1a5
|
||||||
|
timeCreated: 1439395663
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
56
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollRectMulti.cs
vendored
Normal file
56
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollRectMulti.cs
vendored
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Events;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace UnityEngine.UI
|
||||||
|
{
|
||||||
|
public abstract class LoopScrollRectMulti : LoopScrollRectBase
|
||||||
|
{
|
||||||
|
[HideInInspector]
|
||||||
|
[NonSerialized]
|
||||||
|
public LoopScrollMultiDataSource dataSource = null;
|
||||||
|
|
||||||
|
protected override void ProvideData(Transform transform, int index)
|
||||||
|
{
|
||||||
|
dataSource.ProvideData(transform, index);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Multi Data Source cannot support TempPool
|
||||||
|
protected override RectTransform GetFromTempPool(int itemIdx)
|
||||||
|
{
|
||||||
|
RectTransform nextItem = prefabSource.GetObject(itemIdx).transform as RectTransform;
|
||||||
|
nextItem.transform.SetParent(m_Content, false);
|
||||||
|
nextItem.gameObject.SetActive(true);
|
||||||
|
|
||||||
|
ProvideData(nextItem, itemIdx);
|
||||||
|
return nextItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void ReturnToTempPool(bool fromStart, int count)
|
||||||
|
{
|
||||||
|
Debug.Assert(m_Content.childCount >= count);
|
||||||
|
if (fromStart)
|
||||||
|
{
|
||||||
|
for (int i = count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
prefabSource.ReturnObject(m_Content.GetChild(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int t = m_Content.childCount - count;
|
||||||
|
for (int i = m_Content.childCount - 1; i >= t; i--)
|
||||||
|
{
|
||||||
|
prefabSource.ReturnObject(m_Content.GetChild(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void ClearTempPool()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollRectMulti.cs.meta
vendored
Normal file
11
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollRectMulti.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1bb4b17b11dd527499b49566928fed17
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
11
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollSizeHelper.cs
vendored
Normal file
11
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollSizeHelper.cs
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
namespace UnityEngine.UI
|
||||||
|
{
|
||||||
|
// optional class for better scroll support
|
||||||
|
public interface LoopScrollSizeHelper
|
||||||
|
{
|
||||||
|
Vector2 GetItemsSize(int itemsCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollSizeHelper.cs.meta
vendored
Normal file
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollSizeHelper.cs.meta
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 34053817472810d49a0a82b79338dde5
|
||||||
|
timeCreated: 1500356133
|
||||||
|
licenseType: Pro
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
38
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollSizeUtils.cs
vendored
Normal file
38
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollSizeUtils.cs
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace UnityEngine.UI
|
||||||
|
{
|
||||||
|
public static class LoopScrollSizeUtils
|
||||||
|
{
|
||||||
|
public static float GetPreferredHeight(RectTransform item)
|
||||||
|
{
|
||||||
|
ILayoutElement minLayoutElement;
|
||||||
|
ILayoutElement preferredLayoutElement;
|
||||||
|
var minHeight = LayoutUtility.GetLayoutProperty(item, e => e.minHeight, 0, out minLayoutElement);
|
||||||
|
var preferredHeight = LayoutUtility.GetLayoutProperty(item, e => e.preferredHeight, 0, out preferredLayoutElement);
|
||||||
|
var result = Mathf.Max(minHeight, preferredHeight);
|
||||||
|
if (preferredLayoutElement == null && minLayoutElement == null)
|
||||||
|
{
|
||||||
|
result = item.rect.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static float GetPreferredWidth(RectTransform item)
|
||||||
|
{
|
||||||
|
ILayoutElement minLayoutElement;
|
||||||
|
ILayoutElement preferredLayoutElement;
|
||||||
|
var minWidth = LayoutUtility.GetLayoutProperty(item, e => e.minWidth, 0, out minLayoutElement);
|
||||||
|
var preferredWidth = LayoutUtility.GetLayoutProperty(item, e => e.preferredWidth, 0, out preferredLayoutElement);
|
||||||
|
var result = Mathf.Max(minWidth, preferredWidth);
|
||||||
|
if (preferredLayoutElement == null && minLayoutElement == null)
|
||||||
|
{
|
||||||
|
result = item.rect.width;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollSizeUtils.cs.meta
vendored
Normal file
3
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopScrollSizeUtils.cs.meta
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e089162759fe4031997b918866745978
|
||||||
|
timeCreated: 1721785991
|
||||||
188
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopVerticalScrollRect.cs
vendored
Normal file
188
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopVerticalScrollRect.cs
vendored
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
namespace UnityEngine.UI
|
||||||
|
{
|
||||||
|
[AddComponentMenu("UI/Loop Vertical Scroll Rect", 51)]
|
||||||
|
[DisallowMultipleComponent]
|
||||||
|
public class LoopVerticalScrollRect : LoopScrollRect
|
||||||
|
{
|
||||||
|
protected LoopVerticalScrollRect()
|
||||||
|
{
|
||||||
|
direction = LoopScrollRectDirection.Vertical;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override float GetSize(RectTransform item, bool includeSpacing)
|
||||||
|
{
|
||||||
|
float size = includeSpacing ? contentSpacing : 0;
|
||||||
|
if (m_GridLayout != null)
|
||||||
|
{
|
||||||
|
size += m_GridLayout.cellSize.y;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
size += LoopScrollSizeUtils.GetPreferredHeight(item);
|
||||||
|
}
|
||||||
|
size *= m_Content.localScale.y;
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override float GetDimension(Vector2 vector)
|
||||||
|
{
|
||||||
|
return vector.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override float GetAbsDimension(Vector2 vector)
|
||||||
|
{
|
||||||
|
return vector.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Vector2 GetVector(float value)
|
||||||
|
{
|
||||||
|
return new Vector2(0, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Awake()
|
||||||
|
{
|
||||||
|
base.Awake();
|
||||||
|
if (m_Content)
|
||||||
|
{
|
||||||
|
GridLayoutGroup layout = m_Content.GetComponent<GridLayoutGroup>();
|
||||||
|
if (layout != null && layout.constraint != GridLayoutGroup.Constraint.FixedColumnCount)
|
||||||
|
{
|
||||||
|
Debug.LogError("[LoopScrollRect] unsupported GridLayoutGroup constraint");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool UpdateItems(ref Bounds viewBounds, ref Bounds contentBounds)
|
||||||
|
{
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
|
// special case: handling move several page in one frame
|
||||||
|
if ((viewBounds.size.y < contentBounds.min.y - viewBounds.max.y) && itemTypeEnd > itemTypeStart)
|
||||||
|
{
|
||||||
|
int maxItemTypeStart = -1;
|
||||||
|
if (totalCount >= 0)
|
||||||
|
{
|
||||||
|
maxItemTypeStart = Mathf.Max(0, totalCount - (itemTypeEnd - itemTypeStart));
|
||||||
|
}
|
||||||
|
float currentSize = contentBounds.size.y;
|
||||||
|
float elementSize = EstimiateElementSize();
|
||||||
|
ReturnToTempPool(true, itemTypeEnd - itemTypeStart);
|
||||||
|
itemTypeStart = itemTypeEnd;
|
||||||
|
|
||||||
|
int offsetCount = Mathf.FloorToInt((contentBounds.min.y - viewBounds.max.y) / (elementSize + contentSpacing));
|
||||||
|
if (maxItemTypeStart >= 0 && itemTypeStart + offsetCount * contentConstraintCount > maxItemTypeStart)
|
||||||
|
{
|
||||||
|
offsetCount = Mathf.FloorToInt((float)(maxItemTypeStart - itemTypeStart) / contentConstraintCount);
|
||||||
|
}
|
||||||
|
itemTypeStart += offsetCount * contentConstraintCount;
|
||||||
|
if (totalCount >= 0)
|
||||||
|
{
|
||||||
|
itemTypeStart = Mathf.Max(itemTypeStart, 0);
|
||||||
|
}
|
||||||
|
itemTypeEnd = itemTypeStart;
|
||||||
|
itemTypeSize = 0;
|
||||||
|
|
||||||
|
float offset = offsetCount * (elementSize + contentSpacing);
|
||||||
|
m_Content.anchoredPosition -= new Vector2(0, offset + (reverseDirection ? 0 : currentSize));
|
||||||
|
contentBounds.center -= new Vector3(0, offset + currentSize / 2, 0);
|
||||||
|
contentBounds.size = Vector3.zero;
|
||||||
|
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((viewBounds.min.y - contentBounds.max.y > viewBounds.size.y) && itemTypeEnd > itemTypeStart)
|
||||||
|
{
|
||||||
|
float currentSize = contentBounds.size.y;
|
||||||
|
float elementSize = EstimiateElementSize();
|
||||||
|
ReturnToTempPool(false, itemTypeEnd - itemTypeStart);
|
||||||
|
itemTypeEnd = itemTypeStart;
|
||||||
|
|
||||||
|
int offsetCount = Mathf.FloorToInt((viewBounds.min.y - contentBounds.max.y) / (elementSize + contentSpacing));
|
||||||
|
if (totalCount >= 0 && itemTypeStart - offsetCount * contentConstraintCount < 0)
|
||||||
|
{
|
||||||
|
offsetCount = Mathf.FloorToInt((float)(itemTypeStart) / contentConstraintCount);
|
||||||
|
}
|
||||||
|
itemTypeStart -= offsetCount * contentConstraintCount;
|
||||||
|
if (totalCount >= 0)
|
||||||
|
{
|
||||||
|
itemTypeStart = Mathf.Max(itemTypeStart, 0);
|
||||||
|
}
|
||||||
|
itemTypeEnd = itemTypeStart;
|
||||||
|
itemTypeSize = 0;
|
||||||
|
|
||||||
|
float offset = offsetCount * (elementSize + contentSpacing);
|
||||||
|
m_Content.anchoredPosition += new Vector2(0, offset + (reverseDirection ? currentSize : 0));
|
||||||
|
contentBounds.center += new Vector3(0, offset + currentSize / 2, 0);
|
||||||
|
contentBounds.size = Vector3.zero;
|
||||||
|
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
// issue #149: new item before delete
|
||||||
|
if (viewBounds.min.y < contentBounds.min.y + m_ContentBottomPadding)
|
||||||
|
{
|
||||||
|
float size = NewItemAtEnd(), totalSize = size;
|
||||||
|
while (size > 0 && viewBounds.min.y < contentBounds.min.y + m_ContentBottomPadding - totalSize)
|
||||||
|
{
|
||||||
|
size = NewItemAtEnd();
|
||||||
|
totalSize += size;
|
||||||
|
}
|
||||||
|
if (totalSize > 0)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
// issue #178: grid layout could increase totalCount at any time
|
||||||
|
else if ((itemTypeEnd % contentConstraintCount != 0) && (itemTypeEnd < totalCount || totalCount < 0))
|
||||||
|
{
|
||||||
|
NewItemAtEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewBounds.max.y > contentBounds.max.y - m_ContentTopPadding)
|
||||||
|
{
|
||||||
|
float size = NewItemAtStart(), totalSize = size;
|
||||||
|
while (size > 0 && viewBounds.max.y > contentBounds.max.y - m_ContentTopPadding + totalSize)
|
||||||
|
{
|
||||||
|
size = NewItemAtStart();
|
||||||
|
totalSize += size;
|
||||||
|
}
|
||||||
|
if (totalSize > 0)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewBounds.min.y > contentBounds.min.y + threshold + m_ContentBottomPadding
|
||||||
|
&& viewBounds.size.y < contentBounds.size.y - threshold)
|
||||||
|
{
|
||||||
|
float size = DeleteItemAtEnd(), totalSize = size;
|
||||||
|
while (size > 0 && viewBounds.min.y > contentBounds.min.y + threshold + m_ContentBottomPadding + totalSize)
|
||||||
|
{
|
||||||
|
size = DeleteItemAtEnd();
|
||||||
|
totalSize += size;
|
||||||
|
}
|
||||||
|
if (totalSize > 0)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewBounds.max.y < contentBounds.max.y - threshold - m_ContentTopPadding
|
||||||
|
&& viewBounds.size.y < contentBounds.size.y - threshold)
|
||||||
|
{
|
||||||
|
float size = DeleteItemAtStart(), totalSize = size;
|
||||||
|
while (size > 0 && viewBounds.max.y < contentBounds.max.y - threshold - m_ContentTopPadding - totalSize)
|
||||||
|
{
|
||||||
|
size = DeleteItemAtStart();
|
||||||
|
totalSize += size;
|
||||||
|
}
|
||||||
|
if (totalSize > 0)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed)
|
||||||
|
{
|
||||||
|
ClearTempPool();
|
||||||
|
}
|
||||||
|
|
||||||
|
return changed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopVerticalScrollRect.cs.meta
vendored
Normal file
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopVerticalScrollRect.cs.meta
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ce71017a2903f7c4c9a699e438d0b897
|
||||||
|
timeCreated: 1439395663
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
187
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopVerticalScrollRectMulti.cs
vendored
Normal file
187
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopVerticalScrollRectMulti.cs
vendored
Normal file
@@ -0,0 +1,187 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
namespace UnityEngine.UI
|
||||||
|
{
|
||||||
|
[AddComponentMenu("UI/Loop Vertical Scroll Rect(MultiPrefab)", 53)]
|
||||||
|
[DisallowMultipleComponent]
|
||||||
|
public class LoopVerticalScrollRectMulti : LoopScrollRectMulti
|
||||||
|
{
|
||||||
|
protected LoopVerticalScrollRectMulti()
|
||||||
|
{
|
||||||
|
direction = LoopScrollRectDirection.Vertical;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override float GetSize(RectTransform item, bool includeSpacing)
|
||||||
|
{
|
||||||
|
float size = includeSpacing ? contentSpacing : 0;
|
||||||
|
if (m_GridLayout != null)
|
||||||
|
{
|
||||||
|
size += m_GridLayout.cellSize.y;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
size += LoopScrollSizeUtils.GetPreferredHeight(item);
|
||||||
|
}
|
||||||
|
size *= m_Content.localScale.y;
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override float GetDimension(Vector2 vector)
|
||||||
|
{
|
||||||
|
return vector.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override float GetAbsDimension(Vector2 vector)
|
||||||
|
{
|
||||||
|
return vector.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Vector2 GetVector(float value)
|
||||||
|
{
|
||||||
|
return new Vector2(0, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Awake()
|
||||||
|
{
|
||||||
|
base.Awake();
|
||||||
|
if (m_Content)
|
||||||
|
{
|
||||||
|
GridLayoutGroup layout = m_Content.GetComponent<GridLayoutGroup>();
|
||||||
|
if (layout != null && layout.constraint != GridLayoutGroup.Constraint.FixedColumnCount)
|
||||||
|
{
|
||||||
|
Debug.LogError("[LoopScrollRect] unsupported GridLayoutGroup constraint");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool UpdateItems(ref Bounds viewBounds, ref Bounds contentBounds)
|
||||||
|
{
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
|
// special case: handling move several page in one frame
|
||||||
|
if ((viewBounds.size.y < contentBounds.min.y - viewBounds.max.y) && itemTypeEnd > itemTypeStart)
|
||||||
|
{
|
||||||
|
int maxItemTypeStart = -1;
|
||||||
|
if (totalCount >= 0)
|
||||||
|
{
|
||||||
|
maxItemTypeStart = Mathf.Max(0, totalCount - (itemTypeEnd - itemTypeStart));
|
||||||
|
}
|
||||||
|
float currentSize = contentBounds.size.y;
|
||||||
|
float elementSize = EstimiateElementSize();
|
||||||
|
ReturnToTempPool(true, itemTypeEnd - itemTypeStart);
|
||||||
|
itemTypeStart = itemTypeEnd;
|
||||||
|
|
||||||
|
int offsetCount = Mathf.FloorToInt((contentBounds.min.y - viewBounds.max.y) / (elementSize + contentSpacing));
|
||||||
|
if (maxItemTypeStart >= 0 && itemTypeStart + offsetCount * contentConstraintCount > maxItemTypeStart)
|
||||||
|
{
|
||||||
|
offsetCount = Mathf.FloorToInt((float)(maxItemTypeStart - itemTypeStart) / contentConstraintCount);
|
||||||
|
}
|
||||||
|
itemTypeStart += offsetCount * contentConstraintCount;
|
||||||
|
if (totalCount >= 0)
|
||||||
|
{
|
||||||
|
itemTypeStart = Mathf.Max(itemTypeStart, 0);
|
||||||
|
}
|
||||||
|
itemTypeEnd = itemTypeStart;
|
||||||
|
itemTypeSize = 0;
|
||||||
|
|
||||||
|
float offset = offsetCount * (elementSize + contentSpacing);
|
||||||
|
m_Content.anchoredPosition -= new Vector2(0, offset + (reverseDirection ? 0 : currentSize));
|
||||||
|
contentBounds.center -= new Vector3(0, offset + currentSize / 2, 0);
|
||||||
|
contentBounds.size = Vector3.zero;
|
||||||
|
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((viewBounds.min.y - contentBounds.max.y > viewBounds.size.y) && itemTypeEnd > itemTypeStart)
|
||||||
|
{
|
||||||
|
float currentSize = contentBounds.size.y;
|
||||||
|
float elementSize = EstimiateElementSize();
|
||||||
|
ReturnToTempPool(false, itemTypeEnd - itemTypeStart);
|
||||||
|
itemTypeEnd = itemTypeStart;
|
||||||
|
|
||||||
|
int offsetCount = Mathf.FloorToInt((viewBounds.min.y - contentBounds.max.y) / (elementSize + contentSpacing));
|
||||||
|
if (totalCount >= 0 && itemTypeStart - offsetCount * contentConstraintCount < 0)
|
||||||
|
{
|
||||||
|
offsetCount = Mathf.FloorToInt((float)(itemTypeStart) / contentConstraintCount);
|
||||||
|
}
|
||||||
|
itemTypeStart -= offsetCount * contentConstraintCount;
|
||||||
|
if (totalCount >= 0)
|
||||||
|
{
|
||||||
|
itemTypeStart = Mathf.Max(itemTypeStart, 0);
|
||||||
|
}
|
||||||
|
itemTypeEnd = itemTypeStart;
|
||||||
|
itemTypeSize = 0;
|
||||||
|
|
||||||
|
float offset = offsetCount * (elementSize + contentSpacing);
|
||||||
|
m_Content.anchoredPosition += new Vector2(0, offset + (reverseDirection ? currentSize : 0));
|
||||||
|
contentBounds.center += new Vector3(0, offset + currentSize / 2, 0);
|
||||||
|
contentBounds.size = Vector3.zero;
|
||||||
|
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewBounds.min.y < contentBounds.min.y + m_ContentBottomPadding)
|
||||||
|
{
|
||||||
|
float size = NewItemAtEnd(), totalSize = size;
|
||||||
|
while (size > 0 && viewBounds.min.y < contentBounds.min.y + m_ContentBottomPadding - totalSize)
|
||||||
|
{
|
||||||
|
size = NewItemAtEnd();
|
||||||
|
totalSize += size;
|
||||||
|
}
|
||||||
|
if (totalSize > 0)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
else if ((itemTypeEnd % contentConstraintCount != 0) && (itemTypeEnd < totalCount || totalCount < 0))
|
||||||
|
{
|
||||||
|
NewItemAtEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewBounds.max.y > contentBounds.max.y - m_ContentTopPadding)
|
||||||
|
{
|
||||||
|
float size = NewItemAtStart(), totalSize = size;
|
||||||
|
while (size > 0 && viewBounds.max.y > contentBounds.max.y - m_ContentTopPadding + totalSize)
|
||||||
|
{
|
||||||
|
size = NewItemAtStart();
|
||||||
|
totalSize += size;
|
||||||
|
}
|
||||||
|
if (totalSize > 0)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewBounds.min.y > contentBounds.min.y + threshold + m_ContentBottomPadding
|
||||||
|
&& viewBounds.size.y < contentBounds.size.y - threshold)
|
||||||
|
{
|
||||||
|
float size = DeleteItemAtEnd(), totalSize = size;
|
||||||
|
while (size > 0 && viewBounds.min.y > contentBounds.min.y + threshold + m_ContentBottomPadding + totalSize)
|
||||||
|
{
|
||||||
|
size = DeleteItemAtEnd();
|
||||||
|
totalSize += size;
|
||||||
|
}
|
||||||
|
if (totalSize > 0)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewBounds.max.y < contentBounds.max.y - threshold - m_ContentTopPadding
|
||||||
|
&& viewBounds.size.y < contentBounds.size.y - threshold)
|
||||||
|
{
|
||||||
|
float size = DeleteItemAtStart(), totalSize = size;
|
||||||
|
while (size > 0 && viewBounds.max.y < contentBounds.max.y - threshold - m_ContentTopPadding - totalSize)
|
||||||
|
{
|
||||||
|
size = DeleteItemAtStart();
|
||||||
|
totalSize += size;
|
||||||
|
}
|
||||||
|
if (totalSize > 0)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed)
|
||||||
|
{
|
||||||
|
ClearTempPool();
|
||||||
|
}
|
||||||
|
|
||||||
|
return changed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopVerticalScrollRectMulti.cs.meta
vendored
Normal file
12
UnityGame/Assets/Scripts/ThirdParty/LoopList/Runtime/LoopVerticalScrollRectMulti.cs.meta
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a4ae502f584e1924d83adb15f18817dc
|
||||||
|
timeCreated: 1439395663
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
135
UnityGame/Assets/Scripts/ThirdParty/LoopList/UILoopList.cs
vendored
Normal file
135
UnityGame/Assets/Scripts/ThirdParty/LoopList/UILoopList.cs
vendored
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace CreatGame.UI
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// item提供者
|
||||||
|
/// </summary>
|
||||||
|
public delegate string LoopListItemProvider(int index);
|
||||||
|
/// <summary>
|
||||||
|
/// item渲染函数
|
||||||
|
/// </summary>
|
||||||
|
public delegate void LoopListItemRenderer(GameObject item,int index);
|
||||||
|
public class UILoopList : MonoBehaviour, LoopScrollPrefabSource, LoopScrollDataSource
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public LoopListItemProvider ListItemProvider;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public LoopListItemRenderer ListItemRenderer;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
private Dictionary<string, Stack<GameObject>> itemPool = new Dictionary<string, Stack<GameObject>>();
|
||||||
|
/// <summary>
|
||||||
|
/// 预制件
|
||||||
|
/// </summary>
|
||||||
|
public GameObject itemPrefab;
|
||||||
|
public GameObject GetObject(int index)
|
||||||
|
{
|
||||||
|
string itemPath = String.Empty;
|
||||||
|
if (ListItemProvider != null)
|
||||||
|
{
|
||||||
|
itemPath = ListItemProvider(index);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
itemPath = "Default";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemPool.TryGetValue(itemPath, out Stack<GameObject> itemList) == false)
|
||||||
|
{
|
||||||
|
itemList = new Stack<GameObject>();
|
||||||
|
itemPool.Add(itemPath, itemList);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemList.Count == 0)
|
||||||
|
{
|
||||||
|
if (ListItemProvider == null)
|
||||||
|
{
|
||||||
|
if (itemPrefab != null)
|
||||||
|
{
|
||||||
|
itemList.Push(Instantiate(itemPrefab));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError("ItemPrefab is null and ListItemProvider == null");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var item = AssetBundle.AssetBundleManager.Instance.LoadGameObject(itemPath);
|
||||||
|
var export = item.GetComponent<UIViewBase>();
|
||||||
|
if (export == null)
|
||||||
|
{
|
||||||
|
Debug.LogError("预制件没有绑定导出代码的UIViewBase");
|
||||||
|
}
|
||||||
|
|
||||||
|
export.PreLoad(item);
|
||||||
|
itemList.Push(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return itemList.Pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReturnObject(Transform trans)
|
||||||
|
{
|
||||||
|
var export = trans.GetComponent<UIViewBase>();
|
||||||
|
if (export != null)
|
||||||
|
{
|
||||||
|
if (itemPool.TryGetValue(export.PrefabPath, out Stack<GameObject> itemList) ==false)
|
||||||
|
{
|
||||||
|
itemList = itemPool["Default"];
|
||||||
|
}
|
||||||
|
|
||||||
|
itemList.Push(trans.gameObject);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError("返回对象池失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ProvideData(Transform transform, int idx)
|
||||||
|
{
|
||||||
|
if (ListItemRenderer == null)
|
||||||
|
{
|
||||||
|
Debug.LogError("ListItemRenderer is null");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ListItemRenderer(transform.gameObject, idx);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public LoopScrollRect ScrollRect { get; private set; }
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
ScrollRect = GetComponent<LoopScrollRect>();
|
||||||
|
ScrollRect.prefabSource = this;
|
||||||
|
ScrollRect.dataSource = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int ItemCount
|
||||||
|
{
|
||||||
|
get => ScrollRect.totalCount;
|
||||||
|
set => ScrollRect.totalCount = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RefillCells()
|
||||||
|
{
|
||||||
|
ScrollRect?.RefillCells();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
3
UnityGame/Assets/Scripts/ThirdParty/LoopList/UILoopList.cs.meta
vendored
Normal file
3
UnityGame/Assets/Scripts/ThirdParty/LoopList/UILoopList.cs.meta
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7147f1d79bae489b95b90268646bc8bf
|
||||||
|
timeCreated: 1752913702
|
||||||
@@ -19,7 +19,7 @@ MonoBehaviour:
|
|||||||
width: 2048
|
width: 2048
|
||||||
height: 1060.8
|
height: 1060.8
|
||||||
m_ShowMode: 4
|
m_ShowMode: 4
|
||||||
m_Title: Console
|
m_Title: Project
|
||||||
m_RootView: {fileID: 7}
|
m_RootView: {fileID: 7}
|
||||||
m_MinSize: {x: 875, y: 300}
|
m_MinSize: {x: 875, y: 300}
|
||||||
m_MaxSize: {x: 10000, y: 10000}
|
m_MaxSize: {x: 10000, y: 10000}
|
||||||
@@ -74,7 +74,7 @@ MonoBehaviour:
|
|||||||
m_MinSize: {x: 200, y: 50}
|
m_MinSize: {x: 200, y: 50}
|
||||||
m_MaxSize: {x: 16192, y: 8096}
|
m_MaxSize: {x: 16192, y: 8096}
|
||||||
vertical: 0
|
vertical: 0
|
||||||
controlID: 54
|
controlID: 92
|
||||||
draggingID: 0
|
draggingID: 0
|
||||||
--- !u!114 &4
|
--- !u!114 &4
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@@ -126,7 +126,7 @@ MonoBehaviour:
|
|||||||
m_MinSize: {x: 300, y: 100}
|
m_MinSize: {x: 300, y: 100}
|
||||||
m_MaxSize: {x: 24288, y: 16192}
|
m_MaxSize: {x: 24288, y: 16192}
|
||||||
vertical: 1
|
vertical: 1
|
||||||
controlID: 16
|
controlID: 91
|
||||||
draggingID: 0
|
draggingID: 0
|
||||||
--- !u!114 &6
|
--- !u!114 &6
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@@ -229,7 +229,7 @@ MonoBehaviour:
|
|||||||
m_MinSize: {x: 300, y: 50}
|
m_MinSize: {x: 300, y: 50}
|
||||||
m_MaxSize: {x: 24288, y: 8096}
|
m_MaxSize: {x: 24288, y: 8096}
|
||||||
vertical: 0
|
vertical: 0
|
||||||
controlID: 17
|
controlID: 38
|
||||||
draggingID: 0
|
draggingID: 0
|
||||||
--- !u!114 &10
|
--- !u!114 &10
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@@ -271,8 +271,8 @@ MonoBehaviour:
|
|||||||
y: 0
|
y: 0
|
||||||
width: 590.4
|
width: 590.4
|
||||||
height: 652
|
height: 652
|
||||||
m_MinSize: {x: 275, y: 50}
|
m_MinSize: {x: 276, y: 71}
|
||||||
m_MaxSize: {x: 4000, y: 4000}
|
m_MaxSize: {x: 4001, y: 4021}
|
||||||
m_ActualView: {fileID: 15}
|
m_ActualView: {fileID: 15}
|
||||||
m_Panes:
|
m_Panes:
|
||||||
- {fileID: 15}
|
- {fileID: 15}
|
||||||
@@ -376,9 +376,9 @@ MonoBehaviour:
|
|||||||
m_SceneHierarchy:
|
m_SceneHierarchy:
|
||||||
m_TreeViewState:
|
m_TreeViewState:
|
||||||
scrollPos: {x: 0, y: 0}
|
scrollPos: {x: 0, y: 0}
|
||||||
m_SelectedIDs: 90600000
|
m_SelectedIDs: 0a5f0000
|
||||||
m_LastClickedID: 0
|
m_LastClickedID: 0
|
||||||
m_ExpandedIDs: 6af4ffff76f4ffff9c6000009e600000
|
m_ExpandedIDs: 0cfaffff
|
||||||
m_RenameOverlay:
|
m_RenameOverlay:
|
||||||
m_UserAcceptedRename: 0
|
m_UserAcceptedRename: 0
|
||||||
m_Name:
|
m_Name:
|
||||||
@@ -494,7 +494,7 @@ MonoBehaviour:
|
|||||||
m_SkipHidden: 0
|
m_SkipHidden: 0
|
||||||
m_SearchArea: 1
|
m_SearchArea: 1
|
||||||
m_Folders:
|
m_Folders:
|
||||||
- Assets/AssetBundle/Config
|
- Assets/Scripts/ThirdParty/LoopList/Runtime
|
||||||
m_Globs: []
|
m_Globs: []
|
||||||
m_OriginalText:
|
m_OriginalText:
|
||||||
m_ImportLogFlags: 0
|
m_ImportLogFlags: 0
|
||||||
@@ -510,7 +510,7 @@ MonoBehaviour:
|
|||||||
scrollPos: {x: 0, y: 0}
|
scrollPos: {x: 0, y: 0}
|
||||||
m_SelectedIDs: b2df0000
|
m_SelectedIDs: b2df0000
|
||||||
m_LastClickedID: 57266
|
m_LastClickedID: 57266
|
||||||
m_ExpandedIDs: 00000000985f00009a5f00009c5f00009e5f0000a05f0000a25f0000a45f0000a65f0000a85f0000aa5f0000ac5f0000ae5f0000b05f0000
|
m_ExpandedIDs: 00000000fc5f0000fe5f000000600000026000000460000006600000086000000a6000000c6000000e6000001060000012600000146000001660000018600000
|
||||||
m_RenameOverlay:
|
m_RenameOverlay:
|
||||||
m_UserAcceptedRename: 0
|
m_UserAcceptedRename: 0
|
||||||
m_Name:
|
m_Name:
|
||||||
@@ -535,10 +535,10 @@ MonoBehaviour:
|
|||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_ResourceFile:
|
m_ResourceFile:
|
||||||
m_AssetTreeState:
|
m_AssetTreeState:
|
||||||
scrollPos: {x: 0, y: 0}
|
scrollPos: {x: 0, y: 172.19995}
|
||||||
m_SelectedIDs:
|
m_SelectedIDs:
|
||||||
m_LastClickedID: 0
|
m_LastClickedID: 0
|
||||||
m_ExpandedIDs: ffffffff00000000985f00009a5f00009c5f00009e5f0000a05f0000a25f0000a45f0000a65f0000a85f0000aa5f0000ac5f0000ae5f0000b05f0000da5f0000e45f0000
|
m_ExpandedIDs: ffffffff00000000ca5e0000d25e0000fc5f0000fe5f00000260000004600000066000000c6000000e60000054600000
|
||||||
m_RenameOverlay:
|
m_RenameOverlay:
|
||||||
m_UserAcceptedRename: 0
|
m_UserAcceptedRename: 0
|
||||||
m_Name:
|
m_Name:
|
||||||
@@ -770,7 +770,7 @@ MonoBehaviour:
|
|||||||
collapsed: 0
|
collapsed: 0
|
||||||
displayed: 0
|
displayed: 0
|
||||||
snapOffset: {x: 0, y: 0}
|
snapOffset: {x: 0, y: 0}
|
||||||
snapOffsetDelta: {x: 0, y: 24.8}
|
snapOffsetDelta: {x: 0, y: 0}
|
||||||
snapCorner: 1
|
snapCorner: 1
|
||||||
id: unity-search-toolbar
|
id: unity-search-toolbar
|
||||||
index: 1
|
index: 1
|
||||||
@@ -822,7 +822,7 @@ MonoBehaviour:
|
|||||||
collapsed: 0
|
collapsed: 0
|
||||||
displayed: 0
|
displayed: 0
|
||||||
snapOffset: {x: 0, y: 0}
|
snapOffset: {x: 0, y: 0}
|
||||||
snapOffsetDelta: {x: 0, y: 24.8}
|
snapOffsetDelta: {x: 0, y: 0}
|
||||||
snapCorner: 0
|
snapCorner: 0
|
||||||
id: Scene View/Light Settings
|
id: Scene View/Light Settings
|
||||||
index: 0
|
index: 0
|
||||||
@@ -848,7 +848,7 @@ MonoBehaviour:
|
|||||||
collapsed: 0
|
collapsed: 0
|
||||||
displayed: 0
|
displayed: 0
|
||||||
snapOffset: {x: 0, y: 0}
|
snapOffset: {x: 0, y: 0}
|
||||||
snapOffsetDelta: {x: 0, y: 24.8}
|
snapOffsetDelta: {x: 0, y: 0}
|
||||||
snapCorner: 0
|
snapCorner: 0
|
||||||
id: Scene View/Cloth Constraints
|
id: Scene View/Cloth Constraints
|
||||||
index: 1
|
index: 1
|
||||||
@@ -861,7 +861,7 @@ MonoBehaviour:
|
|||||||
collapsed: 0
|
collapsed: 0
|
||||||
displayed: 0
|
displayed: 0
|
||||||
snapOffset: {x: 0, y: 0}
|
snapOffset: {x: 0, y: 0}
|
||||||
snapOffsetDelta: {x: 0, y: 24.8}
|
snapOffsetDelta: {x: 0, y: 0}
|
||||||
snapCorner: 0
|
snapCorner: 0
|
||||||
id: Scene View/Cloth Collisions
|
id: Scene View/Cloth Collisions
|
||||||
index: 2
|
index: 2
|
||||||
@@ -913,7 +913,7 @@ MonoBehaviour:
|
|||||||
collapsed: 0
|
collapsed: 0
|
||||||
displayed: 0
|
displayed: 0
|
||||||
snapOffset: {x: 0, y: 0}
|
snapOffset: {x: 0, y: 0}
|
||||||
snapOffsetDelta: {x: 0, y: 24.8}
|
snapOffsetDelta: {x: 0, y: 0}
|
||||||
snapCorner: 0
|
snapCorner: 0
|
||||||
id: Scene View/Occlusion Culling
|
id: Scene View/Occlusion Culling
|
||||||
index: 3
|
index: 3
|
||||||
@@ -926,7 +926,7 @@ MonoBehaviour:
|
|||||||
collapsed: 0
|
collapsed: 0
|
||||||
displayed: 0
|
displayed: 0
|
||||||
snapOffset: {x: 0, y: 0}
|
snapOffset: {x: 0, y: 0}
|
||||||
snapOffsetDelta: {x: 0, y: 24.8}
|
snapOffsetDelta: {x: 0, y: 0}
|
||||||
snapCorner: 0
|
snapCorner: 0
|
||||||
id: Scene View/Physics Debugger
|
id: Scene View/Physics Debugger
|
||||||
index: 4
|
index: 4
|
||||||
@@ -939,7 +939,7 @@ MonoBehaviour:
|
|||||||
collapsed: 0
|
collapsed: 0
|
||||||
displayed: 0
|
displayed: 0
|
||||||
snapOffset: {x: 0, y: 0}
|
snapOffset: {x: 0, y: 0}
|
||||||
snapOffsetDelta: {x: 0, y: 24.8}
|
snapOffsetDelta: {x: 0, y: 0}
|
||||||
snapCorner: 0
|
snapCorner: 0
|
||||||
id: Scene View/Scene Visibility
|
id: Scene View/Scene Visibility
|
||||||
index: 5
|
index: 5
|
||||||
@@ -952,7 +952,7 @@ MonoBehaviour:
|
|||||||
collapsed: 0
|
collapsed: 0
|
||||||
displayed: 0
|
displayed: 0
|
||||||
snapOffset: {x: 0, y: 0}
|
snapOffset: {x: 0, y: 0}
|
||||||
snapOffsetDelta: {x: 0, y: 24.8}
|
snapOffsetDelta: {x: 0, y: 0}
|
||||||
snapCorner: 0
|
snapCorner: 0
|
||||||
id: Scene View/Particles
|
id: Scene View/Particles
|
||||||
index: 6
|
index: 6
|
||||||
@@ -1053,15 +1053,15 @@ MonoBehaviour:
|
|||||||
m_OverlaysVisible: 1
|
m_OverlaysVisible: 1
|
||||||
m_WindowGUID: 4b0f6f5c8c62bf3488500418d3d8472c
|
m_WindowGUID: 4b0f6f5c8c62bf3488500418d3d8472c
|
||||||
m_Gizmos: 1
|
m_Gizmos: 1
|
||||||
m_OverrideSceneCullingMask: 0
|
m_OverrideSceneCullingMask: 6917529027641081856
|
||||||
m_SceneIsLit: 0
|
m_SceneIsLit: 1
|
||||||
m_SceneLighting: 1
|
m_SceneLighting: 1
|
||||||
m_2DMode: 1
|
m_2DMode: 0
|
||||||
m_isRotationLocked: 0
|
m_isRotationLocked: 0
|
||||||
m_PlayAudio: 0
|
m_PlayAudio: 0
|
||||||
m_AudioPlay: 0
|
m_AudioPlay: 0
|
||||||
m_Position:
|
m_Position:
|
||||||
m_Target: {x: 555.8997, y: 291.5927, z: -0.53083503}
|
m_Target: {x: -3.6708412, y: -4.282875, z: 44.11006}
|
||||||
speed: 2
|
speed: 2
|
||||||
m_Value: {x: 555.8997, y: 291.5927, z: -0.53083503}
|
m_Value: {x: 555.8997, y: 291.5927, z: -0.53083503}
|
||||||
m_RenderMode: 0
|
m_RenderMode: 0
|
||||||
@@ -1074,7 +1074,7 @@ MonoBehaviour:
|
|||||||
m_SceneViewState:
|
m_SceneViewState:
|
||||||
m_AlwaysRefresh: 0
|
m_AlwaysRefresh: 0
|
||||||
showFog: 1
|
showFog: 1
|
||||||
showSkybox: 0
|
showSkybox: 1
|
||||||
showFlares: 1
|
showFlares: 1
|
||||||
showImageEffects: 1
|
showImageEffects: 1
|
||||||
showParticleSystems: 1
|
showParticleSystems: 1
|
||||||
@@ -1091,15 +1091,15 @@ MonoBehaviour:
|
|||||||
m_Size: {x: 0, y: 0}
|
m_Size: {x: 0, y: 0}
|
||||||
yGrid:
|
yGrid:
|
||||||
m_Fade:
|
m_Fade:
|
||||||
m_Target: 0
|
m_Target: 1
|
||||||
speed: 2
|
speed: 2
|
||||||
m_Value: 0
|
m_Value: 1
|
||||||
m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4}
|
m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4}
|
||||||
m_Pivot: {x: 0, y: 0, z: 0}
|
m_Pivot: {x: 0, y: 0, z: 0}
|
||||||
m_Size: {x: 1, y: 1}
|
m_Size: {x: 1, y: 1}
|
||||||
zGrid:
|
zGrid:
|
||||||
m_Fade:
|
m_Fade:
|
||||||
m_Target: 1
|
m_Target: 0
|
||||||
speed: 2
|
speed: 2
|
||||||
m_Value: 1
|
m_Value: 1
|
||||||
m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4}
|
m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4}
|
||||||
@@ -1109,17 +1109,17 @@ MonoBehaviour:
|
|||||||
m_GridAxis: 1
|
m_GridAxis: 1
|
||||||
m_gridOpacity: 0.5
|
m_gridOpacity: 0.5
|
||||||
m_Rotation:
|
m_Rotation:
|
||||||
m_Target: {x: 0, y: 0, z: 0, w: 1}
|
m_Target: {x: -0.25270963, y: 0.65854186, z: -0.25104713, w: -0.6629036}
|
||||||
speed: 2
|
speed: 2
|
||||||
m_Value: {x: 0, y: 0, z: 0, w: 1}
|
m_Value: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_Size:
|
m_Size:
|
||||||
m_Target: 522.41943
|
m_Target: 53.034447
|
||||||
speed: 2
|
speed: 2
|
||||||
m_Value: 522.41943
|
m_Value: 522.41943
|
||||||
m_Ortho:
|
m_Ortho:
|
||||||
m_Target: 1
|
m_Target: 0
|
||||||
speed: 2
|
speed: 2
|
||||||
m_Value: 1
|
m_Value: 0
|
||||||
m_CameraSettings:
|
m_CameraSettings:
|
||||||
m_Speed: 1
|
m_Speed: 1
|
||||||
m_SpeedNormalized: 0.5
|
m_SpeedNormalized: 0.5
|
||||||
@@ -1133,7 +1133,7 @@ MonoBehaviour:
|
|||||||
m_FarClip: 10000
|
m_FarClip: 10000
|
||||||
m_DynamicClip: 1
|
m_DynamicClip: 1
|
||||||
m_OcclusionCulling: 0
|
m_OcclusionCulling: 0
|
||||||
m_LastSceneViewRotation: {x: -0.25270963, y: 0.65854186, z: -0.25104713, w: -0.6629036}
|
m_LastSceneViewRotation: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226}
|
||||||
m_LastSceneViewOrtho: 0
|
m_LastSceneViewOrtho: 0
|
||||||
m_ReplacementShader: {fileID: 0}
|
m_ReplacementShader: {fileID: 0}
|
||||||
m_ReplacementString:
|
m_ReplacementString:
|
||||||
|
|||||||
Reference in New Issue
Block a user