text
stringlengths 7
35.3M
| id
stringlengths 11
185
| metadata
dict | __index_level_0__
int64 0
2.14k
|
---|---|---|---|
namespace UIWidgets
{
/// <summary>
/// Centered vertical slider (zero at center, positive and negative parts have different scales).
/// </summary>
public class CenteredSliderVertical : CenteredSlider
{
/// <summary>
/// Determines whether this instance is horizontal.
/// </summary>
/// <returns><c>true</c> if this instance is horizontal; otherwise, <c>false</c>.</returns>
public override bool IsHorizontal()
{
return false;
}
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/CenteredSlider/CenteredSliderVertical.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/CenteredSlider/CenteredSliderVertical.cs",
"repo_id": "jynew",
"token_count": 151
}
| 1,413 |
namespace UIWidgets
{
/// <summary>
/// IObservable.
/// </summary>
public interface ICollectionItemChanged
{
/// <summary>
/// Occurs when changed data of item in collection.
/// </summary>
event OnChange OnCollectionItemChange;
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/CollectionsUtilities/ICollectionItemChanged.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/CollectionsUtilities/ICollectionItemChanged.cs",
"repo_id": "jynew",
"token_count": 86
}
| 1,414 |
namespace UIWidgets
{
/// <summary>
/// Enumerator mode.
/// </summary>
public enum PoolEnumeratorMode
{
/// <summary>
/// Active instances only.
/// </summary>
Active = 0,
/// <summary>
/// Template and cached instances only.
/// </summary>
Cache = 1,
/// <summary>
/// Template and all instances.
/// </summary>
All = 2,
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/CollectionsUtilities/PoolEnumeratorMode.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/CollectionsUtilities/PoolEnumeratorMode.cs",
"repo_id": "jynew",
"token_count": 138
}
| 1,415 |
fileFormatVersion: 2
guid: f5ada11ac6f1694429c92aa7fb1cd809
MonoImporter:
serializedVersion: 2
defaultReferences:
- palette: {instanceID: 0}
- paletteShader: {fileID: 4800000, guid: 924310371a4ad61468c5bd37d72c42e2, type: 3}
- circleShader: {fileID: 4800000, guid: 74fd1b414e6efae4c8b10e6efff6f5d6, type: 3}
- paletteCursor: {instanceID: 0}
- slider: {instanceID: 0}
- sliderBackground: {instanceID: 0}
- sliderShader: {fileID: 4800000, guid: a7f0605273913b241ab9edfd96624ecb, type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ColorPicker/ColorPickerHSVPalette.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ColorPicker/ColorPickerHSVPalette.cs.meta",
"repo_id": "jynew",
"token_count": 239
}
| 1,416 |
fileFormatVersion: 2
guid: 7dd9ecc372e5eeb4e867e0ee00a7e5fb
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ColorPicker/ColorsList.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ColorPicker/ColorsList.cs.meta",
"repo_id": "jynew",
"token_count": 74
}
| 1,417 |
namespace UIWidgets
{
/// <summary>
/// Connector position.
/// </summary>
public enum ConnectorPosition
{
// Nearest = 0,
/// <summary>
/// Left.
/// </summary>
Left = 1,
/// <summary>
/// Right.
/// </summary>
Right = 2,
/// <summary>
/// Top.
/// </summary>
Top = 3,
/// <summary>
/// Bottom.
/// </summary>
Bottom = 4,
/// <summary>
/// Center.
/// </summary>
Center = 5,
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Connector/ConnectorPosition.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Connector/ConnectorPosition.cs",
"repo_id": "jynew",
"token_count": 189
}
| 1,418 |
#if UNITY_EDITOR && UIWIDGETS_TMPRO_SUPPORT && (UNITY_5_2 || UNITY_5_3 || UNITY_5_3_OR_NEWER)
namespace UIWidgets
{
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// Converter functions to replace component with another component.
/// </summary>
public partial class ConverterTMPro
{
/// <summary>
/// InputField component converter.
/// </summary>
public class ConverterInputField
{
readonly Text text;
readonly Graphic placeholder;
readonly bool interactable;
readonly Selectable.Transition transition;
readonly ColorBlock colors;
readonly SpriteState spriteState;
readonly AnimationTriggers animationTriggers;
readonly GameObject imageGO;
readonly GameObject targetGraphicGO;
readonly Navigation navigation;
readonly string value;
readonly int characterLimit;
readonly InputField.ContentType contentType;
readonly InputField.LineType lineType;
readonly InputField.InputType inputType;
readonly TouchScreenKeyboardType keyboardType;
readonly InputField.CharacterValidation characterValidation;
readonly float caretBlinkRate;
readonly int caretWidth;
readonly bool customCaretColor;
readonly Color caretColor;
readonly Color selectionColor;
readonly bool hideMobileInput;
readonly bool readOnly;
readonly object onValueChangedData;
readonly object onEndEditData;
readonly List<string> inputFieldRefs = new List<string>();
readonly List<string> textRefs = new List<string>();
readonly List<string> placeholderRefs = new List<string>();
readonly List<RectTransform> children = new List<RectTransform>();
readonly RectTransform textRectTransform;
readonly SerializedObjectCache cache;
static readonly string[] ValueChangedEvent = new string[]
{
#if UNITY_5_3 || UNITY_5_3_OR_NEWER
"m_OnValueChanged",
#else
"m_OnValueChange",
#endif
};
static readonly string[] EndEditFields = new string[] { "m_OnEndEdit", "m_OnDidEndEdit" };
/// <summary>
/// Initializes a new instance of the <see cref="ConverterInputField"/> class.
/// </summary>
/// <param name="input">Original component.</param>
/// <param name="cache">Cache.</param>
public ConverterInputField(InputField input, SerializedObjectCache cache)
{
this.cache = cache;
text = input.textComponent;
placeholder = input.placeholder;
interactable = input.interactable;
transition = input.transition;
colors = input.colors;
spriteState = input.spriteState;
animationTriggers = input.animationTriggers;
imageGO = Component2GameObject(input.image);
targetGraphicGO = Component2GameObject(input.targetGraphic);
navigation = input.navigation;
value = input.text;
characterLimit = input.characterLimit;
contentType = input.contentType;
lineType = input.lineType;
inputType = input.inputType;
keyboardType = input.keyboardType;
characterValidation = input.characterValidation;
caretBlinkRate = input.caretBlinkRate;
caretWidth = input.caretWidth;
customCaretColor = input.customCaretColor;
caretColor = input.caretColor;
selectionColor = input.selectionColor;
hideMobileInput = GetValue<bool>(input, "m_HideMobileInput");
readOnly = input.readOnly;
onValueChangedData = FieldData.GetEventData(input, ValueChangedEvent, cache);
onEndEditData = FieldData.GetEventData(input, EndEditFields, cache);
FindReferencesInComponent(input, input, inputFieldRefs);
FindReferencesInComponent(input, input.textComponent, textRefs);
if (input.placeholder != null)
{
FindReferencesInComponent(input, input.placeholder, placeholderRefs);
}
var t = input.transform;
for (int i = 0; i < t.childCount; i++)
{
children.Add(t.GetChild(i) as RectTransform);
}
textRectTransform = input.textComponent.transform as RectTransform;
}
/// <summary>
/// Get value of the protected or private field of the specified component.
/// </summary>
/// <typeparam name="T">Value type.</typeparam>
/// <param name="component">Component.</param>
/// <param name="fieldName">Field name.</param>
/// <returns>Value.</returns>
protected static T GetValue<T>(Component component, string fieldName)
{
var type = component.GetType();
FieldInfo field;
do
{
field = type.GetField(fieldName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.FlattenHierarchy);
type = type.BaseType;
if (type == null)
{
return default(T);
}
}
while (field == null);
return (T)field.GetValue(component);
}
/// <summary>
/// Find references to the component in the specified source and fill replaces list.
/// </summary>
/// <param name="source">Component with references.</param>
/// <param name="reference">Reference component.</param>
/// <param name="replaces">List of the properties with references to the deleted component.</param>
protected void FindReferencesInComponent(Component source, Component reference, List<string> replaces)
{
var serialized = cache.Get(source);
var property = serialized.GetIterator();
while (property.NextVisible(true))
{
if (property.propertyType != SerializedPropertyType.ObjectReference)
{
continue;
}
if (property.objectReferenceValue == null)
{
continue;
}
if (reference == (property.objectReferenceValue as Component))
{
replaces.Add(property.propertyPath);
}
}
}
/// <summary>
/// Set saved values to the new TMP_InputField component.
/// </summary>
/// <param name="input">New component.</param>
/// <param name="converter">Converter.</param>
public void Set(TMPro.TMP_InputField input, ConverterTMPro converter)
{
var textarea = converter.CreateGameObject("Text Area");
converter.SetParent(textarea.transform, input.transform);
var viewport = textarea.transform as RectTransform;
viewport.localRotation = textRectTransform.localRotation;
viewport.localPosition = textRectTransform.localPosition;
viewport.localScale = textRectTransform.localScale;
viewport.anchorMin = textRectTransform.anchorMin;
viewport.anchorMax = textRectTransform.anchorMax;
viewport.anchoredPosition = textRectTransform.anchoredPosition;
viewport.sizeDelta = textRectTransform.sizeDelta;
viewport.pivot = textRectTransform.pivot;
foreach (var child in children)
{
converter.SetParent(child, textarea.transform);
}
input.textViewport = viewport;
foreach (var child in children)
{
child.localRotation = Quaternion.identity;
child.localPosition = Vector3.zero;
child.localScale = Vector3.one;
child.anchorMin = Vector2.zero;
child.anchorMax = Vector2.one;
child.anchoredPosition = Vector2.zero;
child.sizeDelta = Vector2.zero;
child.pivot = new Vector2(0.5f, 0.5f);
}
input.textComponent = converter.Replace(text);
var placeholder_text = placeholder as Text;
input.placeholder = (placeholder_text != null)
? converter.Replace(placeholder_text)
: placeholder;
input.interactable = interactable;
input.transition = transition;
input.colors = colors;
input.spriteState = spriteState;
input.animationTriggers = animationTriggers;
input.image = GameObject2Component<Image>(imageGO);
input.targetGraphic = GameObject2Component<Graphic>(targetGraphicGO);
input.navigation = navigation;
input.text = value;
input.characterLimit = characterLimit;
input.contentType = Convert(contentType);
input.lineType = Convert(lineType);
input.inputType = Convert(inputType);
input.keyboardType = keyboardType;
input.characterValidation = Convert(characterValidation);
input.caretBlinkRate = caretBlinkRate;
input.caretWidth = caretWidth;
input.customCaretColor = customCaretColor;
input.caretColor = caretColor;
input.selectionColor = selectionColor;
input.shouldHideMobileInput = hideMobileInput;
input.readOnly = readOnly;
input.fontAsset = GetTMProFont();
FieldData.SetEventData(input, ValueChangedEvent, onValueChangedData, cache);
FieldData.SetEventData(input, EndEditFields, onEndEditData, cache);
var s_input = cache.Get(input);
foreach (var input_path in inputFieldRefs)
{
s_input.FindProperty(input_path).objectReferenceValue = input;
}
foreach (var text_path in textRefs)
{
s_input.FindProperty(text_path).objectReferenceValue = input.textComponent;
}
foreach (var placeholder_path in placeholderRefs)
{
s_input.FindProperty(placeholder_path).objectReferenceValue = input.placeholder;
}
s_input.ApplyModifiedProperties();
}
static GameObject Component2GameObject<T>(T component)
where T : Component
{
return (component == null) ? null : component.gameObject;
}
static T GameObject2Component<T>(GameObject go)
where T : Component
{
return (go == null) ? null : go.GetComponent<T>();
}
static TMPro.TMP_InputField.CharacterValidation Convert(InputField.CharacterValidation validation)
{
switch (validation)
{
case InputField.CharacterValidation.None:
return TMPro.TMP_InputField.CharacterValidation.None;
case InputField.CharacterValidation.Integer:
return TMPro.TMP_InputField.CharacterValidation.Integer;
case InputField.CharacterValidation.Decimal:
return TMPro.TMP_InputField.CharacterValidation.Decimal;
case InputField.CharacterValidation.Alphanumeric:
return TMPro.TMP_InputField.CharacterValidation.Alphanumeric;
case InputField.CharacterValidation.Name:
return TMPro.TMP_InputField.CharacterValidation.Name;
case InputField.CharacterValidation.EmailAddress:
return TMPro.TMP_InputField.CharacterValidation.EmailAddress;
}
return TMPro.TMP_InputField.CharacterValidation.None;
}
static TMPro.TMP_InputField.InputType Convert(InputField.InputType inputType)
{
switch (inputType)
{
case InputField.InputType.Standard:
return TMPro.TMP_InputField.InputType.Standard;
case InputField.InputType.AutoCorrect:
return TMPro.TMP_InputField.InputType.AutoCorrect;
case InputField.InputType.Password:
return TMPro.TMP_InputField.InputType.Password;
}
return TMPro.TMP_InputField.InputType.Standard;
}
static TMPro.TMP_InputField.LineType Convert(InputField.LineType lineType)
{
switch (lineType)
{
case InputField.LineType.SingleLine:
return TMPro.TMP_InputField.LineType.SingleLine;
case InputField.LineType.MultiLineNewline:
return TMPro.TMP_InputField.LineType.MultiLineNewline;
case InputField.LineType.MultiLineSubmit:
return TMPro.TMP_InputField.LineType.MultiLineSubmit;
}
return TMPro.TMP_InputField.LineType.SingleLine;
}
static TMPro.TMP_InputField.ContentType Convert(InputField.ContentType contentType)
{
switch (contentType)
{
case InputField.ContentType.Standard:
return TMPro.TMP_InputField.ContentType.Standard;
case InputField.ContentType.Autocorrected:
return TMPro.TMP_InputField.ContentType.Autocorrected;
case InputField.ContentType.IntegerNumber:
return TMPro.TMP_InputField.ContentType.IntegerNumber;
case InputField.ContentType.DecimalNumber:
return TMPro.TMP_InputField.ContentType.DecimalNumber;
case InputField.ContentType.Alphanumeric:
return TMPro.TMP_InputField.ContentType.Alphanumeric;
case InputField.ContentType.Name:
return TMPro.TMP_InputField.ContentType.Name;
case InputField.ContentType.EmailAddress:
return TMPro.TMP_InputField.ContentType.EmailAddress;
case InputField.ContentType.Password:
return TMPro.TMP_InputField.ContentType.Password;
case InputField.ContentType.Pin:
return TMPro.TMP_InputField.ContentType.Pin;
case InputField.ContentType.Custom:
return TMPro.TMP_InputField.ContentType.Custom;
}
return TMPro.TMP_InputField.ContentType.Standard;
}
}
}
}
#endif
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Converter/ConverterInputField.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Converter/ConverterInputField.cs",
"repo_id": "jynew",
"token_count": 4499
}
| 1,419 |
fileFormatVersion: 2
guid: 2237a16739f62b9458ba75e7f46e2334
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Core/IUpgradeable.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Core/IUpgradeable.cs.meta",
"repo_id": "jynew",
"token_count": 70
}
| 1,420 |
namespace UIWidgets
{
using System;
using UnityEngine;
/// <summary>
/// Wrapper for the Cursor class.
/// Required to support multiple behavior components on the same GameObject (like Resizable and Rotatable).
/// </summary>
public static class UICursor
{
/// <summary>
/// Allow to replace cursor with another version.
/// Use to replace default cursors with Hi-DPI version.
/// </summary>
[Obsolete("Replaced with CursorSelector.")]
public static Func<Cursors.Cursor, Cursors.Cursor> Replacement = null;
/// <summary>
/// No replacement.
/// </summary>
/// <param name="cursor">Cursor.</param>
/// <returns>New cursor.</returns>
[Obsolete("No more used.")]
public static Cursors.Cursor NoReplacement(Cursors.Cursor cursor)
{
return cursor;
}
/// <summary>
/// Default cursor.
/// </summary>
[Obsolete("Replaced with Cursors.Default.")]
public static Texture2D DefaultCursor;
/// <summary>
/// Default cursor hot spot.
/// </summary>
[Obsolete("Replaced with Cursors.Default.")]
public static Vector2 DefaultCursorHotSpot;
/// <summary>
/// Default cursor.
/// </summary>
[Obsolete("Replaced with Cursors.Default.")]
public static Cursors.Cursor Default;
static bool cursorsWarningDisplayed;
static Cursors cursors;
/// <summary>
/// Cursors.
/// </summary>
public static Cursors Cursors
{
get
{
if ((cursors == null) && !cursorsWarningDisplayed)
{
Debug.LogWarning("Cursors are not specified. Please specify cursors using the unique CursorsDPISelector component or with a field at component.");
cursorsWarningDisplayed = true;
}
return cursors;
}
set
{
cursors = value;
}
}
/// <summary>
/// Has cursors.
/// </summary>
public static bool HasCursors
{
get
{
return cursors != null;
}
}
/// <summary>
/// Current cursor owner.
/// </summary>
static Component currentOwner;
/// <summary>
/// Current cursor.
/// </summary>
static Cursors.Cursor Current;
/// <summary>
/// Cursor mode.
/// </summary>
public static CursorMode Mode =
#if UNITY_WEBGL
CursorMode.ForceSoftware;
#else
CursorMode.Auto;
#endif
/// <summary>
/// Can the specified component set cursor?
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "HAA0603:Delegate allocation from a method group", Justification = "Required.")]
public static Func<Component, bool> CanSet = DefaultCanSet;
/// <summary>
/// Set cursor.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "HAA0603:Delegate allocation from a method group", Justification = "Required.")]
public static Action<Component, Cursors.Cursor> Set = DefaultSet;
/// <summary>
/// Reset cursor.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "HAA0603:Delegate allocation from a method group", Justification = "Required.")]
public static Action<Component> Reset = DefaultReset;
#if UNITY_EDITOR && UNITY_2019_3_OR_NEWER
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
static void StaticInit()
{
Cursors = null;
cursorsWarningDisplayed = false;
currentOwner = null;
Mode =
#if UNITY_WEBGL
CursorMode.ForceSoftware;
#else
CursorMode.Auto;
#endif
CanSet = DefaultCanSet;
Set = DefaultSet;
Reset = DefaultReset;
}
#endif
/// <summary>
/// Can the specified component set cursor?
/// </summary>
/// <param name="owner">Component.</param>
/// <returns>true if component can set cursor; otherwise false.</returns>
public static bool DefaultCanSet(Component owner)
{
if (owner == null)
{
throw new ArgumentNullException("owner");
}
if (currentOwner == null)
{
return true;
}
return owner == currentOwner;
}
/// <summary>
/// Set cursor.
/// </summary>
/// <param name="owner">Owner.</param>
/// <param name="texture">Cursor texture.</param>
/// <param name="hotspot">Cursor hot spot.</param>
[Obsolete("Replaced with Set(Component owner, Cursors.Cursor cursor).")]
public static void DefaultSet(Component owner, Texture2D texture, Vector2 hotspot)
{
if (!CanSet(owner))
{
return;
}
currentOwner = owner;
SetCursor(new Cursors.Cursor(texture, hotspot));
}
/// <summary>
/// Set cursor.
/// </summary>
/// <param name="owner">Owner.</param>
/// <param name="cursor">Cursor.</param>
public static void DefaultSet(Component owner, Cursors.Cursor cursor)
{
if (!CanSet(owner))
{
return;
}
currentOwner = owner;
SetCursor(cursor);
}
static void SetCursor(Cursors.Cursor cursor)
{
if (Current == cursor)
{
return;
}
Current = cursor;
#pragma warning disable 0618
var actual = (Replacement != null) ? Replacement(Current) : Current;
#pragma warning restore 0618
Cursor.SetCursor(actual.Texture, actual.Hotspot, Mode);
}
/// <summary>
/// Reset cursor.
/// </summary>
/// <param name="owner">Owner.</param>
public static void DefaultReset(Component owner)
{
if (!CanSet(owner))
{
return;
}
currentOwner = null;
SetCursor(Cursors != null ? Cursors.Default : default(Cursors.Cursor));
}
/// <summary>
/// Show obsolete warning,
/// </summary>
public static void ObsoleteWarning()
{
Debug.LogWarning("Cursors texture and hot spot fields are obsolete and replaced with UICursorSettings component. Set DefaultCursorTexture to null to disable warning or reset component.");
}
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Cursor/UICursor.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Cursor/UICursor.cs",
"repo_id": "jynew",
"token_count": 2029
}
| 1,421 |
fileFormatVersion: 2
guid: c154e6862fb9fe247a365b04732f8972
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Dialog/DialogButton.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Dialog/DialogButton.cs.meta",
"repo_id": "jynew",
"token_count": 68
}
| 1,422 |
fileFormatVersion: 2
guid: fec72187c680d5c4fad5f95512b4b49c
timeCreated: 1603311285
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Dialog/IHideable.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Dialog/IHideable.cs.meta",
"repo_id": "jynew",
"token_count": 109
}
| 1,423 |
fileFormatVersion: 2
guid: be7618360e7664242ab7d52ff29bc1e3
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Dialog/PickerStringV2.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Dialog/PickerStringV2.cs.meta",
"repo_id": "jynew",
"token_count": 69
}
| 1,424 |
fileFormatVersion: 2
guid: 24527fb9156c00d4da20c2fefd80eddf
MonoImporter:
serializedVersion: 2
defaultReferences:
- AllowDropCursor: {fileID: 2800000, guid: 7114ce38ced91cf44816ec1e50cf9d48, type: 3}
- DeniedDropCursor: {fileID: 2800000, guid: e0339fdde21c99d409e93d07abc4fdef, type: 3}
- DefaultCursorTexture: {instanceID: 0}
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Drag-and-Drop/DragSupport.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Drag-and-Drop/DragSupport.cs.meta",
"repo_id": "jynew",
"token_count": 164
}
| 1,425 |
fileFormatVersion: 2
guid: 9f553f3cf382e334b9a1f03357adbee0
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Drag-and-Drop/ListViewCustomDropSupport.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Drag-and-Drop/ListViewCustomDropSupport.cs.meta",
"repo_id": "jynew",
"token_count": 70
}
| 1,426 |
namespace UIWidgets
{
using UnityEngine;
using UnityEngine.EventSystems;
/// <summary>
/// Redirect drag events from current gameobject to specified.
/// </summary>
[RequireComponent(typeof(RectTransform))]
public class DragRedirect : UIBehaviour, IBeginDragHandler, IInitializePotentialDragHandler, IDragHandler, IEndDragHandler, IScrollHandler
{
/// <summary>
/// Drag events will be redirected to this gameobject.
/// </summary>
[SerializeField]
public GameObject RedirectTo;
/// <summary>
/// Mark drag event as used.
/// </summary>
[SerializeField]
[Tooltip("Mark drag event as used.")]
public bool MarkAsUsed = true;
/// <summary>
/// Minimal distance from start position to allow event redirect.
/// </summary>
[SerializeField]
public Vector2 MinDistance = Vector2.zero;
/// <summary>
/// Start position.
/// </summary>
protected Vector2 StartPosition;
/// <summary>
/// Is valid distance?
/// </summary>
/// <param name="eventData">Event data.</param>
/// <returns>true if distance exceeds min distance; otherwise false.</returns>
protected virtual bool IsValidDistance(PointerEventData eventData)
{
var delta = eventData.position - StartPosition;
return (Mathf.Abs(delta.x) >= MinDistance.x) && (Mathf.Abs(delta.y) >= MinDistance.y);
}
/// <summary>
/// Gets the handlers.
/// </summary>
/// <returns>The handlers.</returns>
/// <typeparam name="T">The handler type.</typeparam>
protected T[] GetHandlers<T>()
where T : class
{
#if UNITY_5_0 || UNITY_5_1 || UNITY_5_2 || UNITY_5_3 || UNITY_5_3_OR_NEWER
return RedirectTo.GetComponents<T>();
#else
var components = RedirectTo.GetComponents(typeof(T));
var handlers = new T[components.Length];
for (int i = 0; i < components.Length; i++)
{
handlers[i] = components[i] as T;
}
return handlers;
#endif
}
/// <summary>
/// Called by a BaseInputModule before a drag is started.
/// </summary>
/// <param name="eventData">Event data.</param>
public void OnBeginDrag(PointerEventData eventData)
{
StartPosition = eventData.position;
foreach (var handler in GetHandlers<IBeginDragHandler>())
{
if (handler is DragRedirect)
{
continue;
}
eventData.Reset();
handler.OnBeginDrag(eventData);
}
if (MarkAsUsed)
{
eventData.Use();
}
else
{
eventData.Reset();
}
}
/// <summary>
/// Called by a BaseInputModule when a drag has been found but before it is valid to begin the drag.
/// </summary>
/// <param name="eventData">Event data.</param>
public void OnInitializePotentialDrag(PointerEventData eventData)
{
foreach (var handler in GetHandlers<IInitializePotentialDragHandler>())
{
if (handler is DragRedirect)
{
continue;
}
eventData.Reset();
handler.OnInitializePotentialDrag(eventData);
}
if (MarkAsUsed)
{
eventData.Use();
}
else
{
eventData.Reset();
}
}
/// <summary>
/// When dragging is occurring this will be called every time the cursor is moved.
/// </summary>
/// <param name="eventData">Event data.</param>
public void OnDrag(PointerEventData eventData)
{
if (!IsValidDistance(eventData))
{
return;
}
foreach (var handler in GetHandlers<IDragHandler>())
{
if (handler is DragRedirect)
{
continue;
}
eventData.Reset();
handler.OnDrag(eventData);
}
if (MarkAsUsed)
{
eventData.Use();
}
else
{
eventData.Reset();
}
}
/// <summary>
/// Called by a BaseInputModule when a drag is ended.
/// </summary>
/// <param name="eventData">Event data.</param>
public void OnEndDrag(PointerEventData eventData)
{
if (!IsValidDistance(eventData))
{
return;
}
foreach (var handler in GetHandlers<IEndDragHandler>())
{
if (handler is DragRedirect)
{
continue;
}
eventData.Reset();
handler.OnEndDrag(eventData);
}
if (MarkAsUsed)
{
eventData.Use();
}
else
{
eventData.Reset();
}
}
/// <summary>
/// Called by a BaseInputModule when an OnScroll event occurs.
/// </summary>
/// <param name="eventData">Event data.</param>
public void OnScroll(PointerEventData eventData)
{
foreach (var handler in GetHandlers<IScrollHandler>())
{
if (handler is DragRedirect)
{
continue;
}
eventData.Reset();
handler.OnScroll(eventData);
}
if (MarkAsUsed)
{
eventData.Use();
}
else
{
eventData.Reset();
}
}
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Draggable/DragRedirect.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Draggable/DragRedirect.cs",
"repo_id": "jynew",
"token_count": 1833
}
| 1,427 |
namespace UIWidgets
{
using System;
using UnityEngine;
using UnityEngine.EventSystems;
/// <summary>
/// No more useful.
/// Return selection to last selected object after drag.
/// </summary>
[Obsolete("No more useful.")]
public class OnDragKeepSelected : MonoBehaviour, IEndDragHandler
{
/// <summary>
/// Process the end drag event.
/// </summary>
/// <param name="eventData">Event data.</param>
public void OnEndDrag(PointerEventData eventData)
{
#if UNITY_5_2 || UNITY_5_3 || UNITY_5_3_OR_NEWER
#else
EventSystem.current.SetSelectedGameObject(EventSystem.current.lastSelectedGameObject);
#endif
}
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Draggable/OnDragKeepSelected.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Draggable/OnDragKeepSelected.cs",
"repo_id": "jynew",
"token_count": 233
}
| 1,428 |
fileFormatVersion: 2
guid: 404e6c03afdbb924ea3f3fb4e85c793c
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/EasyLayout/EasyLayoutEllipseScroll.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/EasyLayout/EasyLayoutEllipseScroll.cs.meta",
"repo_id": "jynew",
"token_count": 72
}
| 1,429 |
fileFormatVersion: 2
guid: c9b3fe6ab13a4314e81a8ff8707a4b4f
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/EasyLayout/LayoutElementMax.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/EasyLayout/LayoutElementMax.cs.meta",
"repo_id": "jynew",
"token_count": 74
}
| 1,430 |
namespace UIWidgets.Attributes
{
using System;
/// <summary>
/// Display the field only if the value of the specified field with enum type match condition.
/// </summary>
[AttributeUsage(AttributeTargets.Field)]
public sealed class EditorConditionEnumAttribute : Attribute, IEditorCondition
{
readonly string field;
/// <summary>
/// Field to check.
/// </summary>
public string Field
{
get
{
return field;
}
}
readonly int[] condition;
/// <summary>
/// Values to match.
/// </summary>
public int[] Condition
{
get
{
return condition;
}
}
/// <summary>
/// Initializes a new instance of the <see cref="EditorConditionEnumAttribute"/> class.
/// </summary>
/// <param name="field">Field to check.</param>
/// <param name="condition">Condition to display the field.</param>
public EditorConditionEnumAttribute(string field, params int[] condition)
{
this.field = field;
this.condition = condition;
}
#if UNITY_EDITOR
/// <summary>
/// Function to check field value.
/// </summary>
/// <param name="property">Property.</param>
/// <returns>true if condition is correct; otherwise false.</returns>
public bool IsValid(UnityEditor.SerializedProperty property)
{
return Array.IndexOf(condition, property.enumValueIndex) != -1;
}
#endif
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Editor.Conditions/EditorConditionEnumAttribute.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Editor.Conditions/EditorConditionEnumAttribute.cs",
"repo_id": "jynew",
"token_count": 458
}
| 1,431 |
fileFormatVersion: 2
guid: ed15f1656ca8eae429730a82e5ab2125
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences:
- EffectShader: {fileID: 4800000, guid: da4fe393252bc6e488d5f8631ed4b252, type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Effects/LinesDrawer.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Effects/LinesDrawer.cs.meta",
"repo_id": "jynew",
"token_count": 131
}
| 1,432 |
fileFormatVersion: 2
guid: 23fd792cc5126e24abaa0607a3e3d885
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/IO/FileSystemEntry.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/IO/FileSystemEntry.cs.meta",
"repo_id": "jynew",
"token_count": 69
}
| 1,433 |
namespace UIWidgets
{
using UIWidgets.Styles;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
/// <summary>
/// InputField adapter to work with both Unity text and TMPro text.
/// </summary>
public class InputFieldExtendedAdapter : MonoBehaviour, IInputFieldExtended
{
IInputFieldExtended proxy;
/// <summary>
/// Proxy.
/// </summary>
protected IInputFieldExtended Proxy
{
get
{
if (proxy == null)
{
proxy = GetProxy();
}
return proxy;
}
}
/// <summary>
/// Proxy gameobject.
/// </summary>
public GameObject GameObject
{
get
{
return Proxy.gameObject;
}
}
/// <summary>
/// Proxy value.
/// </summary>
public string Value
{
get
{
return Proxy.text;
}
set
{
Proxy.text = (value == null) ? string.Empty : value;
}
}
/// <summary>
/// Proxy value.
/// Alias for Value.
/// </summary>
public string text
{
get
{
return Proxy.text;
}
set
{
Proxy.text = value;
}
}
/// <summary>
/// The Unity Event to call when edit.
/// </summary>
/// <value>The OnValueChange.</value>
public UnityEvent<string> onValueChanged
{
get
{
return Proxy.onValueChanged;
}
}
/// <summary>
/// The Unity Event to call when editing has ended.
/// </summary>
/// <value>The OnEndEdit.</value>
public UnityEvent<string> onEndEdit
{
get
{
return Proxy.onEndEdit;
}
}
/// <summary>
/// Current InputField caret position (also selection tail).
/// </summary>
/// <value>The caret position.</value>
public int caretPosition
{
get
{
return Proxy.caretPosition;
}
set
{
Proxy.caretPosition = value;
}
}
/// <summary>
/// Is the InputField eligible for interaction (excludes canvas groups).
/// </summary>
/// <value><c>true</c> if interactable; otherwise, <c>false</c>.</value>
public bool interactable
{
get
{
return Proxy.interactable;
}
set
{
Proxy.interactable = value;
}
}
/// <summary>
/// Text component.
/// </summary>
public Graphic textComponent
{
get
{
return Proxy.textComponent;
}
set
{
Proxy.textComponent = value;
}
}
/// <summary>
/// Placeholder.
/// </summary>
public Graphic placeholder
{
get
{
return Proxy.placeholder;
}
set
{
Proxy.placeholder = value;
}
}
/// <summary>
/// If the proxy was canceled and will revert back to the original text.
/// </summary>
public bool wasCanceled
{
get
{
return Proxy.wasCanceled;
}
}
/// <summary>
/// Get text proxy.
/// </summary>
/// <returns>Proxy instance.</returns>
protected virtual IInputFieldExtended GetProxy()
{
var input = GetComponent<InputFieldExtended>();
if (input != null)
{
return input;
}
#if UIWIDGETS_TMPRO_SUPPORT && (UNITY_5_2 || UNITY_5_3 || UNITY_5_3_OR_NEWER)
var tmpro = GetComponent<InputFieldTMProExtended>();
if (tmpro != null)
{
return tmpro;
}
#endif
Debug.LogWarning("Not found any InputFieldExtended component.", this);
return new InputFieldExtendedNull();
}
/// <summary>
/// Determines whether InputField instance is null.
/// </summary>
/// <returns><c>true</c> if InputField instance is null; otherwise, <c>false</c>.</returns>
public bool IsNull()
{
return Proxy.IsNull();
}
/// <summary>
/// Determines whether this lineType is LineType.MultiLineNewline.
/// </summary>
/// <returns><c>true</c> if lineType is LineType.MultiLineNewline; otherwise, <c>false</c>.</returns>
public bool IsMultiLineNewline()
{
return Proxy.IsMultiLineNewline();
}
/// <summary>
/// Function to activate the InputField to begin processing Events.
/// </summary>
public void ActivateInputField()
{
Proxy.ActivateInputField();
}
#if UNITY_4_6 || UNITY_4_7 || UNITY_5_0
/// <summary>
/// Move caret to end.
/// </summary>
public void MoveToEnd()
{
Proxy.MoveToEnd();
}
#endif
/// <summary>
/// Set focus to InputField.
/// </summary>
public void Focus()
{
Proxy.Focus();
}
/// <summary>
/// Set focus to InputField.
/// </summary>
public void Select()
{
Proxy.Select();
}
/// <summary>
/// Function to validate input.
/// </summary>
public InputField.OnValidateInput Validation
{
get
{
return Proxy.Validation;
}
set
{
Proxy.Validation = value;
}
}
/// <summary>
/// Function to process changed value.
/// </summary>
public UnityAction<string> ValueChanged
{
get
{
return Proxy.ValueChanged;
}
set
{
Proxy.ValueChanged = value;
}
}
/// <summary>
/// The Unity Event to call when edit.
/// </summary>
/// <value>The OnValueChange.</value>
UnityEvent<string> IInputFieldProxy.onValueChanged
{
get
{
return Proxy.onValueChanged;
}
}
/// <summary>
/// Function to process end edit.
/// </summary>
public UnityAction<string> ValueEndEdit
{
get
{
return Proxy.ValueEndEdit;
}
set
{
Proxy.ValueEndEdit = value;
}
}
/// <summary>
/// The Unity Event to call when editing has ended.
/// </summary>
/// <value>The OnEndEdit.</value>
UnityEvent<string> IInputFieldProxy.onEndEdit
{
get
{
return Proxy.onEndEdit;
}
}
/// <summary>
/// Start selection position.
/// </summary>
public int SelectionStart
{
get
{
return Proxy.SelectionStart;
}
}
/// <summary>
/// End selection position.
/// </summary>
public int SelectionEnd
{
get
{
return Proxy.SelectionEnd;
}
}
/// <inheritdoc/>
public virtual void SetStyle(StyleSpinner styleSpinner, Style style)
{
Proxy.SetStyle(styleSpinner, style);
}
/// <inheritdoc/>
public virtual void GetStyle(StyleSpinner styleSpinner, Style style)
{
Proxy.GetStyle(styleSpinner, style);
}
#if UNITY_EDITOR
/// <summary>
/// Validate this instance.
/// </summary>
protected virtual void OnValidate()
{
GetProxy();
}
#endif
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/InputField/InputFieldExtendedAdapter.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/InputField/InputFieldExtendedAdapter.cs",
"repo_id": "jynew",
"token_count": 2554
}
| 1,434 |
fileFormatVersion: 2
guid: 0755480c6960be445908d4a46143d250
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/LayoutSwitcher/LayoutSwitcherEvent.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/LayoutSwitcher/LayoutSwitcherEvent.cs.meta",
"repo_id": "jynew",
"token_count": 69
}
| 1,435 |
fileFormatVersion: 2
guid: 8884656bc0be6c546ac2b8d41072a5d0
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ListView/Events/ListViewEvent.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ListView/Events/ListViewEvent.cs.meta",
"repo_id": "jynew",
"token_count": 71
}
| 1,436 |
fileFormatVersion: 2
guid: edbda90aeecc8224cbb9e5cbbb6f6e2d
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ListView/Events/ListViewItemMove.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ListView/Events/ListViewItemMove.cs.meta",
"repo_id": "jynew",
"token_count": 73
}
| 1,437 |
fileFormatVersion: 2
guid: 9a675f580a63ac147ada2cebe09f1dd0
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ListView/IViewData.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ListView/IViewData.cs.meta",
"repo_id": "jynew",
"token_count": 69
}
| 1,438 |
namespace UIWidgets
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using UIWidgets.Attributes;
using UIWidgets.l10n;
using UIWidgets.Styles;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using UnityEngine.Serialization;
using UnityEngine.UI;
/// <summary>
/// Base class for custom ListViews.
/// </summary>
/// <typeparam name="TItemView">Type of DefaultItem component.</typeparam>
/// <typeparam name="TItem">Type of item.</typeparam>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Reviewed.")]
[DataBindSupport]
public partial class ListViewCustom<TItemView, TItem> : ListViewCustomBase, IUpdatable, ILateUpdatable, IListViewCallbacks<TItemView>
where TItemView : ListViewItem
{
/// <summary>
/// Template class.
/// </summary>
[Serializable]
public class Template : ListViewItemTemplate<TItemView>
{
/// <summary>
/// Initializes a new instance of the <see cref="Template"/> class.
/// </summary>
public Template()
: base()
{
}
}
/// <summary>
/// DataSourceEvent.
/// </summary>
public class DataSourceEvent : UnityEvent<ListViewCustom<TItemView, TItem>>
{
}
/// <inheritdoc/>
public override ListViewType ListType
{
get
{
return listType;
}
set
{
listType = value;
if (listRenderer != null)
{
listRenderer.Disable();
listRenderer = null;
}
if (isListViewCustomInited)
{
SetDefaultItem(defaultItem);
}
}
}
/// <summary>
/// The items.
/// </summary>
[SerializeField]
protected List<TItem> customItems = new List<TItem>();
/// <summary>
/// Data source.
/// </summary>
#if UNITY_2020_1_OR_NEWER
[NonSerialized]
#endif
protected ObservableList<TItem> dataSource;
/// <summary>
/// Gets or sets the data source.
/// </summary>
/// <value>The data source.</value>
[DataBindField]
public virtual ObservableList<TItem> DataSource
{
get
{
if (dataSource == null)
{
dataSource = new ObservableList<TItem>(customItems);
dataSource.OnChange += UpdateItems;
}
if (!isListViewCustomInited)
{
Init();
}
return dataSource;
}
set
{
if (!isListViewCustomInited)
{
Init();
}
SetNewItems(value, IsMainThread);
if (IsMainThread)
{
ListRenderer.SetPosition(0f);
}
else
{
DataSourceSetted = true;
}
}
}
[SerializeField]
[FormerlySerializedAs("DefaultItem")]
TItemView defaultItem;
/// <summary>
/// The default item template.
/// </summary>
public TItemView DefaultItem
{
get
{
return defaultItem;
}
set
{
SetDefaultItem(value);
}
}
#region ComponentPool fields
/// <summary>
/// Components list.
/// </summary>
[SerializeField]
[HideInInspector]
protected List<TItemView> Components = new List<TItemView>();
/// <summary>
/// Own templates list.
/// </summary>
[SerializeField]
[HideInInspector]
protected List<Template> OwnTemplates = new List<Template>();
/// <summary>
/// Shared templates list.
/// </summary>
[SerializeField]
[HideInInspector]
protected List<Template> SharedTemplates;
/// <summary>
/// Templates list.
/// </summary>
protected List<Template> Templates
{
get
{
if (SharedTemplates != null)
{
return SharedTemplates;
}
return OwnTemplates;
}
}
/// <summary>
/// Components displayed indices.
/// </summary>
[SerializeField]
[HideInInspector]
protected List<int> ComponentsDisplayedIndices = new List<int>();
/// <inheritdoc/>
public override bool DestroyDefaultItemsCache
{
get
{
return destroyDefaultItemsCache;
}
set
{
destroyDefaultItemsCache = value;
}
}
ListViewComponentPool componentsPool;
/// <summary>
/// The components pool.
/// Constructor with lists needed to avoid lost connections when instantiated copy of the inited ListView.
/// </summary>
protected virtual ListViewComponentPool ComponentsPool
{
get
{
if (componentsPool == null)
{
componentsPool = new ListViewComponentPool(this);
componentsPool.Init();
}
return componentsPool;
}
}
#endregion
/// <summary>
/// Gets the selected item.
/// </summary>
/// <value>The selected item.</value>
[DataBindField]
public TItem SelectedItem
{
get
{
if (SelectedIndex == -1)
{
return default(TItem);
}
return DataSource[SelectedIndex];
}
}
/// <summary>
/// Selected items.
/// </summary>
[DataBindField]
public List<TItem> SelectedItems
{
get
{
var result = new List<TItem>(selectedIndices.Count);
GetSelectedItems(result);
return result;
}
set
{
SetSelectedItems(value, true);
}
}
[Obsolete("Replaced with DataSource.Comparison.")]
Func<IEnumerable<TItem>, IEnumerable<TItem>> sortFunc;
/// <summary>
/// Sort function.
/// Deprecated. Replaced with DataSource.Comparison.
/// </summary>
[Obsolete("Replaced with DataSource.Comparison.")]
public Func<IEnumerable<TItem>, IEnumerable<TItem>> SortFunc
{
get
{
return sortFunc;
}
set
{
sortFunc = value;
if (Sort && isListViewCustomInited)
{
UpdateItems();
}
}
}
/// <inheritdoc/>
protected override Vector2 ContainerAnchoredPosition
{
get
{
var pos = Container.anchoredPosition;
if (ReversedOrder)
{
var size = ListRenderer.ListSize() - (ScaledScrollRectSize() - LayoutBridge.GetFullMargin());
if (IsHorizontal())
{
pos.x = size - pos.x;
}
else
{
pos.y = size - pos.y;
}
}
var scale = Container.localScale;
return new Vector2(pos.x / scale.x, pos.y / scale.y);
}
set
{
if (ReversedOrder)
{
var size = ListRenderer.ListSize() - (ScaledScrollRectSize() - LayoutBridge.GetFullMargin());
if (IsHorizontal())
{
value.x = size - value.x;
}
else
{
value.y = size - value.y;
}
}
var scale = Container.localScale;
Container.anchoredPosition = new Vector2(value.x * scale.x, value.y * scale.y);
}
}
/// <summary>
/// What to do when the object selected.
/// </summary>
[DataBindEvent("SelectedItem", "SelectedItems")]
[SerializeField]
public ListViewCustomEvent OnSelectObject = new ListViewCustomEvent();
/// <summary>
/// What to do when the object deselected.
/// </summary>
[DataBindEvent("SelectedItem", "SelectedItems")]
[SerializeField]
public ListViewCustomEvent OnDeselectObject = new ListViewCustomEvent();
/// <summary>
/// Called after component instantiated.
/// </summary>
public event Action<TItemView> OnComponentCreated;
/// <summary>
/// Called before component destroyed.
/// </summary>
public event Action<TItemView> OnComponentDestroyed;
/// <summary>
/// Called after component activated.
/// </summary>
public event Action<TItemView> OnComponentActivated;
/// <summary>
/// Called after component cached.
/// </summary>
public event Action<TItemView> OnComponentCached;
#region ListRenderer fields
/// <summary>
/// The layout elements of the DefaultItem.
/// </summary>
[SerializeField]
[HideInInspector]
protected List<ILayoutElement> LayoutElements = new List<ILayoutElement>();
#endregion
[SerializeField]
[HideInInspector]
ListViewTypeBase listRenderer;
/// <summary>
/// ListView renderer.
/// </summary>
protected ListViewTypeBase ListRenderer
{
get
{
if (listRenderer == null)
{
listRenderer = GetRenderer(ListType);
}
return listRenderer;
}
set
{
listRenderer = value;
}
}
/// <inheritdoc/>
public override int MaxVisibleItems
{
get
{
Init();
return ListRenderer.MaxVisibleItems;
}
}
/// <summary>
/// Selected items cache (to keep valid selected indices with updates).
/// </summary>
protected List<TItem> SelectedItemsCache = new List<TItem>();
/// <inheritdoc/>
protected override ILayoutBridge LayoutBridge
{
get
{
if (layoutBridge == null)
{
if (Layout != null)
{
layoutBridge = new EasyLayoutBridge(Layout, DefaultItem.transform as RectTransform, setContentSizeFitter && ListRenderer.AllowSetContentSizeFitter, ListRenderer.AllowControlRectTransform)
{
IsHorizontal = IsHorizontal(),
};
ListRenderer.DirectionChanged();
}
else
{
var hv_layout = Container.GetComponent<HorizontalOrVerticalLayoutGroup>();
if (hv_layout != null)
{
layoutBridge = new StandardLayoutBridge(hv_layout, DefaultItem.transform as RectTransform, setContentSizeFitter && ListRenderer.AllowSetContentSizeFitter);
}
}
}
return layoutBridge;
}
}
/// <inheritdoc/>
public override bool LoopedListAvailable
{
get
{
return LoopedList && Virtualization && ListRenderer.IsVirtualizationSupported() && ListRenderer.AllowLoopedList;
}
}
/// <summary>
/// Raised when DataSource changed.
/// </summary>
public DataSourceEvent OnDataSourceChanged = new DataSourceEvent();
DefaultSelector defaultTemplateSelector;
/// <summary>
/// Default template selector.
/// </summary>
protected DefaultSelector DefaultTemplateSelector
{
get
{
if (defaultTemplateSelector == null)
{
if (DefaultItem == null)
{
Debug.LogError("ListView.DefaultItem is not specified.", this);
}
defaultTemplateSelector = new DefaultSelector(DefaultItem);
}
return defaultTemplateSelector;
}
}
IListViewTemplateSelector<TItemView, TItem> templateSelector;
/// <summary>
/// Template selector.
/// </summary>
public IListViewTemplateSelector<TItemView, TItem> TemplateSelector
{
get
{
if (templateSelector == null)
{
templateSelector = DefaultTemplateSelector;
}
return templateSelector;
}
set
{
if (value == null)
{
throw new ArgumentNullException("value");
}
if (ReferenceEquals(templateSelector, value))
{
return;
}
templateSelector = value;
if ((componentsPool != null) && DestroyDefaultItemsCache)
{
componentsPool.Destroy(templateSelector.AllTemplates());
}
if (isListViewCustomInited)
{
TemplatesChanged();
}
}
}
[SerializeField]
[FormerlySerializedAs("stopScrollAtItemCenter")]
[Tooltip("Custom scroll inertia until reach item center.")]
bool scrollInertiaUntilItemCenter;
/// <summary>
/// Custom scroll inertia until reach item center.
/// </summary>
public bool ScrollInertiaUntilItemCenter
{
get
{
return scrollInertiaUntilItemCenter;
}
set
{
if (scrollInertiaUntilItemCenter != value)
{
scrollInertiaUntilItemCenter = value;
ListRenderer.ToggleScrollToItemCenter(scrollInertiaUntilItemCenter);
}
}
}
/// <summary>
/// Stop scroll inertia at item center.
/// </summary>
[Obsolete("Renamed to ScrollInertiaUntilItemCenter.")]
public bool StopScrollAtItemCenter
{
get
{
return ScrollInertiaUntilItemCenter;
}
set
{
ScrollInertiaUntilItemCenter = value;
}
}
/// <summary>
/// Scroll inertia.
/// </summary>
[SerializeField]
[FormerlySerializedAs("StopScrollInertia")]
public AnimationCurve ScrollInertia = AnimationCurve.Linear(0, 0, 0.15f, 1);
/// <summary>
/// Scroll inertia.
/// </summary>
[Obsolete("Renamed to ScrollInertia.")]
public AnimationCurve StopScrollInertia
{
get
{
return ScrollInertia;
}
set
{
ScrollInertia = value;
}
}
/// <summary>
/// Scroll center state.
/// </summary>
protected enum ScrollCenterState
{
/// <summary>
/// None.
/// </summary>
None = 0,
/// <summary>
/// Active.
/// </summary>
Active = 1,
/// <summary>
/// Disable.
/// </summary>
Disable = 2,
}
/// <summary>
/// Current scroll center state.
/// </summary>
protected ScrollCenterState ScrollCenter = ScrollCenterState.None;
/// <summary>
/// Newly selected indices.
/// </summary>
protected List<int> NewSelectedIndices = new List<int>();
/// <summary>
/// Init this instance.
/// </summary>
public override void Init()
{
if (isListViewCustomInited)
{
return;
}
isListViewCustomInited = true;
MainThread = Thread.CurrentThread;
foreach (var template in OwnTemplates)
{
template.SetOwner(this);
}
foreach (var template in Templates)
{
template.UpdateId();
}
base.Init();
Items = new List<ListViewItem>();
SelectedItemsCache.Clear();
GetSelectedItems(SelectedItemsCache);
DestroyGameObjects = false;
InitTemplates();
if (ListRenderer.IsVirtualizationSupported())
{
ScrollRect = scrollRect;
CalculateItemSize();
}
SetContentSizeFitter = setContentSizeFitter;
SetDirection(direction, false);
UpdateItems();
if (Layout != null)
{
Layout.SettingsChanged.AddListener(SetNeedResize);
}
Localization.OnLocaleChanged += LocaleChanged;
}
/// <summary>
/// Set shared templates.
/// </summary>
/// <param name="newSharedTemplates">New shared templates.</param>
public virtual void SetSharedTemplates(List<Template> newSharedTemplates)
{
if (SharedTemplates == newSharedTemplates)
{
return;
}
if (SharedTemplates == null)
{
SharedTemplates = newSharedTemplates;
MoveTemplates(OwnTemplates, SharedTemplates);
OwnTemplates.Clear();
}
else
{
if (newSharedTemplates == null)
{
SeparateTemplates(SharedTemplates, OwnTemplates);
SharedTemplates = null;
}
else
{
SeparateTemplates(SharedTemplates, newSharedTemplates);
SharedTemplates = newSharedTemplates;
}
}
}
/// <summary>
/// Find template.
/// </summary>
/// <param name="templates">Templates.</param>
/// <param name="id">Owner ID.</param>
/// <returns>Template.</returns>
protected virtual Template FindTemplate(List<Template> templates, InstanceID id)
{
foreach (var t in templates)
{
if (t.TemplateID == id)
{
return t;
}
}
return null;
}
/// <summary>
/// Move templates from source to target.
/// </summary>
/// <param name="sourceTemplates">Source templates.</param>
/// <param name="targetTemplates">Target templates.</param>
protected virtual void MoveTemplates(List<Template> sourceTemplates, List<Template> targetTemplates)
{
foreach (var source in sourceTemplates)
{
var target = FindTemplate(targetTemplates, source.TemplateID);
if (target != null)
{
target.CopyFrom(source);
}
else
{
targetTemplates.Add(source);
}
}
}
/// <summary>
/// Separate templates.
/// </summary>
/// <param name="sourceTemplates">Source templates.</param>
/// <param name="targetTemplates">Target templates.</param>
protected virtual void SeparateTemplates(List<Template> sourceTemplates, List<Template> targetTemplates)
{
foreach (var template in TemplateSelector.AllTemplates())
{
var source = FindTemplate(sourceTemplates, new InstanceID(template));
if (source == null)
{
continue;
}
var target = FindTemplate(targetTemplates, new InstanceID(template));
if (target == null)
{
target = ComponentsPool.CreateTemplate(template);
targetTemplates.Add(target);
}
target.CopyFrom(source, false);
}
}
/// <summary>
/// Gets selected items.
/// </summary>
/// <param name="output">Selected items.</param>
public void GetSelectedItems(List<TItem> output)
{
foreach (var index in selectedIndices)
{
output.Add(DataSource[index]);
}
}
/// <summary>
/// Sets selected items.
/// </summary>
/// <param name="selectedItems">Selected items.</param>
/// <param name="deselectCurrent">Deselect currently selected items.</param>
public void SetSelectedItems(List<TItem> selectedItems, bool deselectCurrent = false)
{
if (deselectCurrent)
{
DeselectAll();
}
foreach (var item in selectedItems)
{
Select(DataSource.IndexOf(item));
}
}
/// <summary>
/// Init templates.
/// </summary>
protected void InitTemplates()
{
CanSetData = true;
foreach (var template in TemplateSelector.AllTemplates())
{
if (template.gameObject == null)
{
Debug.LogError("ListView.TemplateSelector.AllTemplates() has template without gameobject.", this);
continue;
}
template.gameObject.SetActive(true);
template.FindSelectableObjects();
template.gameObject.SetActive(false);
if (!(template is IViewData<TItem>))
{
CanSetData = false;
}
ComponentsPool.GetTemplate(template);
}
}
/// <summary>
/// Get template by index.
/// </summary>
/// <param name="index">Index.</param>
/// <returns>Template.</returns>
protected virtual TItemView Index2Template(int index)
{
return TemplateSelector.Select(index, DataSource[index]);
}
/// <inheritdoc/>
protected override void UpdateLayoutBridgeContentSizeFitter()
{
if (LayoutBridge != null)
{
LayoutBridge.UpdateContentSizeFitter = SetContentSizeFitter && ListRenderer.AllowSetContentSizeFitter;
}
}
/// <inheritdoc/>
protected override void SetScrollRect(ScrollRect newScrollRect)
{
if (scrollRect != null)
{
var old_resize_listener = scrollRect.GetComponent<ResizeListener>();
if (old_resize_listener != null)
{
old_resize_listener.OnResize.RemoveListener(SetNeedResize);
}
scrollRect.onValueChanged.RemoveListener(SelectableCheck);
ListRenderer.Disable();
scrollRect.onValueChanged.RemoveListener(SelectableSet);
scrollRect.onValueChanged.RemoveListener(OnScrollRectUpdate);
}
scrollRect = newScrollRect;
if (scrollRect != null)
{
var resize_listener = Utilities.GetOrAddComponent<ResizeListener>(scrollRect);
resize_listener.OnResize.AddListener(SetNeedResize);
scrollRect.onValueChanged.AddListener(SelectableCheck);
ListRenderer.Enable();
scrollRect.onValueChanged.AddListener(SelectableSet);
scrollRect.onValueChanged.AddListener(OnScrollRectUpdate);
UpdateScrollRectSize();
}
}
/// <summary>
/// Process locale changes.
/// </summary>
public virtual void LocaleChanged()
{
ComponentsPool.LocaleChanged();
}
/// <summary>
/// Get the rendered of the specified ListView type.
/// </summary>
/// <param name="type">ListView type</param>
/// <returns>Renderer.</returns>
protected virtual ListViewTypeBase GetRenderer(ListViewType type)
{
ListViewTypeBase renderer;
switch (type)
{
case ListViewType.ListViewWithFixedSize:
renderer = new ListViewTypeFixed(this);
break;
case ListViewType.ListViewWithVariableSize:
renderer = new ListViewTypeSize(this);
break;
case ListViewType.TileViewWithFixedSize:
renderer = new TileViewTypeFixed(this);
break;
case ListViewType.TileViewWithVariableSize:
renderer = new TileViewTypeSize(this);
break;
case ListViewType.TileViewStaggered:
renderer = new TileViewStaggered(this);
break;
case ListViewType.ListViewEllipse:
renderer = new ListViewTypeEllipse(this);
break;
default:
throw new NotSupportedException(string.Format("Unknown ListView type: {0}", EnumHelper<ListViewType>.ToString(type)));
}
renderer.Enable();
renderer.ToggleScrollToItemCenter(ScrollInertiaUntilItemCenter);
return renderer;
}
/// <summary>
/// Sets the default item.
/// </summary>
/// <param name="newDefaultItem">New default item.</param>
protected virtual void SetDefaultItem(TItemView newDefaultItem)
{
if (newDefaultItem == null)
{
throw new ArgumentNullException("newDefaultItem");
}
defaultItem = newDefaultItem;
DefaultTemplateSelector.Replace(newDefaultItem);
if (isListViewCustomInited)
{
TemplatesChanged();
}
}
/// <summary>
/// Process templates changed.
/// </summary>
protected virtual void TemplatesChanged()
{
InitTemplates();
CalculateItemSize(true);
CalculateMaxVisibleItems();
UpdateView();
if (scrollRect != null)
{
var resizeListener = scrollRect.GetComponent<ResizeListener>();
if (resizeListener != null)
{
resizeListener.OnResize.Invoke();
}
}
}
/// <inheritdoc/>
protected override void SetDirection(ListViewDirection newDirection, bool updateView = true)
{
direction = newDirection;
ListRenderer.ResetPosition();
if (ListRenderer.IsVirtualizationSupported())
{
LayoutBridge.IsHorizontal = IsHorizontal();
ListRenderer.DirectionChanged();
CalculateMaxVisibleItems();
}
if (updateView)
{
UpdateView();
}
}
/// <inheritdoc/>
public override bool IsSortEnabled()
{
if (DataSource.Comparison != null)
{
return true;
}
#pragma warning disable 0618
return Sort && SortFunc != null;
#pragma warning restore 0618
}
/// <summary>
/// Gets the index of the nearest item.
/// </summary>
/// <returns>The nearest index.</returns>
/// <param name="eventData">Event data.</param>
/// <param name="type">Preferable nearest index.</param>
public override int GetNearestIndex(PointerEventData eventData, NearestType type)
{
if (IsSortEnabled())
{
return -1;
}
Vector2 point;
if (!RectTransformUtility.ScreenPointToLocalPointInRectangle(Container, eventData.position, eventData.pressEventCamera, out point))
{
return DataSource.Count;
}
if (!Container.rect.Contains(point))
{
return DataSource.Count;
}
return GetNearestIndex(point, type);
}
/// <summary>
/// Gets the index of the nearest item.
/// </summary>
/// <returns>The nearest item index.</returns>
/// <param name="point">Point.</param>
/// <param name="type">Preferable nearest index.</param>
public override int GetNearestIndex(Vector2 point, NearestType type)
{
var index = ListRenderer.GetNearestIndex(point, type);
if (index == DataSource.Count)
{
return index;
}
if (ListRenderer.AllowLoopedList)
{
index = ListRenderer.VisibleIndex2ItemIndex(index);
}
return index;
}
/// <summary>
/// Calculates the size of the item.
/// </summary>
/// <param name="reset">Reset item size.</param>
protected virtual void CalculateItemSize(bool reset = false)
{
ItemSize = ListRenderer.GetItemSize(reset);
}
/// <summary>
/// Calculates the max count of visible items.
/// </summary>
protected virtual void CalculateMaxVisibleItems()
{
if (!isListViewCustomInited)
{
return;
}
ListRenderer.CalculateMaxVisibleItems();
ListRenderer.ValidateContentSize();
}
/// <summary>
/// Resize this instance.
/// </summary>
public virtual void Resize()
{
ListRenderer.CalculateItemsSizes(DataSource, false);
NeedResize = false;
UpdateScrollRectSize();
CalculateItemSize(true);
CalculateMaxVisibleItems();
UpdateView();
}
/// <inheritdoc/>
protected override void SelectItem(int index)
{
var component = GetComponent(index);
SelectColoring(component);
if (component != null)
{
component.StateSelected();
}
}
/// <inheritdoc/>
protected override void DeselectItem(int index)
{
var component = GetComponent(index);
DefaultColoring(component);
if (component != null)
{
component.StateDefault();
}
}
/// <inheritdoc/>
protected override void InvokeSelect(int index, bool raiseEvents)
{
if (!IsValid(index))
{
Debug.LogWarning(string.Format("Incorrect index: {0}", index.ToString()), this);
}
SelectedItemsCache.Add(DataSource[index]);
base.InvokeSelect(index, raiseEvents);
if (raiseEvents)
{
OnSelectObject.Invoke(index);
}
}
/// <inheritdoc/>
protected override void InvokeDeselect(int index, bool raiseEvents)
{
if (!IsValid(index))
{
Debug.LogWarning(string.Format("Incorrect index: {0}", index.ToString()), this);
}
SelectedItemsCache.Remove(DataSource[index]);
base.InvokeDeselect(index, raiseEvents);
if (raiseEvents)
{
OnDeselectObject.Invoke(index);
}
}
/// <inheritdoc/>
public override void UpdateItems()
{
SetNewItems(DataSource, IsMainThread);
IsDataSourceChanged = !IsMainThread;
}
/// <inheritdoc/>
public override void Clear()
{
DataSource.Clear();
ListRenderer.SetPosition(0f);
}
/// <inheritdoc/>
public override void RemoveItemAt(int index)
{
DataSource.RemoveAt(index);
}
/// <summary>
/// Add the specified item.
/// </summary>
/// <param name="item">Item.</param>
/// <returns>Index of added item.</returns>
public virtual int Add(TItem item)
{
DataSource.Add(item);
return DataSource.IndexOf(item);
}
/// <summary>
/// Remove the specified item.
/// </summary>
/// <param name="item">Item.</param>
/// <returns>Index of removed TItem.</returns>
public virtual int Remove(TItem item)
{
var index = DataSource.IndexOf(item);
if (index == -1)
{
return index;
}
DataSource.RemoveAt(index);
return index;
}
/// <summary>
/// Remove item by the specified index.
/// </summary>
/// <param name="index">Index.</param>
public virtual void Remove(int index)
{
DataSource.RemoveAt(index);
}
/// <summary>
/// Scrolls to specified item immediately.
/// </summary>
/// <param name="item">Item.</param>
public virtual void ScrollTo(TItem item)
{
var index = DataSource.IndexOf(item);
if (index > -1)
{
ScrollTo(index);
}
}
/// <summary>
/// Scroll to the specified item with animation.
/// </summary>
/// <param name="item">Item.</param>
public virtual void ScrollToAnimated(TItem item)
{
var index = DataSource.IndexOf(item);
if (index > -1)
{
ScrollToAnimated(index);
}
}
/// <inheritdoc/>
public override void ScrollTo(int index)
{
if (!ListRenderer.IsVirtualizationPossible())
{
return;
}
ListRenderer.SetPosition(ListRenderer.GetPosition(index));
}
/// <summary>
/// Get scroll position.
/// </summary>
/// <returns>Position.</returns>
public override float GetScrollPosition()
{
if (!ListRenderer.IsVirtualizationPossible())
{
return 0f;
}
return ListRenderer.GetPosition();
}
/// <summary>
/// Scrolls to specified position.
/// </summary>
/// <param name="position">Position.</param>
public override void ScrollToPosition(float position)
{
if (!ListRenderer.IsVirtualizationPossible())
{
return;
}
ListRenderer.SetPosition(position);
}
/// <summary>
/// Scrolls to specified position.
/// </summary>
/// <param name="position">Position.</param>
public override void ScrollToPosition(Vector2 position)
{
if (!ListRenderer.IsVirtualizationPossible())
{
return;
}
ListRenderer.SetPosition(position);
}
/// <summary>
/// Is visible item with specified index.
/// </summary>
/// <param name="index">Index.</param>
/// <param name="minVisiblePart">The minimal visible part of the item to consider item visible.</param>
/// <returns>true if item visible; false otherwise.</returns>
public override bool IsVisible(int index, float minVisiblePart = 0f)
{
if (!ListRenderer.IsVirtualizationSupported())
{
return false;
}
return ListRenderer.IsVisible(index, minVisiblePart);
}
/// <summary>
/// Starts the scroll coroutine.
/// </summary>
/// <param name="coroutine">Coroutine.</param>
protected virtual void StartScrollCoroutine(IEnumerator coroutine)
{
StopScrollCoroutine();
ScrollCoroutine = coroutine;
StartCoroutine(ScrollCoroutine);
}
/// <summary>
/// Stops the scroll coroutine.
/// </summary>
protected virtual void StopScrollCoroutine()
{
if (ScrollCoroutine != null)
{
StopCoroutine(ScrollCoroutine);
}
ScrollCenter = ScrollCenterState.None;
}
/// <inheritdoc/>
public override void ScrollStop()
{
StopScrollCoroutine();
}
/// <inheritdoc/>
public override void ScrollToAnimated(int index)
{
StartScrollCoroutine(ScrollToAnimatedCoroutine(index, ScrollMovement, ScrollUnscaledTime));
}
/// <inheritdoc/>
public override void ScrollToAnimated(int index, AnimationCurve animation, bool unscaledTime, Action after = null)
{
StartScrollCoroutine(ScrollToAnimatedCoroutine(index, animation, unscaledTime, after));
}
/// <inheritdoc/>
public override void ScrollToPositionAnimated(float target)
{
ScrollToPositionAnimated(target, ScrollMovement, ScrollUnscaledTime);
}
/// <inheritdoc/>
public override void ScrollToPositionAnimated(float target, AnimationCurve animation, bool unscaledTime, Action after = null)
{
#if CSHARP_7_3_OR_NEWER
Vector2 Position()
#else
Func<Vector2> Position = () =>
#endif
{
var current_position = ListRenderer.GetPositionVector();
var target_position = IsHorizontal()
? new Vector2(ListRenderer.ValidatePosition(-target), current_position.y)
: new Vector2(current_position.x, ListRenderer.ValidatePosition(target));
return target_position;
}
#if !CSHARP_7_3_OR_NEWER
;
#endif
StartScrollCoroutine(ScrollToAnimatedCoroutine(Position, animation, unscaledTime, after));
}
/// <inheritdoc/>
public override void ScrollToPositionAnimated(Vector2 target)
{
ScrollToPositionAnimated(target, ScrollMovement, ScrollUnscaledTime);
}
/// <inheritdoc/>
public override void ScrollToPositionAnimated(Vector2 target, AnimationCurve animation, bool unscaleTime, Action after = null)
{
#if CSHARP_7_3_OR_NEWER
Vector2 Position()
#else
Func<Vector2> Position = () =>
#endif
{
return ListRenderer.ValidatePosition(target);
}
#if !CSHARP_7_3_OR_NEWER
;
#endif
StartScrollCoroutine(ScrollToAnimatedCoroutine(Position, animation, unscaleTime, after));
}
/// <summary>
/// Scroll to specified index with time coroutine.
/// </summary>
/// <returns>The scroll to index with time coroutine.</returns>
/// <param name="index">Index.</param>
/// <param name="animation">Animation curve.</param>
/// <param name="unscaledTime">Use unscaled time.</param>
/// <param name="after">Action to run after animation.</param>
protected virtual IEnumerator ScrollToAnimatedCoroutine(int index, AnimationCurve animation, bool unscaledTime, Action after = null)
{
#if CSHARP_7_3_OR_NEWER
Vector2 Position()
#else
Func<Vector2> Position = () =>
#endif
{
return ListRenderer.GetPosition(index);
}
#if !CSHARP_7_3_OR_NEWER
;
#endif
return ScrollToAnimatedCoroutine(Position, animation, unscaledTime, after);
}
/// <summary>
/// Get start position for the animated scroll.
/// </summary>
/// <param name="target">Target.</param>
/// <returns>Start position.</returns>
protected virtual Vector2 GetScrollStartPosition(Vector2 target)
{
var start = ListRenderer.GetPositionVector();
if (IsHorizontal())
{
start.x = -start.x;
}
if (ListRenderer.AllowLoopedList)
{
// find shortest distance to target for the looped list
var list_size = ListRenderer.ListSize() + LayoutBridge.GetSpacing();
var distance_straight = IsHorizontal()
? (target.x - start.x)
: (target.y - start.y);
var distance_reverse_1 = IsHorizontal()
? (target.x - (start.x + list_size))
: (target.y - start.y + list_size);
var distance_reverse_2 = IsHorizontal()
? (target.x - (start.x - list_size))
: (target.y - start.y - list_size);
if (Mathf.Abs(distance_reverse_1) < Mathf.Abs(distance_straight))
{
if (IsHorizontal())
{
start.x += list_size;
}
else
{
start.y += list_size;
}
}
if (Mathf.Abs(distance_reverse_2) < Mathf.Abs(distance_straight))
{
if (IsHorizontal())
{
start.x -= list_size;
}
else
{
start.y -= list_size;
}
}
}
return start;
}
/// <summary>
/// Scroll to specified position with time coroutine.
/// </summary>
/// <returns>The scroll to index with time coroutine.</returns>
/// <param name="targetPosition">Target position.</param>
/// <param name="unscaledTime">Use unscaled time.</param>
[Obsolete("Replaced with ScrollToAnimatedCoroutine(Func<Vector2> targetPosition, AnimationCurve animation, bool unscaledTime, Action after = null).")]
protected virtual IEnumerator ScrollToAnimatedCoroutine(Func<Vector2> targetPosition, bool unscaledTime)
{
return ScrollToAnimatedCoroutine(targetPosition, ScrollMovement, unscaledTime);
}
/// <summary>
/// Scroll to specified position with time coroutine.
/// </summary>
/// <returns>The scroll to index with time coroutine.</returns>
/// <param name="targetPosition">Target position.</param>
/// <param name="animation">Animation curve.</param>
/// <param name="unscaledTime">Use unscaled time.</param>
/// <param name="after">Action to run after animation.</param>
protected virtual IEnumerator ScrollToAnimatedCoroutine(Func<Vector2> targetPosition, AnimationCurve animation, bool unscaledTime, Action after = null)
{
var start = GetScrollStartPosition(targetPosition());
float delta;
var animationLength = animation[animation.length - 1].time;
var startTime = UtilitiesTime.GetTime(unscaledTime);
do
{
delta = UtilitiesTime.GetTime(unscaledTime) - startTime;
var value = animation.Evaluate(delta);
var target = targetPosition();
var pos = start + ((target - start) * value);
ListRenderer.SetPosition(pos);
yield return null;
}
while (delta < animationLength);
ListRenderer.SetPosition(targetPosition());
yield return null;
ListRenderer.SetPosition(targetPosition());
if (after != null)
{
after();
}
}
/// <summary>
/// Gets the item position by index.
/// </summary>
/// <returns>The item position.</returns>
/// <param name="index">Index.</param>
public override float GetItemPosition(int index)
{
return ListRenderer.GetItemPosition(index);
}
/// <summary>
/// Gets the item position by index.
/// </summary>
/// <returns>The item position.</returns>
/// <param name="index">Index.</param>
public override float GetItemPositionBorderEnd(int index)
{
return ListRenderer.GetItemPositionBorderEnd(index);
}
/// <summary>
/// Gets the item middle position by index.
/// </summary>
/// <returns>The item middle position.</returns>
/// <param name="index">Index.</param>
public override float GetItemPositionMiddle(int index)
{
return ListRenderer.GetItemPositionMiddle(index);
}
/// <summary>
/// Gets the item bottom position by index.
/// </summary>
/// <returns>The item bottom position.</returns>
/// <param name="index">Index.</param>
public override float GetItemPositionBottom(int index)
{
return ListRenderer.GetItemPositionBottom(index);
}
/// <summary>
/// Called after component instantiated.
/// </summary>
/// <param name="component">Component.</param>
public virtual void ComponentCreated(TItemView component)
{
var c = OnComponentCreated;
if (c != null)
{
c(component);
}
}
/// <summary>
/// Called before component destroyed.
/// </summary>
/// <param name="component">Component.</param>
public virtual void ComponentDestroyed(TItemView component)
{
var c = OnComponentDestroyed;
if (c != null)
{
c(component);
}
}
/// <summary>
/// Called after component became activated.
/// </summary>
/// <param name="component">Component.</param>
public virtual void ComponentActivated(TItemView component)
{
AddCallback(component);
var c = OnComponentActivated;
if (c != null)
{
c(component);
}
}
/// <summary>
/// Called after component moved to cache.
/// </summary>
/// <param name="component">Component.</param>
public virtual void ComponentCached(TItemView component)
{
var c = OnComponentCached;
if (c != null)
{
c(component);
}
RemoveCallback(component);
}
/// <summary>
/// Adds the callback.
/// </summary>
/// <param name="item">Item.</param>
protected virtual void AddCallback(TItemView item)
{
ListRenderer.AddCallback(item);
#pragma warning disable 0618
AddCallback(item as ListViewItem);
#pragma warning restore 0618
}
/// <summary>
/// Adds the callback.
/// </summary>
/// <param name="item">Item.</param>
[Obsolete("Replaced with AddCallback(TItemView item).")]
protected virtual void AddCallback(ListViewItem item)
{
}
/// <summary>
/// Removes the callback.
/// </summary>
/// <param name="item">Item.</param>
protected virtual void RemoveCallback(TItemView item)
{
if (item == null)
{
return;
}
ListRenderer.RemoveCallback(item);
#pragma warning disable 0618
RemoveCallback(item as ListViewItem);
#pragma warning restore 0618
}
/// <summary>
/// Adds the callback.
/// </summary>
/// <param name="item">Item.</param>
[Obsolete("Replaced with RemoveCallback(TItemView item).")]
protected virtual void RemoveCallback(ListViewItem item)
{
}
/// <summary>
/// Set the specified item.
/// </summary>
/// <param name="item">Item.</param>
/// <param name="allowDuplicate">If set to <c>true</c> allow duplicate.</param>
/// <returns>Index of item.</returns>
public int Set(TItem item, bool allowDuplicate = true)
{
int index;
if (!allowDuplicate)
{
index = DataSource.IndexOf(item);
if (index == -1)
{
index = Add(item);
}
}
else
{
index = Add(item);
}
Select(index);
return index;
}
/// <summary>
/// Sets component data with specified item.
/// </summary>
/// <param name="component">Component.</param>
/// <param name="item">Item.</param>
protected virtual void SetData(TItemView component, TItem item)
{
if (CanSetData)
{
(component as IViewData<TItem>).SetData(item);
}
}
/// <summary>
/// Gets the default width of the item.
/// </summary>
/// <returns>The default item width.</returns>
public override float GetDefaultItemWidth()
{
return ItemSize.x;
}
/// <summary>
/// Gets the default height of the item.
/// </summary>
/// <returns>The default item height.</returns>
public override float GetDefaultItemHeight()
{
return ItemSize.y;
}
/// <summary>
/// Sets the displayed indices.
/// </summary>
/// <param name="isNewData">Is new data?</param>
protected virtual void SetDisplayedIndices(bool isNewData = true)
{
// process restored recycling
foreach (var index in DisableRecyclingIndices)
{
var component = GetItemComponent(index);
#pragma warning disable 0618
var restore_recycling = !(component.DisableRecycling || component.IsDragged);
#pragma warning restore 0618
if (restore_recycling || DisplayedIndices.Contains(index))
{
component.LayoutElement.ignoreLayout = false;
}
}
// process disabled recycling
DisableRecyclingIndices.Clear();
foreach (var component in Components)
{
#pragma warning disable 0618
var disable_recycling = component.DisableRecycling || component.IsDragged;
#pragma warning restore 0618
if (disable_recycling && !DisplayedIndices.Contains(component.Index) && IsValid(component.Index))
{
DisplayedIndices.Insert(DisableRecyclingIndices.Count, component.Index);
DisableRecyclingIndices.Add(component.Index);
component.LayoutElement.ignoreLayout = true;
component.RectTransform.anchoredPosition = new Vector2(-90000f, 0f);
}
}
if (isNewData)
{
ComponentsPool.DisplayedIndicesSet(DisplayedIndices, ComponentSetData);
}
else
{
ComponentsPool.DisplayedIndicesUpdate(DisplayedIndices, ComponentSetData);
}
ListRenderer.UpdateLayout();
Updater.RunOnceNextFrame(ComponentsHighlightedColoring);
}
/// <summary>
/// Process the ScrollRect update event.
/// </summary>
/// <param name="position">Position.</param>
protected virtual void OnScrollRectUpdate(Vector2 position)
{
StartScrolling();
}
/// <summary>
/// Set data to component.
/// </summary>
/// <param name="component">Component.</param>
protected virtual void ComponentSetData(TItemView component)
{
component.ResetDimensionsSize();
if (IsValid(component.Index))
{
SetData(component, DataSource[component.Index]);
}
Coloring(component);
if (IsSelected(component.Index))
{
component.StateSelected();
}
else
{
component.StateDefault();
}
}
/// <inheritdoc/>
public override void UpdateView()
{
if (!isListViewCustomInited)
{
return;
}
ListRenderer.UpdateDisplayedIndices();
SetDisplayedIndices();
OnUpdateView.Invoke();
}
/// <summary>
/// Keep selected items on items update.
/// </summary>
[SerializeField]
protected bool KeepSelection = true;
/// <summary>
/// Updates the items.
/// </summary>
/// <param name="newItems">New items.</param>
/// <param name="updateView">Update view.</param>
protected virtual void SetNewItems(ObservableList<TItem> newItems, bool updateView = true)
{
lock (DataSource)
{
DataSource.OnChange -= UpdateItems;
#pragma warning disable 0618
if (Sort && SortFunc != null)
{
newItems.BeginUpdate();
var sorted = new List<TItem>(SortFunc(newItems));
newItems.Clear();
newItems.AddRange(sorted);
newItems.EndUpdate();
}
#pragma warning restore 0618
SilentDeselect(SelectedIndicesList);
RecalculateSelectedIndices(newItems);
dataSource = newItems;
ListRenderer.CalculateItemsSizes(DataSource, false);
CalculateMaxVisibleItems();
if (KeepSelection)
{
SilentSelect(NewSelectedIndices);
}
SelectedItemsCache.Clear();
GetSelectedItems(SelectedItemsCache);
DataSource.OnChange += UpdateItems;
if (updateView)
{
UpdateView();
}
}
}
/// <summary>
/// Recalculates the selected indices.
/// </summary>
/// <param name="newItems">New items.</param>
protected virtual void RecalculateSelectedIndices(ObservableList<TItem> newItems)
{
NewSelectedIndices.Clear();
foreach (var item in SelectedItemsCache)
{
var new_index = newItems.IndexOf(item);
if (new_index != -1)
{
NewSelectedIndices.Add(new_index);
}
}
}
/// <summary>
/// Determines if item exists with the specified index.
/// </summary>
/// <returns><c>true</c> if item exists with the specified index; otherwise, <c>false</c>.</returns>
/// <param name="index">Index.</param>
public override bool IsValid(int index)
{
return (index >= 0) && (index < DataSource.Count);
}
/// <summary>
/// Process the item move event.
/// </summary>
/// <param name="index">Index.</param>
/// <param name="item">Item.</param>
/// <param name="eventData">Event data.</param>
protected override void OnItemMove(int index, ListViewItem item, AxisEventData eventData)
{
if (!Navigation)
{
return;
}
if (ListRenderer.OnItemMove(eventData, item))
{
return;
}
base.OnItemMove(index, item, eventData);
}
/// <summary>
/// Coloring the specified component.
/// </summary>
/// <param name="component">Component.</param>
protected override void Coloring(ListViewItem component)
{
if (component == null)
{
return;
}
if (IsSelected(component.Index))
{
SelectColoring(component);
}
else if (IsHighlighted(component.Index))
{
HighlightColoring(component);
}
else
{
DefaultColoring(component);
}
}
/// <summary>
/// Set highlights colors of specified component.
/// </summary>
/// <param name="component">Component.</param>
protected override void HighlightColoring(ListViewItem component)
{
if (component == null)
{
return;
}
if (IsSelected(component.Index))
{
return;
}
HighlightColoring(component as TItemView);
}
/// <summary>
/// Set highlights colors of specified component.
/// </summary>
/// <param name="component">Component.</param>
protected virtual void HighlightColoring(TItemView component)
{
if (component == null)
{
return;
}
if (!allowColoring)
{
return;
}
if (!CanSelect(component.Index))
{
return;
}
if (IsSelected(component.Index))
{
return;
}
component.GraphicsColoring(HighlightedColor, HighlightedBackgroundColor, FadeDuration);
}
/// <summary>
/// Set select colors of specified component.
/// </summary>
/// <param name="component">Component.</param>
protected virtual void SelectColoring(ListViewItem component)
{
if (component == null)
{
return;
}
SelectColoring(component as TItemView);
}
/// <summary>
/// Set select colors of specified component.
/// </summary>
/// <param name="component">Component.</param>
protected virtual void SelectColoring(TItemView component)
{
if (component == null)
{
return;
}
if (!allowColoring)
{
return;
}
if (IsInteractable())
{
component.GraphicsColoring(SelectedColor, SelectedBackgroundColor, FadeDuration);
}
else
{
component.GraphicsColoring(SelectedColor * DisabledColor, SelectedBackgroundColor * DisabledColor, FadeDuration);
}
}
/// <summary>
/// Set default colors of specified component.
/// </summary>
/// <param name="component">Component.</param>
protected override void DefaultColoring(ListViewItem component)
{
if (component == null)
{
return;
}
DefaultColoring(component as TItemView);
}
/// <summary>
/// Set default colors of specified component.
/// </summary>
/// <param name="component">Component.</param>
protected virtual void DefaultColoring(TItemView component)
{
if (component == null)
{
return;
}
if (!allowColoring)
{
return;
}
if (IsInteractable())
{
component.GraphicsColoring(DefaultColor, DefaultBackgroundColor, FadeDuration);
}
else
{
component.GraphicsColoring(DefaultColor * DisabledColor, DefaultBackgroundColor * DisabledColor, FadeDuration);
}
}
/// <summary>
/// Updates the colors.
/// </summary>
/// <param name="instant">Is should be instant color update?</param>
public override void ComponentsColoring(bool instant = false)
{
if (!isListViewCustomInited)
{
return;
}
if (!allowColoring && instant)
{
foreach (var component in ComponentsPool)
{
DefaultColoring(component);
}
return;
}
if (instant)
{
var old_duration = FadeDuration;
FadeDuration = 0f;
foreach (var component in ComponentsPool)
{
Coloring(component);
}
FadeDuration = old_duration;
}
else
{
foreach (var component in ComponentsPool)
{
Coloring(component);
}
}
ComponentsHighlightedColoring();
}
/// <summary>
/// This function is called when the MonoBehaviour will be destroyed.
/// </summary>
protected override void OnDestroy()
{
Updater.RemoveRunOnceNextFrame(ComponentsHighlightedColoring);
Updater.RemoveRunOnceNextFrame(ForceRebuild);
Localization.OnLocaleChanged -= LocaleChanged;
if (dataSource != null)
{
dataSource.OnChange -= UpdateItems;
dataSource = null;
}
if (layout != null)
{
layout.SettingsChanged.RemoveListener(SetNeedResize);
layout = null;
}
layoutBridge = null;
ScrollRect = null;
if (componentsPool != null)
{
componentsPool.Destroy();
componentsPool = null;
}
base.OnDestroy();
}
/// <summary>
/// Returns an enumerator that iterates through the <see cref="ListViewComponentPool" />.
/// </summary>
/// <param name="mode">Mode.</param>
/// <returns>A <see cref="ListViewBase.ListViewComponentEnumerator{TItemView, Template}" /> for the <see cref="ListViewComponentPool" />.</returns>
public ListViewComponentEnumerator<TItemView, Template> GetComponentsEnumerator(PoolEnumeratorMode mode)
{
return ComponentsPool.GetEnumerator(mode);
}
/// <summary>
/// Calls the specified action for each component.
/// </summary>
/// <param name="func">Action.</param>
public override void ForEachComponent(Action<ListViewItem> func)
{
if (componentsPool != null)
{
foreach (var component in GetComponentsEnumerator(PoolEnumeratorMode.All))
{
func(component);
}
}
}
/// <summary>
/// Calls the specified action for each component.
/// </summary>
/// <param name="func">Action.</param>
public virtual void ForEachComponent(Action<TItemView> func)
{
if (componentsPool != null)
{
foreach (var component in GetComponentsEnumerator(PoolEnumeratorMode.All))
{
func(component);
}
}
}
/// <summary>
/// Determines whether item visible.
/// </summary>
/// <returns><c>true</c> if item visible; otherwise, <c>false</c>.</returns>
/// <param name="index">Index.</param>
public override bool IsItemVisible(int index)
{
return DisplayedIndices.Contains(index);
}
/// <summary>
/// Gets the visible indices.
/// </summary>
/// <returns>The visible indices.</returns>
public List<int> GetVisibleIndices()
{
return new List<int>(DisplayedIndices);
}
/// <summary>
/// Gets the visible indices.
/// </summary>
/// <param name="output">Output.</param>
public void GetVisibleIndices(List<int> output)
{
output.AddRange(DisplayedIndices);
}
/// <summary>
/// Gets the visible components.
/// </summary>
/// <returns>The visible components.</returns>
public List<TItemView> GetVisibleComponents()
{
return new List<TItemView>(Components);
}
/// <summary>
/// Gets the visible components.
/// </summary>
/// <param name="output">Output.</param>
public void GetVisibleComponents(List<TItemView> output)
{
output.AddRange(Components);
}
/// <summary>
/// Gets the item component.
/// </summary>
/// <returns>The item component.</returns>
/// <param name="index">Index.</param>
public TItemView GetItemComponent(int index)
{
return GetComponent(index) as TItemView;
}
/// <summary>
/// OnStartScrolling event.
/// </summary>
public UnityEvent OnStartScrolling = new UnityEvent();
/// <summary>
/// OnEndScrolling event.
/// </summary>
public UnityEvent OnEndScrolling = new UnityEvent();
/// <summary>
/// Time before raise OnEndScrolling event since last OnScrollRectUpdate event raised.
/// </summary>
public float EndScrollDelay = 0.3f;
/// <summary>
/// Is ScrollRect now on scrolling state.
/// </summary>
protected bool Scrolling;
/// <summary>
/// When last scroll event happen?
/// </summary>
protected float LastScrollingTime;
/// <summary>
/// Update this instance.
/// </summary>
public virtual void RunUpdate()
{
if (DataSourceSetted || IsDataSourceChanged)
{
var reset_scroll = DataSourceSetted;
DataSourceSetted = false;
IsDataSourceChanged = false;
lock (DataSource)
{
CalculateMaxVisibleItems();
UpdateView();
}
if (reset_scroll)
{
ListRenderer.SetPosition(0f);
}
}
if (NeedResize)
{
Resize();
}
if (IsStopScrolling())
{
EndScrolling();
}
SelectableSet();
}
/// <summary>
/// LateUpdate.
/// </summary>
public virtual void RunLateUpdate()
{
SelectableSet();
}
/// <summary>
/// Scroll to the nearest item center.
/// </summary>
public void ScrollToItemCenter()
{
ListRenderer.ScrollToItemCenter();
}
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected override void OnEnable()
{
base.OnEnable();
Updater.RunOnceNextFrame(ForceRebuild);
var old = FadeDuration;
FadeDuration = 0f;
ComponentsColoring(true);
FadeDuration = old;
Resize();
Updater.Add(this);
Updater.AddLateUpdate(this);
}
/// <summary>
/// Process the disable event.
/// </summary>
protected override void OnDisable()
{
base.OnDisable();
Updater.Remove(this);
Updater.RemoveLateUpdate(this);
}
/// <summary>
/// Force layout rebuild.
/// </summary>
protected virtual void ForceRebuild()
{
foreach (var component in ComponentsPool)
{
LayoutRebuilder.MarkLayoutForRebuild(component.RectTransform);
}
}
/// <summary>
/// Start to track scrolling event.
/// </summary>
protected virtual void StartScrolling()
{
LastScrollingTime = UtilitiesTime.GetTime(true);
if (Scrolling)
{
return;
}
Scrolling = true;
OnStartScrolling.Invoke();
}
/// <summary>
/// Determines whether ScrollRect is stop scrolling.
/// </summary>
/// <returns><c>true</c> if ScrollRect is stop scrolling; otherwise, <c>false</c>.</returns>
protected virtual bool IsStopScrolling()
{
if (!Scrolling)
{
return false;
}
return (LastScrollingTime + EndScrollDelay) <= UtilitiesTime.GetTime(true);
}
/// <summary>
/// Raise OnEndScrolling event.
/// </summary>
protected virtual void EndScrolling()
{
Scrolling = false;
OnEndScrolling.Invoke();
if (ScrollInertiaUntilItemCenter && (ScrollCenter == ScrollCenterState.None) && (AutoScrollCoroutine == null))
{
ListRenderer.ScrollToItemCenter();
ScrollCenter = ScrollCenterState.Active;
}
if (ScrollCenter == ScrollCenterState.Disable)
{
ScrollCenter = ScrollCenterState.None;
}
}
/// <summary>
/// Is need to handle resize event?
/// </summary>
protected bool NeedResize;
/// <summary>
/// Sets the need resize.
/// </summary>
protected virtual void SetNeedResize()
{
if (!ListRenderer.IsVirtualizationSupported())
{
return;
}
NeedResize = true;
}
/// <summary>
/// Change DefaultItem size.
/// </summary>
/// <param name="size">Size.</param>
public virtual void ChangeDefaultItemSize(Vector2 size)
{
ComponentsPool.SetSize(size);
CalculateItemSize(true);
CalculateMaxVisibleItems();
UpdateView();
}
/// <summary>
/// Select first item.
/// </summary>
/// <param name="item">Item.</param>
/// <returns>true if item was found and selected; otherwise false.</returns>
public bool SelectFirstItem(TItem item)
{
var index = DataSource.IndexOf(item);
if (IsValid(index))
{
Select(index);
return true;
}
return false;
}
/// <summary>
/// Select all items.
/// </summary>
/// <param name="item">Item.</param>
/// <returns>true if item was found and selected; otherwise false.</returns>
public bool SelectAllItems(TItem item)
{
var selected = false;
var start = 0;
bool is_valid;
do
{
var index = DataSource.IndexOf(item, start);
is_valid = IsValid(index);
if (is_valid)
{
start = index + 1;
Select(index);
selected = true;
}
}
while (is_valid);
return selected;
}
#region DebugInfo
/// <summary>
/// Get debug information.
/// </summary>
/// <returns>Debug information.</returns>
public override string GetDebugInfo()
{
var sb = new System.Text.StringBuilder();
sb.Append("Direction: ");
sb.Append(EnumHelper<ListViewDirection>.ToString(Direction));
sb.AppendLine();
sb.Append("Type: ");
sb.Append(EnumHelper<ListViewType>.ToString(ListType));
sb.AppendLine();
sb.Append("Virtualization: ");
sb.Append(Virtualization);
sb.AppendLine();
sb.Append("DataSource.Count: ");
sb.Append(DataSource.Count);
sb.AppendLine();
sb.Append("Container Size: ");
sb.Append(Container.rect.size.ToString());
sb.AppendLine();
sb.Append("Container Scale: ");
sb.Append(Container.localScale.ToString());
sb.AppendLine();
sb.Append("DefaultItem Size: ");
sb.Append(ItemSize.ToString());
sb.AppendLine();
sb.Append("DefaultItem Scale: ");
sb.Append(DefaultItem.RectTransform.localScale.ToString());
sb.AppendLine();
sb.Append("ScrollRect Size: ");
sb.Append(ScrollRectSize.ToString());
sb.AppendLine();
sb.Append("Looped: ");
sb.Append(LoopedList);
sb.AppendLine();
sb.Append("Centered: ");
sb.Append(CenterTheItems);
sb.AppendLine();
sb.Append("Precalculate Sizes: ");
sb.Append(PrecalculateItemSizes);
sb.AppendLine();
sb.Append("DisplayedIndices (count: ");
sb.Append(DisplayedIndices.Count);
sb.Append("): ");
sb.Append(UtilitiesCollections.List2String(DisplayedIndices));
sb.AppendLine();
sb.Append("Components Indices (count: ");
sb.Append(Components.Count);
sb.Append("): ");
sb.AppendLine();
for (int i = 0; i < Components.Count; i++)
{
var c = Components[i];
sb.Append(i);
sb.Append(" ");
if (c == null)
{
sb.Append("component is null");
}
else
{
sb.Append(c.name);
sb.Append(": ");
sb.Append(c.Index);
}
sb.AppendLine();
}
sb.Append("Templates (count: ");
sb.Append(Templates.Count);
sb.Append("): ");
sb.AppendLine();
for (int i = 0; i < Templates.Count; i++)
{
var t = Templates[i];
sb.Append(i);
sb.Append(" ");
if (t == null)
{
sb.Append("template is null");
}
else
{
if (t.Template == null)
{
sb.Append("template.Template is null");
}
else
{
sb.Append(t.Template.name);
sb.Append("; Instances.Count: ");
sb.Append(t.Instances.Count);
sb.Append("; Requested.Count: ");
sb.Append(t.Requested.Count);
sb.Append("; Cache.Count: ");
sb.Append(t.Cache.Count);
}
}
sb.AppendLine();
}
sb.Append("StopScrollAtItemCenter: ");
sb.Append(ScrollInertiaUntilItemCenter);
sb.AppendLine();
sb.Append("ScrollCenterState: ");
sb.Append(EnumHelper<ScrollCenterState>.ToString(ScrollCenter));
sb.AppendLine();
sb.Append("ScrollPosition: ");
sb.Append(ListRenderer.GetPosition());
sb.AppendLine();
sb.Append("ScrollVectorPosition: ");
sb.Append(ListRenderer.GetPositionVector().ToString());
sb.AppendLine();
sb.AppendLine();
sb.AppendLine("#############");
sb.AppendLine("**Renderer Info**");
ListRenderer.GetDebugInfo(sb);
sb.AppendLine();
sb.AppendLine("#############");
sb.AppendLine("**Layout Info**");
if (Layout != null)
{
sb.AppendLine("Layout: EasyLayout");
Layout.GetDebugInfo(sb);
}
else
{
var layout = Container.GetComponent<LayoutGroup>();
var layout_type = (layout != null) ? UtilitiesEditor.GetFriendlyTypeName(layout.GetType()) : "null";
sb.Append("Layout: ");
sb.Append(layout_type);
sb.AppendLine();
}
return sb.ToString();
}
#endregion
#region ListViewPaginator support
/// <summary>
/// Gets the ScrollRect.
/// </summary>
/// <returns>The ScrollRect.</returns>
public override ScrollRect GetScrollRect()
{
return ScrollRect;
}
/// <summary>
/// Gets the items count.
/// </summary>
/// <returns>The items count.</returns>
public override int GetItemsCount()
{
return DataSource.Count;
}
/// <summary>
/// Gets the items per block count.
/// </summary>
/// <returns>The items per block.</returns>
public override int GetItemsPerBlock()
{
return ListRenderer.GetItemsPerBlock();
}
/// <summary>
/// Gets the index of the nearest item.
/// </summary>
/// <returns>The nearest item index.</returns>
public override int GetNearestItemIndex()
{
return ListRenderer.GetNearestItemIndex();
}
/// <summary>
/// Gets the size of the DefaultItem.
/// </summary>
/// <returns>Size.</returns>
public override Vector2 GetDefaultItemSize()
{
return ItemSize;
}
#endregion
#region Obsolete
/// <summary>
/// Gets the visible indices.
/// </summary>
/// <returns>The visible indices.</returns>
[Obsolete("Use GetVisibleIndices()")]
public List<int> GetVisibleIndicies()
{
return GetVisibleIndices();
}
#endregion
#region IStylable implementation
/// <summary>
/// Set the specified style.
/// </summary>
/// <param name="style">Style data.</param>
protected virtual void SetStyleDefaultItem(Style style)
{
if (componentsPool != null)
{
componentsPool.SetStyle(style.Collections.DefaultItemBackground, style.Collections.DefaultItemText, style);
}
else
{
foreach (var template in TemplateSelector.AllTemplates())
{
template.Owner = this;
template.SetStyle(style.Collections.DefaultItemBackground, style.Collections.DefaultItemText, style);
}
}
}
/// <summary>
/// Sets the style colors.
/// </summary>
/// <param name="style">Style.</param>
protected virtual void SetStyleColors(Style style)
{
defaultBackgroundColor = style.Collections.DefaultBackgroundColor;
defaultColor = style.Collections.DefaultColor;
highlightedBackgroundColor = style.Collections.HighlightedBackgroundColor;
highlightedColor = style.Collections.HighlightedColor;
selectedBackgroundColor = style.Collections.SelectedBackgroundColor;
selectedColor = style.Collections.SelectedColor;
}
/// <summary>
/// Sets the ScrollRect style.
/// </summary>
/// <param name="style">Style.</param>
protected virtual void SetStyleScrollRect(Style style)
{
#if UNITY_5_3 || UNITY_5_3_OR_NEWER
var viewport = ScrollRect.viewport != null ? ScrollRect.viewport : Container.parent;
#else
var viewport = Container.parent;
#endif
style.Collections.Viewport.ApplyTo(viewport.GetComponent<Image>());
style.HorizontalScrollbar.ApplyTo(ScrollRect.horizontalScrollbar);
style.VerticalScrollbar.ApplyTo(ScrollRect.verticalScrollbar);
}
/// <inheritdoc/>
public override bool SetStyle(Style style)
{
SetStyleDefaultItem(style);
SetStyleColors(style);
SetStyleScrollRect(style);
style.Collections.MainBackground.ApplyTo(GetComponent<Image>());
if (StyleTable)
{
var image = Utilities.GetOrAddComponent<Image>(Container);
image.sprite = null;
image.color = DefaultColor;
var mask_image = Utilities.GetOrAddComponent<Image>(Container.parent);
mask_image.sprite = null;
var mask = Utilities.GetOrAddComponent<Mask>(Container.parent);
mask.showMaskGraphic = false;
defaultBackgroundColor = style.Table.Background.Color;
}
if (componentsPool != null)
{
ComponentsColoring(true);
}
else if (defaultItem != null)
{
foreach (var template in TemplateSelector.AllTemplates())
{
template.SetColors(DefaultColor, DefaultBackgroundColor);
}
}
if (header != null)
{
header.SetStyle(style);
}
else
{
style.ApplyTo(transform.Find("Header"));
}
return true;
}
/// <summary>
/// Set style options from the DefaultItem.
/// </summary>
/// <param name="style">Style data.</param>
protected virtual void GetStyleDefaultItem(Style style)
{
foreach (var template in TemplateSelector.AllTemplates())
{
template.Owner = this;
template.GetStyle(style.Collections.DefaultItemBackground, style.Collections.DefaultItemText, style);
}
}
/// <summary>
/// Get style colors.
/// </summary>
/// <param name="style">Style.</param>
protected virtual void GetStyleColors(Style style)
{
style.Collections.DefaultBackgroundColor = defaultBackgroundColor;
style.Collections.DefaultColor = defaultColor;
style.Collections.HighlightedBackgroundColor = highlightedBackgroundColor;
style.Collections.HighlightedColor = highlightedColor;
style.Collections.SelectedBackgroundColor = selectedBackgroundColor;
style.Collections.SelectedColor = selectedColor;
}
/// <summary>
/// Get style options from the ScrollRect.
/// </summary>
/// <param name="style">Style.</param>
protected virtual void GetStyleScrollRect(Style style)
{
#if UNITY_5_3 || UNITY_5_3_OR_NEWER
var viewport = ScrollRect.viewport != null ? ScrollRect.viewport : Container.parent;
#else
var viewport = Container.parent;
#endif
style.Collections.Viewport.GetFrom(viewport.GetComponent<Image>());
style.HorizontalScrollbar.GetFrom(ScrollRect.horizontalScrollbar);
style.VerticalScrollbar.GetFrom(ScrollRect.verticalScrollbar);
}
/// <inheritdoc/>
public override bool GetStyle(Style style)
{
GetStyleDefaultItem(style);
GetStyleColors(style);
GetStyleScrollRect(style);
style.Collections.MainBackground.GetFrom(GetComponent<Image>());
if (StyleTable)
{
style.Table.Background.Color = defaultBackgroundColor;
}
if (header != null)
{
header.GetStyle(style);
}
else
{
style.GetFrom(transform.Find("Header"));
}
return true;
}
#endregion
#region Selectable
/// <summary>
/// Selectable data.
/// </summary>
protected struct SelectableData : IEquatable<SelectableData>
{
/// <summary>
/// Is need to update EventSystem.currentSelectedGameObject?
/// </summary>
public bool Update;
/// <summary>
/// Index of the item with selectable GameObject.
/// </summary>
public int Item
{
get;
private set;
}
/// <summary>
/// Index of the selectable GameObject of the item.
/// </summary>
public int SelectableGameObject
{
get;
private set;
}
/// <summary>
/// Initializes a new instance of the <see cref="SelectableData"/> struct.
/// </summary>
/// <param name="item">Index of the item with selectable GameObject.</param>
/// <param name="selectableGameObject">Index of the selectable GameObject of the item.</param>
public SelectableData(int item, int selectableGameObject)
{
Update = true;
Item = item;
SelectableGameObject = selectableGameObject;
}
/// <summary>
/// Hash function.
/// </summary>
/// <returns>A hash code for the current object.</returns>
public override int GetHashCode()
{
return Item ^ SelectableGameObject;
}
/// <summary>
/// Determines whether the specified object is equal to the current object.
/// </summary>
/// <param name="obj">The object to compare with the current object.</param>
/// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
public override bool Equals(object obj)
{
if (!(obj is SelectableData))
{
return false;
}
return Equals((SelectableData)obj);
}
/// <summary>
/// Determines whether the specified object is equal to the current object.
/// </summary>
/// <param name="other">The object to compare with the current object.</param>
/// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
public bool Equals(SelectableData other)
{
if (Update != other.Update)
{
return false;
}
if (Item != other.Item)
{
return false;
}
return SelectableGameObject == other.SelectableGameObject;
}
/// <summary>
/// Compare specified objects.
/// </summary>
/// <param name="data1">First object.</param>
/// <param name="data2">Second object.</param>
/// <returns>true if the objects are equal; otherwise, false.</returns>
public static bool operator ==(SelectableData data1, SelectableData data2)
{
return data1.Equals(data2);
}
/// <summary>
/// Compare specified objects.
/// </summary>
/// <param name="data1">First object.</param>
/// <param name="data2">Second object.</param>
/// <returns>true if the objects not equal; otherwise, false.</returns>
public static bool operator !=(SelectableData data1, SelectableData data2)
{
return !data1.Equals(data2);
}
}
/// <summary>
/// Selectable data.
/// </summary>
protected SelectableData NewSelectableData;
/// <summary>
/// Get current selected GameObject.
/// </summary>
/// <returns>Selected GameObject.</returns>
protected GameObject GetCurrentSelectedGameObject()
{
var es = EventSystem.current;
if (es == null)
{
return null;
}
var go = es.currentSelectedGameObject;
if (go == null)
{
return null;
}
if (!go.transform.IsChildOf(Container))
{
return null;
}
return go;
}
/// <summary>
/// Get item component with selected GameObject.
/// </summary>
/// <param name="go">Selected GameObject.</param>
/// <returns>Item component.</returns>
protected TItemView SelectedGameObject2Component(GameObject go)
{
if (go == null)
{
return null;
}
var t = go.transform;
foreach (var component in ComponentsPool)
{
var item_transform = component.RectTransform;
if (t.IsChildOf(item_transform) && (t.GetInstanceID() != item_transform.GetInstanceID()))
{
return component;
}
}
return null;
}
/// <summary>
/// Find index of the next item.
/// </summary>
/// <param name="index">Index of the current item with selected GameObject.</param>
/// <returns>Index of the next item</returns>
protected virtual int SelectableFindNextObjectIndex(int index)
{
for (int i = 0; i < DataSource.Count; i++)
{
var prev_index = index - i;
var next_index = index + i;
var prev_valid = IsValid(prev_index);
var next_valid = IsValid(next_index);
if (!prev_valid && !next_valid)
{
return -1;
}
if (IsVisible(next_index))
{
return next_index;
}
if (IsVisible(prev_index))
{
return prev_index;
}
}
return -1;
}
/// <inheritdoc/>
protected override void SelectableCheck()
{
var go = GetCurrentSelectedGameObject();
if (go == null)
{
return;
}
var component = SelectedGameObject2Component(go);
if (component == null)
{
return;
}
if (IsVisible(component.Index))
{
return;
}
var item_index = SelectableFindNextObjectIndex(component.Index);
if (!IsValid(item_index))
{
return;
}
NewSelectableData = new SelectableData(item_index, component.GetSelectableIndex(go));
}
/// <inheritdoc/>
protected override void SelectableSet()
{
if (!NewSelectableData.Update)
{
return;
}
var component = GetItemComponent(NewSelectableData.Item);
if (component == null)
{
return;
}
var go = component.GetSelectableObject(NewSelectableData.SelectableGameObject);
NewSelectableData.Update = false;
SetSelectedGameObject(go);
}
#endregion
#region AutoScroll
/// <summary>
/// Auto scroll.
/// </summary>
/// <returns>Coroutine.</returns>
protected override IEnumerator AutoScroll()
{
var min = 0;
var max = ListRenderer.CanScroll ? GetItemPositionBottom(DataSource.Count - 1) : 0f;
while (true)
{
var delta = AutoScrollSpeed * UtilitiesTime.GetDeltaTime(ScrollUnscaledTime) * AutoScrollDirection;
var pos = GetScrollPosition() + delta;
if (!LoopedListAvailable)
{
pos = Mathf.Clamp(pos, min, max);
}
ScrollToPosition(pos);
yield return null;
if (AutoScrollCallback != null)
{
AutoScrollCallback(AutoScrollEventData);
}
}
}
#endregion
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ListView/ListViewCustom.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ListView/ListViewCustom.cs",
"repo_id": "jynew",
"token_count": 27633
}
| 1,439 |
namespace UIWidgets
{
using System;
using System.Collections.Generic;
using UIWidgets.l10n;
/// <summary>
/// ListViewIcons.
/// </summary>
public class ListViewIcons : ListViewCustom<ListViewIconsItemComponent, ListViewIconsItemDescription>
{
#pragma warning disable 0809
/// <summary>
/// Sort items.
/// Deprecated. Replaced with DataSource.Comparison.
/// </summary>
[Obsolete("Replaced with DataSource.Comparison.")]
public override bool Sort
{
get
{
return DataSource.Comparison == ItemsComparison;
}
set
{
if (value)
{
DataSource.Comparison = ItemsComparison;
}
else
{
DataSource.Comparison = null;
}
}
}
#pragma warning restore 0809
static string GetItemName(ListViewIconsItemDescription item)
{
if (item == null)
{
return string.Empty;
}
return item.LocalizedName ?? Localization.GetTranslation(item.Name);
}
[NonSerialized]
bool isListViewIconsInited = false;
/// <summary>
/// Init this instance.
/// </summary>
public override void Init()
{
if (isListViewIconsInited)
{
return;
}
isListViewIconsInited = true;
base.Init();
#pragma warning disable 0618
if (base.Sort)
{
DataSource.Comparison = ItemsComparison;
}
#pragma warning restore 0618
}
/// <summary>
/// Process locale changes.
/// </summary>
public override void LocaleChanged()
{
base.LocaleChanged();
if (DataSource.Comparison != null)
{
DataSource.CollectionChanged();
}
}
/// <summary>
/// Items comparison.
/// </summary>
/// <param name="x">First item.</param>
/// <param name="y">Second item.</param>
/// <returns>Result of the comparison.</returns>
public static int ItemsComparison(ListViewIconsItemDescription x, ListViewIconsItemDescription y)
{
return UtilitiesCompare.Compare(GetItemName(x), GetItemName(y));
}
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ListView/ListViewIcons/ListViewIcons.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ListView/ListViewIcons/ListViewIcons.cs",
"repo_id": "jynew",
"token_count": 746
}
| 1,440 |
fileFormatVersion: 2
guid: 9f0ba5b3f4e6db642895dfce2579b352
folderAsset: yes
DefaultImporter:
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ListView/ListViewType.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ListView/ListViewType.meta",
"repo_id": "jynew",
"token_count": 47
}
| 1,441 |
fileFormatVersion: 2
guid: 2f8a16ae95238884d8ef1e6ed44c22c9
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ListView/ListViewType/TileViewTypeFixed.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ListView/ListViewType/TileViewTypeFixed.cs.meta",
"repo_id": "jynew",
"token_count": 73
}
| 1,442 |
namespace UIWidgets
{
/// <summary>
/// Base class for custom ListView for items with variable size.
/// </summary>
/// <typeparam name="TItemView">Type of DefaultItem component.</typeparam>
/// <typeparam name="TItem">Type of item.</typeparam>
public class ListViewCustomSize<TItemView, TItem> : ListViewCustom<TItemView, TItem>
where TItemView : ListViewItem
{
[UnityEngine.SerializeField]
[UnityEngine.HideInInspector]
int listViewCustomSizeVersion = 0;
/// <summary>
/// Upgrade serialized data to the latest version.
/// </summary>
public override void Upgrade()
{
base.Upgrade();
if (listViewCustomSizeVersion == 0)
{
listType = ListViewType.ListViewWithVariableSize;
listViewCustomSizeVersion = 1;
}
}
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ListView/Obsolete/ListViewCustomSize.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ListView/Obsolete/ListViewCustomSize.cs",
"repo_id": "jynew",
"token_count": 266
}
| 1,443 |
fileFormatVersion: 2
guid: 65b88dae8f4c9624ab635574713921a1
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Listeners/TransformListener.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Listeners/TransformListener.cs.meta",
"repo_id": "jynew",
"token_count": 70
}
| 1,444 |
fileFormatVersion: 2
guid: ce6af12a045b94f4aa49c1046763175d
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Progressbar/ProgressbarIndeterminate.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Progressbar/ProgressbarIndeterminate.cs.meta",
"repo_id": "jynew",
"token_count": 69
}
| 1,445 |
fileFormatVersion: 2
guid: b16a9ac0dd75a3d438cc7384091cc6b0
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Resizable/Event/SplitterResizeEvent.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Resizable/Event/SplitterResizeEvent.cs.meta",
"repo_id": "jynew",
"token_count": 72
}
| 1,446 |
fileFormatVersion: 2
guid: 9b3957617c474ec4eb1e50167a2b3e7e
folderAsset: yes
DefaultImporter:
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ScrollBlock.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ScrollBlock.meta",
"repo_id": "jynew",
"token_count": 47
}
| 1,447 |
fileFormatVersion: 2
guid: efe9747cd73a7964e89e6ccde092d782
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ScrollRectUtilities/Enums/PaginatorDirection.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ScrollRectUtilities/Enums/PaginatorDirection.cs.meta",
"repo_id": "jynew",
"token_count": 94
}
| 1,448 |
namespace UIWidgets
{
using System;
using System.Collections;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
/// <summary>
/// Scroll buttons.
/// </summary>
[RequireComponent(typeof(ScrollRect))]
public class ScrollButtons : MonoBehaviour
{
/// <summary>
/// Is the ScrollButtons eligible for interaction?
/// </summary>
[SerializeField]
public bool Interactable = true;
/// <summary>
/// ScrollRect.
/// </summary>
protected ScrollRect scrollRect;
/// <summary>
/// ScrollRect.
/// </summary>
public ScrollRect ScrollRect
{
get
{
if (scrollRect == null)
{
scrollRect = GetComponent<ScrollRect>();
}
return scrollRect;
}
}
/// <summary>
/// Left scroll button.
/// </summary>
[SerializeField]
protected RectTransform scrollButtonLeft;
/// <summary>
/// Gets or sets the left scroll button.
/// </summary>
/// <value>The scroll button left.</value>
public RectTransform ScrollButtonLeft
{
get
{
return scrollButtonLeft;
}
set
{
scrollButtonLeft = SetScrollButton(scrollButtonLeft, value, ScrollOnHoldLeft, ScrollOnClickLeft);
}
}
/// <summary>
/// Right scroll button.
/// </summary>
[SerializeField]
protected RectTransform scrollButtonRight;
/// <summary>
/// Gets or sets the right scroll button.
/// </summary>
/// <value>The scroll button right.</value>
public RectTransform ScrollButtonRight
{
get
{
return scrollButtonRight;
}
set
{
scrollButtonRight = SetScrollButton(scrollButtonRight, value, ScrollOnHoldRight, ScrollOnClickRight);
}
}
/// <summary>
/// Top scroll button.
/// </summary>
[SerializeField]
protected RectTransform scrollButtonTop;
/// <summary>
/// Gets or sets the top scroll button.
/// </summary>
/// <value>The scroll button top.</value>
public RectTransform ScrollButtonTop
{
get
{
return scrollButtonTop;
}
set
{
scrollButtonTop = SetScrollButton(scrollButtonTop, value, ScrollOnHoldTop, ScrollOnClickTop);
}
}
/// <summary>
/// Bottom scroll button.
/// </summary>
[SerializeField]
protected RectTransform scrollButtonBottom;
/// <summary>
/// Gets or sets the bottom scroll button.
/// </summary>
/// <value>The scroll button bottom.</value>
public RectTransform ScrollButtonBottom
{
get
{
return scrollButtonBottom;
}
set
{
scrollButtonBottom = SetScrollButton(scrollButtonBottom, value, ScrollOnHoldBottom, ScrollOnClickBottom);
}
}
/// <summary>
/// Scroll sensitivity rate on click.
/// Scroll on click on ScrollRect.scrollSensitivity * Rate
/// </summary>
[SerializeField]
public float ScrollSensitivityRateOnClick = 10f;
/// <summary>
/// Scroll sensitivity rate on hold.
/// Scroll during hold on ScrollRect.scrollSensitivity * Rate per 1 second
/// </summary>
[SerializeField]
public float ScrollSensitivityRateHold = 50f;
/// <summary>
/// Animate scroll on click or scroll immediately?
/// </summary>
[SerializeField]
[Tooltip("Animate scroll on click or scroll immediately?")]
public bool Animate = true;
/// <summary>
/// Animation curve on click.
/// </summary>
[SerializeField]
protected AnimationCurve curve = AnimationCurve.EaseInOut(0f, 0f, 0.2f, 1f);
/// <summary>
/// The length of the animation.
/// </summary>
protected float AnimationLength;
/// <summary>
/// Curve for click animation.
/// </summary>
/// <value>The curve.</value>
public AnimationCurve Curve
{
get
{
return curve;
}
set
{
curve = value;
AnimationLength = curve[curve.length - 1].time;
}
}
/// <summary>
/// Use unscaled time.
/// </summary>
[SerializeField]
public bool UnscaledTime;
/// <summary>
/// Current animation coroutine.
/// </summary>
protected IEnumerator CurrentCoroutine;
/// <summary>
/// Animation start time.
/// </summary>
protected float AnimationStartTime;
/// <summary>
/// ScrollRect start position.
/// </summary>
protected Vector3 StartPosition;
bool isInited;
/// <summary>
/// Start this instance.
/// </summary>
public virtual void Start()
{
Init();
}
/// <summary>
/// Init this instance.
/// </summary>
public virtual void Init()
{
if (isInited)
{
return;
}
Curve = curve;
scrollButtonLeft = SetScrollButton(scrollButtonLeft, scrollButtonLeft, ScrollOnHoldLeft, ScrollOnClickLeft);
scrollButtonRight = SetScrollButton(scrollButtonRight, scrollButtonRight, ScrollOnHoldRight, ScrollOnClickRight);
scrollButtonTop = SetScrollButton(scrollButtonTop, scrollButtonTop, ScrollOnHoldTop, ScrollOnClickTop);
scrollButtonBottom = SetScrollButton(scrollButtonBottom, scrollButtonBottom, ScrollOnHoldBottom, ScrollOnClickBottom);
isInited = true;
}
/// <summary>
/// Scroll on hold left button.
/// </summary>
protected virtual void ScrollOnHoldLeft()
{
ScrolOnHold(ScrollButtonType.Left);
}
/// <summary>
/// Scroll on hold right button.
/// </summary>
protected virtual void ScrollOnHoldRight()
{
ScrolOnHold(ScrollButtonType.Right);
}
/// <summary>
/// Scroll on hold top button.
/// </summary>
protected virtual void ScrollOnHoldTop()
{
ScrolOnHold(ScrollButtonType.Top);
}
/// <summary>
/// Scroll on hold bottom button.
/// </summary>
protected virtual void ScrollOnHoldBottom()
{
ScrolOnHold(ScrollButtonType.Bottom);
}
/// <summary>
/// Scroll on hold.
/// </summary>
/// <param name="type">Type.</param>
public void ScrolOnHold(ScrollButtonType type)
{
if (!Interactable)
{
return;
}
AnimationStop();
AnimationStartTime = UtilitiesTime.GetTime(UnscaledTime);
StartPosition = ScrollRect.content.localPosition;
ScrollRect.StopMovement();
CurrentCoroutine = AnimationHold(type);
StartCoroutine(CurrentCoroutine);
}
/// <summary>
/// Stop animation.
/// </summary>
protected virtual void AnimationStop()
{
if (CurrentCoroutine != null)
{
StopCoroutine(CurrentCoroutine);
}
}
/// <summary>
/// Sets the scroll button.
/// </summary>
/// <param name="oldButton">Old button.</param>
/// <param name="newButton">New button.</param>
/// <param name="downAction">Action on pointer down.</param>
/// <param name="clickAction">Action on pointer click.</param>
/// <returns>Returns new button.</returns>
protected virtual RectTransform SetScrollButton(RectTransform oldButton, RectTransform newButton, UnityAction downAction, UnityAction clickAction)
{
if (oldButton != null)
{
Utilities.GetOrAddComponent<ScrollButton>(oldButton).OnDown.RemoveListener(downAction);
Utilities.GetOrAddComponent<ScrollButton>(oldButton).OnUp.RemoveListener(AnimationStop);
Utilities.GetOrAddComponent<ScrollButton>(oldButton).OnClick.RemoveListener(clickAction);
}
if (newButton != null)
{
Utilities.GetOrAddComponent<ScrollButton>(newButton).OnDown.AddListener(downAction);
Utilities.GetOrAddComponent<ScrollButton>(newButton).OnUp.AddListener(AnimationStop);
Utilities.GetOrAddComponent<ScrollButton>(newButton).OnClick.AddListener(clickAction);
}
return newButton;
}
/// <summary>
/// Scroll on click left.
/// </summary>
public void ScrollOnClickLeft()
{
ScrollOnClick(ScrollButtonType.Left);
}
/// <summary>
/// Scroll on click right.
/// </summary>
public void ScrollOnClickRight()
{
ScrollOnClick(ScrollButtonType.Right);
}
/// <summary>
/// Scroll on click top.
/// </summary>
public void ScrollOnClickTop()
{
ScrollOnClick(ScrollButtonType.Top);
}
/// <summary>
/// Scroll on click bottom.
/// </summary>
public void ScrollOnClickBottom()
{
ScrollOnClick(ScrollButtonType.Bottom);
}
/// <summary>
/// Scroll on click.
/// </summary>
/// <param name="type">Type.</param>
public void ScrollOnClick(ScrollButtonType type)
{
if (!Interactable)
{
return;
}
AnimationStop();
if ((AnimationStartTime + AnimationLength) < UtilitiesTime.GetTime(UnscaledTime))
{
return;
}
ScrollRect.StopMovement();
var start = ScrollRect.content.localPosition;
var end = ScrollOnClick(type, start, ScrollRect.scrollSensitivity * ScrollSensitivityRateOnClick);
if (Animate)
{
CurrentCoroutine = AnimationClick(start, end);
StartCoroutine(CurrentCoroutine);
}
else
{
ScrollRect.content.localPosition = end;
ForceUpdateBounds();
}
}
/// <summary>
/// Force ScrollRect to update bounds.
/// </summary>
protected void ForceUpdateBounds()
{
if (ScrollRect.movementType != ScrollRect.MovementType.Unrestricted)
{
ScrollRect.horizontalNormalizedPosition = Mathf.Clamp(ScrollRect.horizontalNormalizedPosition, 0f, 1f);
ScrollRect.verticalNormalizedPosition = Mathf.Clamp(ScrollRect.verticalNormalizedPosition, 0f, 1f);
}
}
/// <summary>
/// Animation on hold.
/// </summary>
/// <returns>Nothing.</returns>
/// <param name="type">Type.</param>
protected virtual IEnumerator AnimationHold(ScrollButtonType type)
{
do
{
var delta = UtilitiesTime.GetDeltaTime(UnscaledTime);
var step = scrollRect.scrollSensitivity * ScrollSensitivityRateHold * delta;
ScrollRect.content.localPosition = ScrollOnClick(type, ScrollRect.content.localPosition, step);
ForceUpdateBounds();
yield return null;
}
while (gameObject.activeSelf);
}
/// <summary>
/// Gets the time.
/// </summary>
/// <returns>The time.</returns>
[Obsolete("Use UtilitiesTime.GetTime(UnscaledTime).")]
protected virtual float GetTime()
{
return UtilitiesTime.GetTime(UnscaledTime);
}
/// <summary>
/// Animation on click.
/// </summary>
/// <returns>Nothing.</returns>
/// <param name="start">Start scroll position.</param>
/// <param name="end">End scroll position.</param>
protected virtual IEnumerator AnimationClick(Vector3 start, Vector3 end)
{
var animation_position = 0f;
do
{
animation_position = UtilitiesTime.GetTime(UnscaledTime) - AnimationStartTime;
var pos = Vector3.Lerp(start, end, Curve.Evaluate(animation_position));
ScrollRect.content.localPosition = pos;
ForceUpdateBounds();
yield return null;
}
while (animation_position < AnimationLength);
ScrollRect.content.localPosition = end;
ForceUpdateBounds();
}
/// <summary>
/// Get scroll.
/// </summary>
/// <param name="type">Type.</param>
/// <param name="position">Position.</param>
/// <param name="value">Scroll value.</param>
/// <returns>New position.</returns>
protected virtual Vector3 ScrollOnClick(ScrollButtonType type, Vector3 position, float value)
{
switch (type)
{
case ScrollButtonType.Top:
position.y -= value;
break;
case ScrollButtonType.Bottom:
position.y += value;
break;
case ScrollButtonType.Left:
position.x += value;
break;
case ScrollButtonType.Right:
position.x -= value;
break;
default:
throw new NotSupportedException(string.Format("Unknown ScrollButtonType: {0}", EnumHelper<ScrollButtonType>.ToString(type)));
}
return position;
}
/// <summary>
/// This function is called when the MonoBehaviour will be destroyed.
/// </summary>
protected virtual void OnDestroy()
{
ScrollButtonLeft = null;
ScrollButtonRight = null;
ScrollButtonTop = null;
ScrollButtonBottom = null;
}
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ScrollRectUtilities/ScrollButtons.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ScrollRectUtilities/ScrollButtons.cs",
"repo_id": "jynew",
"token_count": 4138
}
| 1,449 |
namespace UIWidgets
{
using UIWidgets.Styles;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// ScrollRectPage with number.
/// </summary>
public class ScrollRectPageWithNumber : ScrollRectPage, IUpgradeable
{
/// <summary>
/// The number.
/// </summary>
[SerializeField]
[HideInInspector]
[System.Obsolete("Replaced with NumberAdapter.")]
public Text Number;
/// <summary>
/// The number.
/// </summary>
[SerializeField]
public TextAdapter NumberAdapter;
/// <inheritdoc/>
public override void SetPage(int page)
{
base.SetPage(page);
if (NumberAdapter != null)
{
NumberAdapter.text = (page + 1).ToString();
}
}
/// <inheritdoc/>
public override void SetStyle(StyleText styleText, Style style)
{
if (NumberAdapter != null)
{
styleText.ApplyTo(NumberAdapter.gameObject);
}
}
/// <inheritdoc/>
public override void GetStyle(StyleText styleText, Style style)
{
if (NumberAdapter != null)
{
styleText.GetFrom(NumberAdapter.gameObject);
}
}
/// <summary>
/// Upgrade this instance.
/// </summary>
public virtual void Upgrade()
{
#pragma warning disable 0612, 0618
Utilities.GetOrAddComponent(Number, ref NumberAdapter);
#pragma warning restore 0612, 0618
}
#if UNITY_EDITOR
/// <summary>
/// Validate this instance.
/// </summary>
protected virtual void OnValidate()
{
Compatibility.Upgrade(this);
}
#endif
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ScrollRectUtilities/ScrollRectPageWithNumber.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ScrollRectUtilities/ScrollRectPageWithNumber.cs",
"repo_id": "jynew",
"token_count": 552
}
| 1,450 |
namespace UIWidgets
{
using System;
using System.ComponentModel;
using UnityEngine;
/// <summary>
/// Scale mark.
/// </summary>
[Serializable]
public class ScaleMark : IObservable, INotifyPropertyChanged
{
[SerializeField]
float step;
/// <summary>
/// Step.
/// </summary>
public float Step
{
get
{
return step;
}
set
{
if (step != value)
{
step = value;
NotifyPropertyChanged("Step");
}
}
}
[SerializeField]
ScaleMarkTemplate template;
/// <summary>
/// Template.
/// </summary>
public ScaleMarkTemplate Template
{
get
{
return template;
}
set
{
if (template != value)
{
template = value;
NotifyPropertyChanged("Template");
}
}
}
/// <summary>
/// Occurs when a property value changes.
/// </summary>
public event OnChange OnChange;
/// <summary>
/// Occurs when a property value changes.
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// Raise PropertyChanged event.
/// </summary>
/// <param name="propertyName">Property name.</param>
protected void NotifyPropertyChanged(string propertyName)
{
var c_handlers = OnChange;
if (c_handlers != null)
{
c_handlers();
}
var handlers = PropertyChanged;
if (handlers != null)
{
handlers(this, new PropertyChangedEventArgs(propertyName));
}
}
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/SliderScale/ScaleMark.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/SliderScale/ScaleMark.cs",
"repo_id": "jynew",
"token_count": 575
}
| 1,451 |
fileFormatVersion: 2
guid: 1ea90dc6efc2f564795d88f26bb911b6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/SnapGrid/SnapGridDetector.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/SnapGrid/SnapGridDetector.cs.meta",
"repo_id": "jynew",
"token_count": 95
}
| 1,452 |
fileFormatVersion: 2
guid: fef7da31ec25ead469faea1d77addefa
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Spinner/SpinnerBase.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Spinner/SpinnerBase.cs.meta",
"repo_id": "jynew",
"token_count": 68
}
| 1,453 |
fileFormatVersion: 2
guid: f8832690c88019641a3aaebb39dd9aea
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Style/Collections/StyleSupportCombobox.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Style/Collections/StyleSupportCombobox.cs.meta",
"repo_id": "jynew",
"token_count": 68
}
| 1,454 |
namespace UIWidgets.Styles
{
using UnityEngine;
/// <summary>
/// Style support for the tabs on top.
/// </summary>
public class StyleSupportTabsTop : MonoBehaviour, IStylable
{
#region IStylable implementation
/// <inheritdoc/>
public virtual bool SetStyle(Style style)
{
var component = Compatibility.GetComponent<IStylable<StyleTabs>>(gameObject);
if (component != null)
{
component.SetStyle(style.TabsTop, style);
}
return true;
}
/// <inheritdoc/>
public virtual bool GetStyle(Style style)
{
var component = Compatibility.GetComponent<IStylable<StyleTabs>>(gameObject);
if (component != null)
{
component.GetStyle(style.TabsTop, style);
}
return true;
}
#endregion
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Style/Containers/StyleSupportTabsTop.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Style/Containers/StyleSupportTabsTop.cs",
"repo_id": "jynew",
"token_count": 285
}
| 1,455 |
namespace UIWidgets.Styles
{
/// <summary>
/// Interface to set default values for the style.
/// Reason: using "Resources.GetBuiltinResource" as default field value not allowed.
/// </summary>
public interface IStyleDefaultValues
{
#if UNITY_EDITOR
/// <summary>
/// Sets the default values.
/// </summary>
void SetDefaultValues();
#endif
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Style/IStyleDefaultValues.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Style/IStyleDefaultValues.cs",
"repo_id": "jynew",
"token_count": 118
}
| 1,456 |
fileFormatVersion: 2
guid: af3ac7d7aabc4dd4d806d3391fdb256e
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Style/Input/StyleColorPickerRange.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Style/Input/StyleColorPickerRange.cs.meta",
"repo_id": "jynew",
"token_count": 71
}
| 1,457 |
namespace UIWidgets.Styles
{
using System;
using UnityEngine;
/// <summary>
/// Style for the paginator.
/// </summary>
[Serializable]
public class StylePaginator : IStyleDefaultValues
{
/// <summary>
/// Style for the default background.
/// </summary>
[SerializeField]
public StyleImage DefaultBackground;
/// <summary>
/// Style for the default text.
/// </summary>
[SerializeField]
public StyleText DefaultText;
/// <summary>
/// Style for the active background.
/// </summary>
[SerializeField]
public StyleImage ActiveBackground;
/// <summary>
/// Style for the active text.
/// </summary>
[SerializeField]
public StyleText ActiveText;
#if UNITY_EDITOR
/// <inheritdoc/>
public void SetDefaultValues()
{
DefaultBackground.SetDefaultValues();
DefaultText.SetDefaultValues();
ActiveBackground.SetDefaultValues();
ActiveText.SetDefaultValues();
}
#endif
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Style/Misc/StylePaginator.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Style/Misc/StylePaginator.cs",
"repo_id": "jynew",
"token_count": 321
}
| 1,458 |
namespace UIWidgets.Styles
{
using System;
using UnityEngine;
/// <summary>
/// Style for the tooltip.
/// </summary>
[Serializable]
public class StyleTooltip : IStyleDefaultValues
{
/// <summary>
/// Style for the background.
/// </summary>
[SerializeField]
public StyleImage Background;
/// <summary>
/// Style for the text.
/// </summary>
[SerializeField]
public StyleText Text;
#if UNITY_EDITOR
/// <inheritdoc/>
public void SetDefaultValues()
{
Background.SetDefaultValues();
Text.SetDefaultValues();
}
#endif
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Style/Misc/StyleTooltip.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Style/Misc/StyleTooltip.cs",
"repo_id": "jynew",
"token_count": 209
}
| 1,459 |
namespace UIWidgets
{
using System.Collections;
using UIWidgets.Attributes;
using UIWidgets.Styles;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using UnityEngine.UI;
/// <summary>
/// Switch direction.
/// </summary>
public enum SwitchDirection
{
/// <summary>
/// Left to right.
/// </summary>
LeftToRight = 0,
/// <summary>
/// Right to left.
/// </summary>
RightToLeft = 1,
/// <summary>
/// Bottom to top.
/// </summary>
BottomToTop = 2,
/// <summary>
/// Top to bottom.
/// </summary>
TopToBottom = 3,
}
/// <summary>
/// Switch.
/// </summary>
[DataBindSupport]
public class Switch : Selectable, ISubmitHandler, IPointerClickHandler, IStylable, IValidateable
{
/// <summary>
/// Is on?
/// </summary>
[SerializeField]
protected bool isOn;
/// <summary>
/// Gets or sets a value indicating whether this instance is on.
/// </summary>
/// <value><c>true</c> if this instance is on; otherwise, <c>false</c>.</value>
[DataBindField]
public virtual bool IsOn
{
get
{
return isOn;
}
set
{
if (isOn != value)
{
isOn = value;
if (Group != null)
{
if (isOn || (!Group.AnySwitchesOn() && !Group.AllowSwitchOff))
{
isOn = true;
Group.NotifySwitchOn(this);
}
}
Changed();
}
}
}
/// <summary>
/// Switch group.
/// </summary>
[SerializeField]
protected SwitchGroup Group;
/// <summary>
/// Gets or sets the switch group.
/// </summary>
/// <value>The switch group.</value>
public virtual SwitchGroup SwitchGroup
{
get
{
return Group;
}
set
{
if (Group != null)
{
Group.UnregisterSwitch(this);
}
Group = value;
if (Group != null)
{
Group.RegisterSwitch(this);
if (IsOn)
{
Group.NotifySwitchOn(this);
}
}
}
}
/// <summary>
/// The direction.
/// </summary>
[SerializeField]
protected SwitchDirection direction = SwitchDirection.LeftToRight;
/// <summary>
/// Gets or sets the direction.
/// </summary>
/// <value>The direction.</value>
public SwitchDirection Direction
{
get
{
return direction;
}
set
{
direction = value;
SetMarkPosition(false);
}
}
/// <summary>
/// The mark.
/// </summary>
[SerializeField]
public RectTransform Mark;
/// <summary>
/// The mark.
/// </summary>
[SerializeField]
public Graphic MarkGraphic;
/// <summary>
/// The background.
/// </summary>
[SerializeField]
public Graphic Background;
[SerializeField]
Color markOnColor = new Color(1f, 1f, 1f, 1f);
/// <summary>
/// Gets or sets the color of the mark for On state.
/// </summary>
/// <value>The color of the mark for On state.</value>
public Color MarkOnColor
{
get
{
return markOnColor;
}
set
{
markOnColor = value;
SetMarkColor();
}
}
[SerializeField]
Color markOffColor = new Color(1f, 215f / 255f, 115f / 255f, 1f);
/// <summary>
/// Gets or sets the color of the mark for Off State.
/// </summary>
/// <value>The color of the mark for Off State.</value>
public Color MarkOffColor
{
get
{
return markOffColor;
}
set
{
markOffColor = value;
SetMarkColor();
}
}
[SerializeField]
Color backgroundOnColor = new Color(1f, 1f, 1f, 1f);
/// <summary>
/// Gets or sets the color of the background for On state.
/// </summary>
/// <value>The color of the background on.</value>
public Color BackgroundOnColor
{
get
{
return backgroundOnColor;
}
set
{
backgroundOnColor = value;
SetBackgroundColor();
}
}
[SerializeField]
Color backgroundOffColor = new Color(1f, 215f / 255f, 115f / 255f, 1f);
/// <summary>
/// Gets or sets the color of the background for Off State.
/// </summary>
/// <value>The color of the background off.</value>
public Color BackgroundOffColor
{
get
{
return backgroundOffColor;
}
set
{
backgroundOffColor = value;
SetBackgroundColor();
}
}
/// <summary>
/// The duration of the animation.
/// </summary>
[SerializeField]
public float AnimationDuration = 0.3f;
/// <summary>
/// Animation curve.
/// </summary>
[SerializeField]
public AnimationCurve AnimationCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
/// <summary>
/// Use unscaled time.
/// </summary>
[SerializeField]
public bool UnscaledTime;
/// <summary>
/// Callback executed when the IsOn of the switch is changed.
/// </summary>
[SerializeField]
[DataBindEvent("IsOn")]
public SwitchEvent OnValueChanged = new SwitchEvent();
/// <summary>
/// Set IsOn without OnValueChanged invoke. Not recommended for use.
/// </summary>
/// <param name="value">If set to <c>true</c> value.</param>
/// <param name="animate">Change state with animation.</param>
public void SetStatus(bool value, bool animate = true)
{
if (isOn == value)
{
return;
}
isOn = value;
if (Group != null)
{
if (isOn || (!Group.AnySwitchesOn() && !Group.AllowSwitchOff))
{
isOn = true;
Group.NotifySwitchOn(this, false, animate);
}
}
SetMarkPosition(animate);
SetBackgroundColor();
SetMarkColor();
}
/// <summary>
/// Awake this instance.
/// </summary>
protected override void Awake()
{
base.Awake();
SwitchGroup = Group;
}
/// <summary>
/// Changed this instance.
/// </summary>
protected virtual void Changed()
{
SetMarkPosition();
SetBackgroundColor();
SetMarkColor();
OnValueChanged.Invoke(IsOn);
}
/// <summary>
/// The current coroutine.
/// </summary>
protected IEnumerator CurrentCoroutine;
/// <summary>
/// Sets the mark position.
/// </summary>
/// <param name="animate">If set to <c>true</c> animate.</param>
protected virtual void SetMarkPosition(bool animate = true)
{
if (CurrentCoroutine != null)
{
StopCoroutine(CurrentCoroutine);
CurrentCoroutine = null;
}
if (animate && gameObject.activeInHierarchy)
{
CurrentCoroutine = AnimateSwitch(IsOn, AnimationDuration);
StartCoroutine(CurrentCoroutine);
}
else
{
SetMarkPosition(GetPosition(IsOn));
}
}
/// <summary>
/// Animates the switch.
/// </summary>
/// <returns>The switch.</returns>
/// <param name="state">IsOn.</param>
/// <param name="time">Time.</param>
protected virtual IEnumerator AnimateSwitch(bool state, float time)
{
var prev_position = GetPosition(!IsOn);
var next_position = GetPosition(IsOn);
SetMarkPosition(prev_position);
var start_time = UtilitiesTime.GetTime(UnscaledTime);
var end_time = start_time + time;
var current = start_time;
while (current < end_time)
{
current = UtilitiesTime.GetTime(UnscaledTime);
var length = (current - start_time) / time;
var value = AnimationCurve.Evaluate(length);
var pos = Mathf.Lerp(prev_position, next_position, value);
SetMarkPosition(pos);
yield return null;
}
SetMarkPosition(next_position);
}
/// <summary>
/// Get time.
/// </summary>
/// <returns>Time.</returns>
[System.Obsolete("Use Utilities.GetTime(UnscaledTime).")]
protected float GetTime()
{
return Utilities.GetTime(UnscaledTime);
}
/// <summary>
/// Sets the mark position.
/// </summary>
/// <param name="position">Position.</param>
protected virtual void SetMarkPosition(float position)
{
if (Mark == null)
{
return;
}
if (IsHorizontal())
{
Mark.anchorMin = new Vector2(position, Mark.anchorMin.y);
Mark.anchorMax = new Vector2(position, Mark.anchorMax.y);
Mark.pivot = new Vector2(position, Mark.pivot.y);
}
else
{
Mark.anchorMin = new Vector2(Mark.anchorMin.x, position);
Mark.anchorMax = new Vector2(Mark.anchorMax.x, position);
Mark.pivot = new Vector2(Mark.pivot.x, position);
}
}
/// <summary>
/// Determines whether this instance is horizontal.
/// </summary>
/// <returns><c>true</c> if this instance is horizontal; otherwise, <c>false</c>.</returns>
protected bool IsHorizontal()
{
return Direction == SwitchDirection.LeftToRight || Direction == SwitchDirection.RightToLeft;
}
/// <summary>
/// Gets the position.
/// </summary>
/// <returns>The position.</returns>
/// <param name="state">State.</param>
protected float GetPosition(bool state)
{
switch (Direction)
{
case SwitchDirection.LeftToRight:
case SwitchDirection.BottomToTop:
return state ? 1f : 0f;
case SwitchDirection.RightToLeft:
case SwitchDirection.TopToBottom:
return state ? 0f : 1f;
}
return 0f;
}
/// <summary>
/// Sets the color of the background.
/// </summary>
protected virtual void SetBackgroundColor()
{
if (Background == null)
{
return;
}
Background.color = IsOn ? BackgroundOnColor : BackgroundOffColor;
}
/// <summary>
/// Sets the color of the mark.
/// </summary>
protected virtual void SetMarkColor()
{
if (MarkGraphic == null)
{
return;
}
MarkGraphic.color = IsOn ? MarkOnColor : MarkOffColor;
}
/// <summary>
/// Calls the changed.
/// </summary>
protected virtual void CallChanged()
{
if (!IsActive() || !IsInteractable())
{
return;
}
IsOn = !IsOn;
}
/// <summary>
/// Called by a BaseInputModule when an OnSubmit event occurs.
/// </summary>
/// <param name="eventData">Event data.</param>
public virtual void OnSubmit(BaseEventData eventData)
{
CallChanged();
}
/// <summary>
/// Called by a BaseInputModule when an OnPointerClick event occurs.
/// </summary>
/// <param name="eventData">Event data.</param>
public virtual void OnPointerClick(PointerEventData eventData)
{
if (eventData.button != PointerEventData.InputButton.Left)
{
return;
}
CallChanged();
}
/// <summary>
/// Process the dimensions changed event.
/// </summary>
protected override void OnRectTransformDimensionsChange()
{
base.OnRectTransformDimensionsChange();
if (!IsActive())
{
return;
}
SetMarkPosition(false);
SetBackgroundColor();
SetMarkColor();
}
/// <summary>
/// Process the enable event.
/// </summary>
protected override void OnEnable()
{
base.OnEnable();
SetMarkPosition(false);
SetBackgroundColor();
SetMarkColor();
}
#if UNITY_EDITOR
/// <summary>
/// Handle validate event.
/// </summary>
public virtual void Validate()
{
SetMarkPosition(false);
SetBackgroundColor();
SetMarkColor();
}
#endif
#region IStylable implementation
/// <inheritdoc/>
public virtual bool SetStyle(Style style)
{
style.Switch.Border.ApplyTo(GetComponent<Image>());
style.Switch.BackgroundDefault.ApplyTo(Background as Image);
if (Mark != null)
{
style.Switch.MarkDefault.ApplyTo(Mark.GetComponent<Image>());
}
backgroundOnColor = style.Switch.BackgroundOnColor;
backgroundOffColor = style.Switch.BackgroundOffColor;
markOnColor = style.Switch.MarkOnColor;
markOffColor = style.Switch.MarkOffColor;
SetBackgroundColor();
SetMarkColor();
return true;
}
/// <inheritdoc/>
public virtual bool GetStyle(Style style)
{
style.Switch.Border.GetFrom(GetComponent<Image>());
style.Switch.BackgroundDefault.GetFrom(Background as Image);
if (Mark != null)
{
style.Switch.MarkDefault.GetFrom(Mark.GetComponent<Image>());
}
style.Switch.BackgroundOnColor = backgroundOnColor;
style.Switch.BackgroundOffColor = backgroundOffColor;
style.Switch.MarkOnColor = markOnColor;
style.Switch.MarkOffColor = markOffColor;
return true;
}
#endregion
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Switch/Switch.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Switch/Switch.cs",
"repo_id": "jynew",
"token_count": 4647
}
| 1,460 |
fileFormatVersion: 2
guid: 020def582f952444d9aa0245666ed3ed
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Table/TableHeader.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Table/TableHeader.cs.meta",
"repo_id": "jynew",
"token_count": 68
}
| 1,461 |
namespace UIWidgets
{
using UIWidgets.l10n;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
/// <summary>
/// Tab component.
/// </summary>
public class TabButtonComponentBase : MonoBehaviour, IUpgradeable, ISelectHandler
{
/// <summary>
/// The name.
/// </summary>
[SerializeField]
public TextAdapter NameAdapter;
/// <summary>
/// Select event.
/// </summary>
[SerializeField]
public UnityEvent OnSelectEvent = new UnityEvent();
/// <summary>
/// Select event.
/// </summary>
/// <param name="eventData">Event data.</param>
public virtual void OnSelect(BaseEventData eventData)
{
OnSelectEvent.Invoke();
}
/// <summary>
/// Sets the data.
/// </summary>
/// <param name="tab">Tab.</param>
public virtual void SetButtonData(Tab tab)
{
NameAdapter.text = Localization.GetTranslation(tab.Name);
}
/// <summary>
/// Upgrade this instance.
/// </summary>
public virtual void Upgrade()
{
}
#if UNITY_EDITOR
/// <summary>
/// Validate this instance.
/// </summary>
protected virtual void OnValidate()
{
Compatibility.Upgrade(this);
}
#endif
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Tabs/TabButtonComponentBase.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Tabs/TabButtonComponentBase.cs",
"repo_id": "jynew",
"token_count": 423
}
| 1,462 |
namespace UIWidgets
{
using System;
using System.Collections.Generic;
using UIWidgets.l10n;
using UIWidgets.Styles;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Serialization;
using UnityEngine.UI;
/// <summary>
/// Tabs.
/// </summary>
public class Tabs : MonoBehaviour, IStylable<StyleTabs>, IUpgradeable
{
/// <summary>
/// Information of the Tab button.
/// </summary>
[Serializable]
public class TabButtonInfo
{
[SerializeField]
[FormerlySerializedAs("Owner")]
Tabs owner;
[SerializeField]
[FormerlySerializedAs("DefaultButton")]
Button defaultButton;
/// <summary>
/// Default button.
/// </summary>
public Button DefaultButton
{
get
{
return defaultButton;
}
}
[SerializeField]
[FormerlySerializedAs("ActiveButton")]
Button activeButton;
/// <summary>
/// Active button.
/// </summary>
public Button ActiveButton
{
get
{
return activeButton;
}
}
/// <summary>
/// Default component.
/// </summary>
public TabButtonComponentBase DefaultComponent
{
get;
protected set;
}
/// <summary>
/// Active component.
/// </summary>
public TabButtonComponentBase ActiveComponent
{
get;
protected set;
}
[SerializeField]
[FormerlySerializedAs("Tab")]
Tab tab;
/// <summary>
/// Initializes a new instance of the <see cref="TabButtonInfo"/> class.
/// </summary>
/// <param name="owner">Owner.</param>
/// <param name="defaultButton">Default button.</param>
/// <param name="activeButton">Active button.</param>
public TabButtonInfo(Tabs owner, Button defaultButton, Button activeButton)
{
this.owner = owner;
this.defaultButton = defaultButton;
this.defaultButton.transform.SetParent(this.owner.Container, false);
DefaultComponent = this.defaultButton.GetComponent<TabButtonComponentBase>();
this.activeButton = activeButton;
this.activeButton.transform.SetParent(this.owner.Container, false);
ActiveComponent = this.activeButton.GetComponent<TabButtonComponentBase>();
this.defaultButton.onClick.AddListener(Click);
this.DefaultComponent.OnSelectEvent.AddListener(Select);
}
/// <summary>
/// Process the select event.
/// </summary>
protected void Select()
{
if (owner.ImmediateSelect)
{
owner.ProcessButtonClick(tab);
}
}
/// <summary>
/// Process the click event.
/// </summary>
protected void Click()
{
owner.ProcessButtonClick(tab);
}
/// <summary>
/// Set the tab.
/// </summary>
/// <param name="tab">Tab.</param>
public void SetTab(Tab tab)
{
this.tab = tab;
SetData();
}
/// <summary>
/// Set buttons data.
/// </summary>
public void SetData()
{
DefaultComponent.SetButtonData(tab);
ActiveComponent.SetButtonData(tab);
}
/// <summary>
/// Remove buttons callback.
/// </summary>
protected void RemoveCallback()
{
if (defaultButton != null)
{
defaultButton.onClick.RemoveListener(Click);
}
}
/// <summary>
/// Enable buttons interactions.
/// </summary>
public void EnableInteractable()
{
defaultButton.interactable = true;
activeButton.interactable = true;
}
/// <summary>
/// Disable buttons interactions
/// </summary>
public void DisableInteractable()
{
defaultButton.interactable = false;
activeButton.interactable = false;
}
/// <summary>
/// Toggle to the default state.
/// </summary>
public void Default()
{
defaultButton.gameObject.SetActive(true);
activeButton.gameObject.SetActive(false);
}
/// <summary>
/// Toggle to the active state.
/// </summary>
public void Active()
{
defaultButton.gameObject.SetActive(false);
activeButton.gameObject.SetActive(true);
if (owner.EventSystemSelectActiveHeader)
{
if (EventSystem.current.alreadySelecting)
{
Updater.RunOnce(SetSelected);
}
else
{
SetSelected();
}
}
}
void SetSelected()
{
EventSystem.current.SetSelectedGameObject(activeButton.gameObject);
}
/// <summary>
/// Set the style.
/// </summary>
/// <param name="style">Style.</param>
public void SetStyle(StyleTabs style)
{
style.DefaultButton.ApplyTo(defaultButton.gameObject);
style.ActiveButton.ApplyTo(activeButton.gameObject);
}
/// <summary>
/// Destroy buttons.
/// </summary>
public void Destroy()
{
Updater.RemoveRunOnce(SetSelected);
RemoveCallback();
if (defaultButton != null)
{
UnityEngine.Object.Destroy(defaultButton.gameObject);
}
if (activeButton != null)
{
UnityEngine.Object.Destroy(activeButton.gameObject);
}
owner = null;
}
}
/// <summary>
/// Container for the tabs buttons.
/// </summary>
[SerializeField]
public Transform Container;
/// <summary>
/// The default tab button.
/// </summary>
[SerializeField]
public Button DefaultTabButton;
/// <summary>
/// The active tab button.
/// </summary>
[SerializeField]
public Button ActiveTabButton;
[SerializeField]
Tab[] tabObjects = Compatibility.EmptyArray<Tab>();
/// <summary>
/// Gets or sets the tab objects.
/// </summary>
/// <value>The tab objects.</value>
public Tab[] TabObjects
{
get
{
return tabObjects;
}
set
{
tabObjects = value;
UpdateButtons();
}
}
/// <summary>
/// The name of the default tab.
/// </summary>
[SerializeField]
[Tooltip("Tab name which will be active by default, if not specified will be opened first Tab.")]
public string DefaultTabName = string.Empty;
/// <summary>
/// If true does not deactivate hidden tabs.
/// </summary>
[SerializeField]
[Tooltip("If true does not deactivate hidden tabs.")]
public bool KeepTabsActive = false;
/// <summary>
/// Toggle tab on EventSystem select event.
/// </summary>
[SerializeField]
[Tooltip("Toggle tab on EventSystem select event.")]
public bool ImmediateSelect = false;
/// <summary>
/// OnTabSelect event.
/// </summary>
[SerializeField]
public TabSelectEvent OnTabSelect = new TabSelectEvent();
/// <summary>
/// Gets or sets the selected tab.
/// </summary>
/// <value>The selected tab.</value>
public Tab SelectedTab
{
get;
protected set;
}
/// <summary>
/// Index of the selected tab.
/// </summary>
public int SelectedTabIndex
{
get
{
return Array.IndexOf(TabObjects, SelectedTab);
}
}
/// <summary>
/// Buttons.
/// </summary>
[SerializeField]
[HideInInspector]
protected List<TabButtonInfo> Buttons = new List<TabButtonInfo>();
/// <summary>
/// Make active header selected by EventsSystem.
/// </summary>
[SerializeField]
[Tooltip("Select active header by EventsSystem.")]
public bool EventSystemSelectActiveHeader = true;
/// <summary>
/// Check is tab can be selected.
/// </summary>
public Func<Tab, bool> CanSelectTab = AllowSelect;
/// <summary>
/// Default function for the CanSelectTab.
/// </summary>
/// <param name="tab">Tab.</param>
/// <returns>true</returns>
public static bool AllowSelect(Tab tab)
{
return true;
}
bool isInited;
/// <summary>
/// Start this instance.
/// </summary>
public virtual void Start()
{
Init();
}
/// <summary>
/// Init this instance.
/// </summary>
public virtual void Init()
{
if (isInited)
{
return;
}
isInited = true;
if (Container == null)
{
throw new InvalidOperationException("Container is null. Set object of type GameObject to Container.");
}
if (DefaultTabButton == null)
{
throw new InvalidOperationException("DefaultTabButton is null. Set object of type GameObject to DefaultTabButton.");
}
if (ActiveTabButton == null)
{
throw new InvalidOperationException("ActiveTabButton is null. Set object of type GameObject to ActiveTabButton.");
}
DefaultTabButton.gameObject.SetActive(false);
ActiveTabButton.gameObject.SetActive(false);
UpdateButtons();
Localization.OnLocaleChanged += UpdateButtonsData;
}
/// <summary>
/// Update buttons data.
/// </summary>
protected virtual void UpdateButtonsData()
{
for (int i = 0; i < Buttons.Count; i++)
{
Buttons[i].SetData();
}
}
/// <summary>
/// Process tab button click.
/// </summary>
/// <param name="tab">Tab.</param>
protected virtual void ProcessButtonClick(Tab tab)
{
if (CanSelectTab(tab))
{
SelectTab(tab);
}
}
/// <summary>
/// Updates the buttons.
/// </summary>
protected virtual void UpdateButtons()
{
CreateButtons();
if (tabObjects.Length == 0)
{
return;
}
if (!string.IsNullOrEmpty(DefaultTabName))
{
var index = Name2Index(DefaultTabName);
if (index != -1)
{
SelectTab(index);
}
else
{
Debug.LogWarning(string.Format("Tab with specified DefaultTabName \"{0}\" not found. Opened the first Tab.", DefaultTabName), this);
SelectTab(0);
}
}
else
{
SelectTab(0);
}
}
/// <summary>
/// Is exists tab with specified name.
/// </summary>
/// <param name="tabName">Tab name.</param>
/// <returns>true if exists tab with specified name; otherwise, false.</returns>
protected virtual bool IsExistsTabName(string tabName)
{
return Name2Index(tabName) != -1;
}
/// <summary>
/// Remove listeners.
/// </summary>
protected virtual void OnDestroy()
{
Localization.OnLocaleChanged -= UpdateButtonsData;
for (int i = 0; i < Buttons.Count; i++)
{
Buttons[i].Destroy();
}
Buttons.Clear();
}
/// <summary>
/// Get index for the specified Tab name.
/// </summary>
/// <param name="name">Tab name.</param>
/// <returns>Index.</returns>
protected int Name2Index(string name)
{
for (int i = 0; i < tabObjects.Length; i++)
{
if (tabObjects[i].Name == name)
{
return i;
}
}
return -1;
}
/// <summary>
/// Selects the tab.
/// </summary>
/// <param name="tabName">Tab name.</param>
public virtual void SelectTab(string tabName)
{
var index = Name2Index(tabName);
if (index == -1)
{
throw new ArgumentException(string.Format("Tab with name \"{0}\" not found.", tabName));
}
SelectTab(index);
}
/// <summary>
/// Selects the tab.
/// </summary>
/// <param name="tab">Tab.</param>
public virtual void SelectTab(Tab tab)
{
var index = Array.IndexOf(tabObjects, tab);
if (index == -1)
{
throw new ArgumentException(string.Format("Tab with name \"{0}\" not found.", tab.Name));
}
SelectTab(index);
}
/// <summary>
/// Selects the tab.
/// </summary>
/// <param name="index">Tab index.</param>
public virtual void SelectTab(int index)
{
if ((index < 0) || (index >= tabObjects.Length))
{
throw new ArgumentException(string.Format("Invalid tab index \"{0}\"; should be in range 0..{1}", index.ToString(), (tabObjects.Length - 1).ToString()));
}
if (KeepTabsActive)
{
tabObjects[index].TabObject.transform.SetAsLastSibling();
}
else
{
foreach (var tab in tabObjects)
{
DeactivateTab(tab);
}
tabObjects[index].TabObject.SetActive(true);
}
foreach (var button in Buttons)
{
DefaultState(button);
}
Buttons[index].Active();
SelectedTab = tabObjects[index];
OnTabSelect.Invoke(index);
}
/// <summary>
/// Select the next tab.
/// If current tab is last will be selected the first tab.
/// </summary>
public virtual void NextTab()
{
NextTab(true);
}
/// <summary>
/// Select the next tab.
/// </summary>
/// <param name="loop">Select the first tab if current tab is last.</param>
public virtual void NextTab(bool loop)
{
NextTab(SelectedTabIndex, +1, loop);
}
/// <summary>
/// Select the next tab.
/// </summary>
/// <param name="tab_index">Tab index.</param>
/// <param name="direction">+1 to select next tab; -1 to select previous tab.</param>
/// <param name="loop">Select the first/last tab if current tab is last/first.</param>
protected virtual void NextTab(int tab_index, int direction, bool loop)
{
tab_index += direction;
if (tab_index == tabObjects.Length)
{
if (loop)
{
tab_index = 0;
}
else
{
return;
}
}
else if (tab_index < 0)
{
if (loop)
{
tab_index = tabObjects.Length - 1;
}
else
{
return;
}
}
if (CanSelectTab(TabObjects[tab_index]))
{
SelectTab(tab_index);
}
else
{
NextTab(tab_index, direction, loop);
}
}
/// <summary>
/// Select previous tab.
/// If current tab is first will be selected the last tab.
/// </summary>
public virtual void PreviousTab()
{
PreviousTab(true);
}
/// <summary>
/// Select the previous tab.
/// </summary>
/// <param name="loop">Select the last tab if current tab is first.</param>
public virtual void PreviousTab(bool loop)
{
NextTab(SelectedTabIndex, -1, loop);
}
/// <summary>
/// Deactivate tab.
/// </summary>
/// <param name="tab">Tab.</param>
protected virtual void DeactivateTab(Tab tab)
{
tab.TabObject.SetActive(false);
}
/// <summary>
/// Activate button.
/// </summary>
/// <param name="button">Button.</param>
protected virtual void DefaultState(TabButtonInfo button)
{
button.Default();
}
/// <summary>
/// Enable button interactions.
/// </summary>
/// <param name="button">Button.</param>
protected virtual void EnableInteractable(TabButtonInfo button)
{
button.EnableInteractable();
}
/// <summary>
/// Creates the buttons.
/// </summary>
protected virtual void CreateButtons()
{
foreach (var button in Buttons)
{
EnableInteractable(button);
}
if (tabObjects.Length > Buttons.Count)
{
for (int i = Buttons.Count; i < tabObjects.Length; i++)
{
var defaultButton = Compatibility.Instantiate(DefaultTabButton);
var activeButton = Compatibility.Instantiate(ActiveTabButton);
Buttons.Add(new TabButtonInfo(this, defaultButton, activeButton));
}
}
// delete existing buttons if necessary
if (tabObjects.Length < Buttons.Count)
{
for (int i = Buttons.Count - 1; i > tabObjects.Length - 1; i--)
{
Buttons[i].Destroy();
Buttons.RemoveAt(i);
}
}
for (int i = 0; i < Buttons.Count; i++)
{
SetButtonName(Buttons[i], i);
}
}
/// <summary>
/// Sets the name of the button.
/// </summary>
/// <param name="button">Button.</param>
/// <param name="index">Index.</param>
protected virtual void SetButtonName(TabButtonInfo button, int index)
{
button.SetTab(TabObjects[index]);
}
/// <summary>
/// Disable the tab.
/// </summary>
/// <param name="tab">Tab.</param>
public virtual void DisableTab(Tab tab)
{
var i = Array.IndexOf(TabObjects, tab);
if (i != -1)
{
Buttons[i].DisableInteractable();
}
}
/// <summary>
/// Enable the tab.
/// </summary>
/// <param name="tab">Tab.</param>
public virtual void EnableTab(Tab tab)
{
var i = Array.IndexOf(TabObjects, tab);
if (i != -1)
{
Buttons[i].EnableInteractable();
}
}
/// <summary>
/// Upgrade this instance.
/// </summary>
public virtual void Upgrade()
{
if (DefaultTabButton != null)
{
var default_info = Utilities.GetOrAddComponent<TabButtonComponentBase>(DefaultTabButton);
default_info.Upgrade();
if (default_info.NameAdapter == null)
{
Utilities.GetOrAddComponent(Compatibility.GetComponentInChildren<Text>(default_info, true), ref default_info.NameAdapter);
}
}
if (ActiveTabButton != null)
{
var active_info = Utilities.GetOrAddComponent<TabButtonComponentBase>(ActiveTabButton);
active_info.Upgrade();
if (active_info.NameAdapter == null)
{
Utilities.GetOrAddComponent(Compatibility.GetComponentInChildren<Text>(active_info, true), ref active_info.NameAdapter);
}
}
}
#if UNITY_EDITOR
/// <summary>
/// Validate this instance.
/// </summary>
protected virtual void OnValidate()
{
Compatibility.Upgrade(this);
}
#endif
#region IStylable implementation
/// <inheritdoc/>
public virtual bool SetStyle(StyleTabs styleTyped, Style style)
{
if (DefaultTabButton != null)
{
styleTyped.DefaultButton.ApplyTo(DefaultTabButton.gameObject);
}
if (ActiveTabButton != null)
{
styleTyped.ActiveButton.ApplyTo(ActiveTabButton.gameObject);
}
for (int i = 0; i < Buttons.Count; i++)
{
Buttons[i].SetStyle(styleTyped);
}
for (var i = 0; i < tabObjects.Length; i++)
{
var tab = tabObjects[i];
if (tab.TabObject != null)
{
styleTyped.ContentBackground.ApplyTo(tab.TabObject.GetComponent<Image>());
style.ApplyForChildren(tab.TabObject);
}
}
return true;
}
/// <inheritdoc/>
public virtual bool GetStyle(StyleTabs styleTyped, Style style)
{
if (DefaultTabButton != null)
{
styleTyped.DefaultButton.GetFrom(DefaultTabButton.gameObject);
}
if (ActiveTabButton != null)
{
styleTyped.ActiveButton.GetFrom(ActiveTabButton.gameObject);
}
for (var i = 0; i < tabObjects.Length; i++)
{
var tab = tabObjects[i];
if (tab.TabObject != null)
{
styleTyped.ContentBackground.GetFrom(tab.TabObject.GetComponent<Image>());
style.GetFromChildren(tab.TabObject);
}
}
return true;
}
#endregion
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Tabs/Tabs.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Tabs/Tabs.cs",
"repo_id": "jynew",
"token_count": 6989
}
| 1,463 |
fileFormatVersion: 2
guid: 1752ed17982fef34c979ad689810dd7a
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Text/TextTMPro.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Text/TextTMPro.cs.meta",
"repo_id": "jynew",
"token_count": 70
}
| 1,464 |
#if UIWIDGETS_DATABIND_SUPPORT
namespace UIWidgets.DataBind
{
using Slash.Unity.DataBind.Foundation.Providers.Getters;
using UnityEngine;
/// <summary>
/// Provides the Time of an TimeBase.
/// </summary>
[AddComponentMenu("Data Bind/New UI Widgets/Getters/[DB] TimeBase Time Provider")]
public class TimeBaseTimeProvider : ComponentDataProvider<UIWidgets.TimeBase, System.TimeSpan>
{
/// <inheritdoc />
protected override void AddListener(UIWidgets.TimeBase target)
{
target.OnTimeChanged.AddListener(OnTimeChangedTimeBase);
}
/// <inheritdoc />
protected override System.TimeSpan GetValue(UIWidgets.TimeBase target)
{
return target.Time;
}
/// <inheritdoc />
protected override void RemoveListener(UIWidgets.TimeBase target)
{
target.OnTimeChanged.RemoveListener(OnTimeChangedTimeBase);
}
void OnTimeChangedTimeBase(System.TimeSpan arg0)
{
OnTargetValueChanged();
}
}
}
#endif
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/Calendar/TimeBaseTimeProvider.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/Calendar/TimeBaseTimeProvider.cs",
"repo_id": "jynew",
"token_count": 334
}
| 1,465 |
#if UIWIDGETS_DATABIND_SUPPORT
namespace UIWidgets.DataBind
{
using Slash.Unity.DataBind.Foundation.Setters;
using UnityEngine;
/// <summary>
/// Set the ValueMax of a CenteredSlider depending on the System.Int32 data value.
/// </summary>
[AddComponentMenu("Data Bind/New UI Widgets/Setters/[DB] CenteredSlider ValueMax Setter")]
public class CenteredSliderValueMaxSetter : ComponentSingleSetter<UIWidgets.CenteredSlider, int>
{
/// <inheritdoc />
protected override void UpdateTargetValue(UIWidgets.CenteredSlider target, int value)
{
target.ValueMax = value;
}
}
}
#endif
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/CenteredSlider/Horizontal/CenteredSliderValueMaxSetter.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/CenteredSlider/Horizontal/CenteredSliderValueMaxSetter.cs",
"repo_id": "jynew",
"token_count": 209
}
| 1,466 |
fileFormatVersion: 2
guid: 1ff26159ff102ac419945efee41444f9
timeCreated: 1520699792
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/CenteredSlider/Vertical/CenteredSliderVerticalLimitMaxSetter.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/CenteredSlider/Vertical/CenteredSliderVerticalLimitMaxSetter.cs.meta",
"repo_id": "jynew",
"token_count": 104
}
| 1,467 |
#if UIWIDGETS_DATABIND_SUPPORT
namespace UIWidgets.DataBind
{
using Slash.Unity.DataBind.Foundation.Setters;
using UnityEngine;
/// <summary>
/// Set the Value of a CircularSlider depending on the System.Int32 data value.
/// </summary>
[AddComponentMenu("Data Bind/New UI Widgets/Setters/[DB] CircularSlider Value Setter")]
public class CircularSliderValueSetter : ComponentSingleSetter<UIWidgets.CircularSlider, System.Int32>
{
/// <inheritdoc />
protected override void UpdateTargetValue(UIWidgets.CircularSlider target, System.Int32 value)
{
target.Value = value;
}
}
}
#endif
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/CircularSlider/Int/CircularSliderValueSetter.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/CircularSlider/Int/CircularSliderValueSetter.cs",
"repo_id": "jynew",
"token_count": 211
}
| 1,468 |
fileFormatVersion: 2
guid: 3ec0f28bdfb058d49b194fbf526065d0
timeCreated: 1520697698
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/IO/DirectoryTreeView/DirectoryTreeViewNodesSetter.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/IO/DirectoryTreeView/DirectoryTreeViewNodesSetter.cs.meta",
"repo_id": "jynew",
"token_count": 109
}
| 1,469 |
#if UIWIDGETS_DATABIND_SUPPORT
namespace UIWidgets.DataBind
{
using Slash.Unity.DataBind.Foundation.Observers;
/// <summary>
/// Observes value changes of the SelectedItem of an FileListView.
/// </summary>
public class FileListViewSelectedItemObserver : ComponentDataObserver<UIWidgets.FileListView, UIWidgets.FileSystemEntry>
{
/// <inheritdoc />
protected override void AddListener(UIWidgets.FileListView target)
{
target.OnSelectObject.AddListener(OnSelectObjectFileListView);
target.OnDeselectObject.AddListener(OnDeselectObjectFileListView);
}
/// <inheritdoc />
protected override UIWidgets.FileSystemEntry GetValue(UIWidgets.FileListView target)
{
return target.SelectedItem;
}
/// <inheritdoc />
protected override void RemoveListener(UIWidgets.FileListView target)
{
target.OnSelectObject.RemoveListener(OnSelectObjectFileListView);
target.OnDeselectObject.RemoveListener(OnDeselectObjectFileListView);
}
void OnSelectObjectFileListView(int arg0)
{
OnTargetValueChanged();
}
void OnDeselectObjectFileListView(int arg0)
{
OnTargetValueChanged();
}
}
}
#endif
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/IO/FileListView/FileListViewSelectedItemObserver.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/IO/FileListView/FileListViewSelectedItemObserver.cs",
"repo_id": "jynew",
"token_count": 403
}
| 1,470 |
#if UIWIDGETS_DATABIND_SUPPORT
namespace UIWidgets.DataBind
{
using Slash.Unity.DataBind.Foundation.Observers;
/// <summary>
/// Observes value changes of the SelectedItems of an ListView.
/// </summary>
public class ListViewSelectedItemsObserver : ComponentDataObserver<UIWidgets.ListView, System.Collections.Generic.List<string>>
{
/// <inheritdoc />
protected override void AddListener(UIWidgets.ListView target)
{
target.OnSelectString.AddListener(OnSelectStringListView);
target.OnDeselectString.AddListener(OnDeselectStringListView);
}
/// <inheritdoc />
protected override System.Collections.Generic.List<string> GetValue(UIWidgets.ListView target)
{
return target.SelectedItems;
}
/// <inheritdoc />
protected override void RemoveListener(UIWidgets.ListView target)
{
target.OnSelectString.RemoveListener(OnSelectStringListView);
target.OnDeselectString.RemoveListener(OnDeselectStringListView);
}
void OnSelectStringListView(int arg0, string arg1)
{
OnTargetValueChanged();
}
void OnDeselectStringListView(int arg0, string arg1)
{
OnTargetValueChanged();
}
}
}
#endif
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/ListView/ListView/ListViewSelectedItemsObserver.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/ListView/ListView/ListViewSelectedItemsObserver.cs",
"repo_id": "jynew",
"token_count": 404
}
| 1,471 |
#if UIWIDGETS_DATABIND_SUPPORT
namespace UIWidgets.DataBind
{
using Slash.Unity.DataBind.Foundation.Setters;
using UnityEngine;
/// <summary>
/// Set the DataSource of a ListViewIcons depending on the UIWidgets.ObservableList{UIWidgets.ListViewIconsItemDescription} data value.
/// </summary>
[AddComponentMenu("Data Bind/New UI Widgets/Setters/[DB] ListViewIcons DataSource Setter")]
public class ListViewIconsDataSourceSetter : ComponentSingleSetter<UIWidgets.ListViewIcons, UIWidgets.ObservableList<UIWidgets.ListViewIconsItemDescription>>
{
/// <inheritdoc />
protected override void UpdateTargetValue(UIWidgets.ListViewIcons target, UIWidgets.ObservableList<UIWidgets.ListViewIconsItemDescription> value)
{
target.DataSource = value;
}
}
}
#endif
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/ListView/ListViewIcons/ListViewIconsDataSourceSetter.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/ListView/ListViewIcons/ListViewIconsDataSourceSetter.cs",
"repo_id": "jynew",
"token_count": 268
}
| 1,472 |
#if UIWIDGETS_DATABIND_SUPPORT
namespace UIWidgets.DataBind
{
using Slash.Unity.DataBind.Foundation.Setters;
using UnityEngine;
/// <summary>
/// Set the Step of a RangeSliderFloat depending on the System.Single data value.
/// </summary>
[AddComponentMenu("Data Bind/New UI Widgets/Setters/[DB] RangeSliderFloat Step Setter")]
public class RangeSliderFloatStepSetter : ComponentSingleSetter<UIWidgets.RangeSliderFloat, float>
{
/// <inheritdoc />
protected override void UpdateTargetValue(UIWidgets.RangeSliderFloat target, float value)
{
target.Step = value;
}
}
}
#endif
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/RangeSlider/Float/RangeSliderFloatStepSetter.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/RangeSlider/Float/RangeSliderFloatStepSetter.cs",
"repo_id": "jynew",
"token_count": 204
}
| 1,473 |
#if UIWIDGETS_DATABIND_SUPPORT
namespace UIWidgets.DataBind
{
using Slash.Unity.DataBind.Foundation.Synchronizers;
using UnityEngine;
/// <summary>
/// Synchronizer for the ValueMin of a RangeSliderFloat.
/// </summary>
public class RangeSliderFloatValueMinSynchronizer : ComponentDataSynchronizer<UIWidgets.RangeSliderFloat, float>
{
RangeSliderFloatValueMinObserver observer;
/// <inheritdoc />
public override void Disable()
{
base.Disable();
if (observer != null)
{
observer.ValueChanged -= OnObserverValueChanged;
observer = null;
}
}
/// <inheritdoc />
public override void Enable()
{
base.Enable();
var target = Target;
if (target != null)
{
observer = new RangeSliderFloatValueMinObserver
{
Target = target,
};
observer.ValueChanged += OnObserverValueChanged;
}
}
/// <inheritdoc />
protected override void SetTargetValue(UIWidgets.RangeSliderFloat target, float newContextValue)
{
target.ValueMin = newContextValue;
}
void OnObserverValueChanged()
{
this.OnComponentValueChanged(this.Target.ValueMin);
}
}
}
#endif
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/RangeSlider/Float/RangeSliderFloatValueMinSynchronizer.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/RangeSlider/Float/RangeSliderFloatValueMinSynchronizer.cs",
"repo_id": "jynew",
"token_count": 429
}
| 1,474 |
#if UIWIDGETS_DATABIND_SUPPORT
namespace UIWidgets.DataBind
{
using Slash.Unity.DataBind.Foundation.Observers;
/// <summary>
/// Observes value changes of the Value of an Spinner.
/// </summary>
public class SpinnerValueObserver : ComponentDataObserver<UIWidgets.Spinner, int>
{
/// <inheritdoc />
protected override void AddListener(UIWidgets.Spinner target)
{
target.onValueChangeInt.AddListener(OnValueChangeIntSpinner);
}
/// <inheritdoc />
protected override int GetValue(UIWidgets.Spinner target)
{
return target.Value;
}
/// <inheritdoc />
protected override void RemoveListener(UIWidgets.Spinner target)
{
target.onValueChangeInt.RemoveListener(OnValueChangeIntSpinner);
}
void OnValueChangeIntSpinner(int arg0)
{
OnTargetValueChanged();
}
}
}
#endif
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/Spinner/Int/SpinnerValueObserver.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/DataBindSupport/Spinner/Int/SpinnerValueObserver.cs",
"repo_id": "jynew",
"token_count": 298
}
| 1,475 |
#if UIWIDGETS_TMPRO_SUPPORT
namespace UIWidgets.TMProSupport
{
using UIWidgets;
/// <summary>
/// ComboboxIcons item component.
/// Demonstrate how to remove selected item - add Remove() call on Button.OnClick().
/// </summary>
public class ComboboxIconsItemComponentTMPro : ListViewIconsItemComponentTMPro
{
/// <summary>
/// ComboboxIcons.
/// </summary>
public ComboboxIcons ComboboxIcons;
/// <summary>
/// Remove this instance.
/// </summary>
public void Remove()
{
ComboboxIcons.ListView.Deselect(Index);
}
}
}
#endif
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/TMProSupport/Scripts/Combobox/ComboboxIconsItemComponentTMPro.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/TMProSupport/Scripts/Combobox/ComboboxIconsItemComponentTMPro.cs",
"repo_id": "jynew",
"token_count": 206
}
| 1,476 |
#if UIWIDGETS_TMPRO_SUPPORT && (UNITY_5_2 || UNITY_5_3 || UNITY_5_3_OR_NEWER)
namespace UIWidgets.TMProSupport
{
using TMPro;
using UnityEngine;
/// <summary>
/// FileDialog TMPro.
/// </summary>
public class FileDialogTMPro : FileDialog
{
/// <summary>
/// Filename Input.
/// </summary>
[SerializeField]
[HideInInspector]
[System.Obsolete("Replaced with FilenameInputAdapter.")]
public TMP_InputField FilenameInputTMPro;
/// <summary>
/// Upgrade this instance.
/// </summary>
public override void Upgrade()
{
#pragma warning disable 0612, 0618
Utilities.GetOrAddComponent(FilenameInputTMPro, ref FilenameInputAdapter);
#pragma warning restore 0612, 0618
}
}
}
#endif
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/TMProSupport/Scripts/IO/FileDialogTMPro.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/TMProSupport/Scripts/IO/FileDialogTMPro.cs",
"repo_id": "jynew",
"token_count": 266
}
| 1,477 |
fileFormatVersion: 2
guid: fc39738e71f48f544af1589b62faf21c
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/TMProSupport/Scripts/ListView/ListViewStringComponentTMPro.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/TMProSupport/Scripts/ListView/ListViewStringComponentTMPro.cs.meta",
"repo_id": "jynew",
"token_count": 70
}
| 1,478 |
#if UIWIDGETS_TMPRO_SUPPORT
namespace UIWidgets.TMProSupport
{
using TMPro;
using UIWidgets;
using UnityEngine;
/// <summary>
/// Tab component.
/// </summary>
public class TabButtonComponentTMPro : TabButtonComponentBase
{
/// <summary>
/// The name.
/// </summary>
[SerializeField]
[HideInInspector]
[System.Obsolete("Replaced with NameAdapter.")]
public TextMeshProUGUI Name;
/// <summary>
/// Upgrade this instance.
/// </summary>
public override void Upgrade()
{
#pragma warning disable 0612, 0618
Utilities.GetOrAddComponent(Name, ref NameAdapter);
#pragma warning restore 0612, 0618
}
}
}
#endif
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/TMProSupport/Scripts/Tabs/TabButtonComponentTMPro.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/ThirdPartySupport/TMProSupport/Scripts/Tabs/TabButtonComponentTMPro.cs",
"repo_id": "jynew",
"token_count": 235
}
| 1,479 |
namespace UIWidgets
{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
/// <summary>
/// Tooltip listener.
/// </summary>
public class TooltipListener : MonoBehaviour,
IPointerEnterHandler, IPointerExitHandler,
ISelectHandler, IDeselectHandler
{
/// <summary>
/// Info.
/// </summary>
protected class TooltipInfo
{
/// <summary>
/// Tooltip.
/// </summary>
public TooltipBase Tooltip;
/// <summary>
/// Coroutine.
/// </summary>
public IEnumerator Coroutine;
static Stack<TooltipInfo> Cache = new Stack<TooltipInfo>();
/// <summary>
/// Initializes a new instance of the <see cref="TooltipInfo"/> class.
/// </summary>
/// <param name="tooltip">Tooltip.</param>
private TooltipInfo(TooltipBase tooltip)
{
Tooltip = tooltip;
}
/// <summary>
/// Get instance.
/// </summary>
/// <param name="tooltip">Tooltip.</param>
/// <returns>Instance.</returns>
public static TooltipInfo Get(TooltipBase tooltip)
{
if (Cache.Count > 0)
{
var info = Cache.Pop();
info.Tooltip = tooltip;
return info;
}
return new TooltipInfo(tooltip);
}
/// <summary>
/// Free instance.
/// </summary>
public void Free()
{
Tooltip = null;
Coroutine = null;
Cache.Push(this);
}
#if UNITY_EDITOR && UNITY_2019_3_OR_NEWER
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
static void StaticInit()
{
Cache.Clear();
}
#endif
}
/// <summary>
/// Registered tooltips.
/// </summary>
protected List<TooltipInfo> Tooltips = new List<TooltipInfo>();
/// <summary>
/// Settings.
/// </summary>
public TooltipSettings Settings;
/// <summary>
/// Process the pointer enter event.
/// </summary>
/// <param name="eventData">Current event data.</param>
public virtual void OnPointerEnter(PointerEventData eventData)
{
Show();
}
/// <summary>
/// Process the pointer exit event.
/// </summary>
/// <param name="eventData">Current event data.</param>
public virtual void OnPointerExit(PointerEventData eventData)
{
Hide();
}
/// <summary>
/// Process the select event.
/// </summary>
/// <param name="eventData">Current event data.</param>
public virtual void OnSelect(BaseEventData eventData)
{
Show();
}
/// <summary>
/// Process the deselect event.
/// </summary>
/// <param name="eventData">Current event data.</param>
public virtual void OnDeselect(BaseEventData eventData)
{
Hide();
}
/// <summary>
/// Register tooltip.
/// </summary>
/// <param name="tooltip">Tooltip.</param>
public virtual void Register(TooltipBase tooltip)
{
if (Registered(tooltip))
{
return;
}
Tooltips.Add(TooltipInfo.Get(tooltip));
}
/// <summary>
/// Unregister tooltip.
/// </summary>
/// <param name="tooltip">Tooltip.</param>
/// <returns>true if tooltip was registered; otherwise false.</returns>
public virtual bool Unregister(TooltipBase tooltip)
{
var result = false;
for (int i = Tooltips.Count - 1; i >= 0; i--)
{
var info = Tooltips[i];
if (info.Tooltip == tooltip)
{
FreeTooltipInfo(info);
Tooltips.RemoveAt(i);
result = true;
}
}
return result;
}
/// <summary>
/// Free info instance.
/// </summary>
/// <param name="tooltipInfo">Info instance.</param>
protected virtual void FreeTooltipInfo(TooltipInfo tooltipInfo)
{
if (tooltipInfo.Coroutine != null)
{
StopCoroutine(tooltipInfo.Coroutine);
}
tooltipInfo.Free();
}
/// <summary>
/// Is specified tooltip registered?
/// </summary>
/// <param name="tooltip">Tooltip.</param>
/// <returns>true if tooltip is registered; otherwise false.</returns>
public bool Registered(TooltipBase tooltip)
{
foreach (var info in Tooltips)
{
if (info.Tooltip == tooltip)
{
return true;
}
}
return false;
}
/// <summary>
/// Show tooltip.
/// </summary>
/// <param name="info">Info.</param>
/// <returns>Coroutine.</returns>
protected virtual IEnumerator Show(TooltipInfo info)
{
var settings = info.Tooltip.GetSettings(gameObject);
yield return UtilitiesTime.Wait(settings.ShowDelay, settings.UnscaledTime);
info.Tooltip.Show(gameObject);
}
/// <summary>
/// Show tooltips.
/// </summary>
public void Show()
{
foreach (var info in Tooltips)
{
info.Coroutine = Show(info);
StartCoroutine(info.Coroutine);
}
}
/// <summary>
/// Hide tooltip.
/// </summary>
/// <param name="info">Tooltip info.</param>
protected virtual void Hide(TooltipInfo info)
{
if (info.Coroutine != null)
{
StopCoroutine(info.Coroutine);
info.Coroutine = null;
}
info.Tooltip.Hide();
}
/// <summary>
/// Hide tooltips.
/// </summary>
public void Hide()
{
foreach (var info in Tooltips)
{
Hide(info);
}
}
/// <summary>
/// Process the destroy event.
/// </summary>
protected virtual void OnDestroy()
{
foreach (var tooltip in Tooltips)
{
FreeTooltipInfo(tooltip);
}
Tooltips.Clear();
}
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Tooltips/TooltipListener.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Tooltips/TooltipListener.cs",
"repo_id": "jynew",
"token_count": 2071
}
| 1,480 |
fileFormatVersion: 2
guid: 827b8d7d2304bec448ea9ba9a3d2dbae
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/TracksView/ITrackData.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/TracksView/ITrackData.cs.meta",
"repo_id": "jynew",
"token_count": 72
}
| 1,481 |
namespace UIWidgets
{
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
/// <summary>
/// Base class for the data drag support.
/// </summary>
/// <typeparam name="TData">Data type.</typeparam>
/// <typeparam name="TPoint">Point type.</typeparam>
/// <typeparam name="TDataView">Data view type.</typeparam>
public abstract class TrackDataCustomDragSupport<TData, TPoint, TDataView> : DragSupport<TData>
where TDataView : TrackDataViewBase<TData, TPoint>
where TData : class, ITrackData<TPoint>
where TPoint : IComparable<TPoint>
{
/// <summary>
/// Track.
/// </summary>
[SerializeField]
[HideInInspector]
public Track<TData, TPoint> Track;
/// <summary>
/// Owner.
/// </summary>
public TracksViewBase<TData, TPoint> Owner;
/// <summary>
/// The drag info.
/// </summary>
[SerializeField]
public TDataView DragInfo;
/// <summary>
/// DragInfo offset.
/// </summary>
[SerializeField]
public Vector3 DragInfoOffset = new Vector3(-5, 5, 0);
/// <summary>
/// Current target track to drop data.
/// </summary>
protected Track<TData, TPoint> CurrentTargetTrack;
/// <summary>
/// Distance from left border of the item to pointer press position.
/// Needed to correctly determine StartPoint.
/// </summary>
protected float DragPositionPadding;
/// <inheritdoc/>
protected override void Start()
{
base.Start();
if (DragInfo != null)
{
if (DragInfo.gameObject.GetInstanceID() == gameObject.GetInstanceID())
{
DragInfo = null;
Debug.LogWarning("DragInfo cannot be same gameobject as DragSupport.", this);
}
else
{
DragInfo.gameObject.SetActive(false);
}
}
}
/// <inheritdoc/>
protected override void OnInitializePotentialDrag(PointerEventData eventData)
{
base.OnInitializePotentialDrag(eventData);
CurrentTargetTrack = Track;
}
/// <inheritdoc/>
protected override void FindCurrentTarget(PointerEventData eventData, List<RaycastResult> raycasts)
{
base.FindCurrentTarget(eventData, RaycastResults);
var target = CurrentTarget as TrackBackgroundBase<TData, TPoint>;
if ((target != null) && (target.Track != CurrentTargetTrack))
{
CurrentTargetTrack.Data.Remove(Data);
CurrentTargetTrack = target.Track;
}
}
/// <inheritdoc/>
protected override void InitDrag(PointerEventData eventData)
{
Vector2 point;
if (!RectTransformUtility.ScreenPointToLocalPointInRectangle(transform as RectTransform, eventData.position, eventData.pressEventCamera, out point))
{
DragPositionPadding = 0f;
}
else
{
DragPositionPadding = point.x;
}
var component = GetComponent<TDataView>();
Data = component.Data;
Data.IsDragged = true;
ShowDragInfo();
}
/// <inheritdoc/>
protected override bool CheckTarget(IDropSupport<TData> target, PointerEventData eventData)
{
var track_bg = CurrentTarget as TrackBackgroundBase<TData, TPoint>;
if (track_bg != null)
{
track_bg.DragPositionPadding = DragPositionPadding;
}
return base.CheckTarget(target, eventData);
}
/// <inheritdoc/>
protected override void OnDrag(PointerEventData eventData)
{
if ((Owner != null) && (CurrentTarget != null))
{
#if CSHARP_7_3_OR_NEWER
void Action()
#else
Action Action = () =>
#endif
{
if ((Owner != null) && Owner.AllowDragOutside && (CurrentTarget == null))
{
var start = Owner.Position2Point(eventData.position, eventData.pressEventCamera);
var end = Data.EndPointByStartPoint(start);
var can_move = Owner.AllowIntersection || !Owner.TrackIntersection(Track, start, end, Data.Order, Data);
if (can_move)
{
Data.ChangePoints(start, end);
}
}
base.OnDrag(eventData);
}
#if !CSHARP_7_3_OR_NEWER
;
#endif
Owner.StartAutoScroll(eventData, Action);
}
base.OnDrag(eventData);
}
/// <inheritdoc/>
protected override void OnEndDrag(PointerEventData eventData)
{
if (Owner != null)
{
Owner.StopAutoScroll();
}
base.OnEndDrag(eventData);
}
/// <summary>
/// Shows the drag info.
/// </summary>
protected virtual void ShowDragInfo()
{
if (DragInfo == null)
{
return;
}
var rt = DragInfo.transform as RectTransform;
rt.SetParent(DragPoint, false);
rt.localPosition = DragInfoOffset;
DragInfo.SetData(null, Data, 0f);
DragInfo.gameObject.SetActive(true);
}
/// <summary>
/// Hides the drag info.
/// </summary>
protected virtual void HideDragInfo()
{
if (DragInfo == null)
{
return;
}
DragInfo.gameObject.SetActive(false);
}
/// <inheritdoc/>
public override void Dropped(bool success)
{
Data.IsDragged = false;
HideDragInfo();
base.Dropped(success);
}
/// <inheritdoc/>
protected override void OnDisable()
{
if (IsDragged)
{
if (Owner != null)
{
Owner.StopAutoScroll();
}
}
base.OnDisable();
}
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/TracksView/TrackDataCustomDragSupport.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/TracksView/TrackDataCustomDragSupport.cs",
"repo_id": "jynew",
"token_count": 1958
}
| 1,482 |
namespace UIWidgets
{
using System;
using System.Collections.Generic;
using UIWidgets.Attributes;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Serialization;
using UnityEngine.UI;
/// <summary>
/// Base class for TracksView.
/// </summary>
/// <typeparam name="TData">Data type.</typeparam>
/// <typeparam name="TPoint">Point type.</typeparam>
public abstract class TracksViewBase<TData, TPoint> : UIBehaviourConditional, IUpdatable
where TData : class, ITrackData<TPoint>
where TPoint : IComparable<TPoint>
{
#region Interactable
/// <summary>
/// The CanvasGroup cache.
/// </summary>
protected readonly List<CanvasGroup> CanvasGroupCache = new List<CanvasGroup>();
[SerializeField]
bool interactable = true;
/// <summary>
/// Is widget interactable.
/// </summary>
/// <value><c>true</c> if interactable; otherwise, <c>false</c>.</value>
public bool Interactable
{
get
{
return interactable;
}
set
{
if (interactable != value)
{
interactable = value;
InteractableChanged();
}
}
}
/// <summary>
/// If the canvas groups allow interaction.
/// </summary>
protected bool GroupsAllowInteraction = true;
/// <summary>
/// Process the CanvasGroupChanged event.
/// </summary>
protected override void OnCanvasGroupChanged()
{
var groupAllowInteraction = true;
var t = transform;
while (t != null)
{
t.GetComponents(CanvasGroupCache);
var shouldBreak = false;
foreach (var canvas_group in CanvasGroupCache)
{
if (!canvas_group.interactable)
{
groupAllowInteraction = false;
shouldBreak = true;
}
shouldBreak |= canvas_group.ignoreParentGroups;
}
if (shouldBreak)
{
break;
}
t = t.parent;
}
if (groupAllowInteraction != GroupsAllowInteraction)
{
GroupsAllowInteraction = groupAllowInteraction;
InteractableChanged();
}
}
/// <summary>
/// Determines whether this widget is interactable.
/// </summary>
/// <returns><c>true</c> if this instance is interactable; otherwise, <c>false</c>.</returns>
public virtual bool IsInteractable()
{
return GroupsAllowInteraction && Interactable;
}
/// <summary>
/// Process interactable change.
/// </summary>
protected virtual void InteractableChanged()
{
if (IsInteractable())
{
OnInteractableEnabled();
}
else
{
OnInteractableDisabled();
}
}
/// <summary>
/// What to do when widget became interactable.
/// </summary>
protected virtual void OnInteractableEnabled()
{
}
/// <summary>
/// What to do when widget became not interactable.
/// </summary>
protected virtual void OnInteractableDisabled()
{
}
#endregion
[SerializeField]
[HideInInspector]
ObservableList<Track<TData, TPoint>> tracks = new ObservableList<Track<TData, TPoint>>();
/// <summary>
/// Tracks.
/// </summary>
public ObservableList<Track<TData, TPoint>> Tracks
{
get
{
Init();
return tracks;
}
set
{
Init();
if (tracks != value)
{
tracks.OnChange -= UpdateView;
tracks = value;
tracks.OnChange += UpdateView;
UpdateView();
}
}
}
[SerializeField]
ScrollRect trackDataView;
/// <summary>
/// Tracks data View.
/// </summary>
public ScrollRect TracksDataView
{
get
{
return trackDataView;
}
set
{
if (trackDataView != value)
{
DisableDataView(trackDataView);
trackDataView = value;
EnableDataView(trackDataView);
UpdateView();
}
}
}
[SerializeField]
ScrollRect tracksNamesView;
/// <summary>
/// Tracks header view.
/// </summary>
public ScrollRect TracksNamesView
{
get
{
return tracksNamesView;
}
set
{
if (tracksNamesView != value)
{
DisableTracksView(tracksNamesView);
tracksNamesView = value;
EnableTracksView(tracksNamesView);
UpdateView();
}
}
}
[SerializeField]
ScrollBlockBase pointNamesView;
/// <summary>
/// Points names view.
/// </summary>
public ScrollBlockBase PointsNamesView
{
get
{
return pointNamesView;
}
set
{
if (pointNamesView != value)
{
DisablePointsView(pointNamesView);
pointNamesView = value;
pointNamesView.Init();
EnablePointsView(pointNamesView);
ChangeDefaultItemResizable();
UpdateView();
}
}
}
/// <summary>
/// First visible point.
/// </summary>
public TPoint VisibleStart
{
get;
protected set;
}
/// <summary>
/// Last visible point.
/// </summary>
public TPoint VisibleEnd
{
get;
protected set;
}
/// <summary>
/// Value at center of the PointsNamesView.
/// </summary>
protected TPoint valueAtCenter;
/// <summary>
/// Value at center of the PointsNamesView.
/// </summary>
public TPoint ValueAtCenter
{
get
{
return valueAtCenter;
}
set
{
if (valueAtCenter.CompareTo(value) != 0)
{
valueAtCenter = value;
PointsNamesView.UpdateView();
UpdateView();
}
}
}
/// <summary>
/// Space between data.
/// </summary>
[SerializeField]
public float ItemsSpacing = 5f;
/// <summary>
/// Space between tracks.
/// </summary>
[SerializeField]
public float TracksSpacing;
/// <summary>
/// Allow to drag data outside of the TrackDataView.
/// </summary>
[Tooltip("Allow to drag data outside of the TrackDataView")]
public bool AllowDragOutside = true;
/// <summary>
/// Set minimal order of the items.
/// </summary>
[SerializeField]
[FormerlySerializedAs("setMinimalOrder")]
protected bool itemsToTop = true;
/// <summary>
/// Set minimal order of the items.
/// </summary>
public bool ItemsToTop
{
get
{
return itemsToTop;
}
set
{
if (itemsToTop != value)
{
itemsToTop = value;
if (isInited)
{
Layout = null;
UpdateView();
}
}
}
}
/// <summary>
/// Compact items layout.
/// </summary>
[SerializeField]
protected bool compact = true;
/// <summary>
/// Compact items layout.
/// </summary>
public bool Compact
{
get
{
return compact;
}
set
{
if (compact != value)
{
compact = value;
if (isInited)
{
Layout = null;
UpdateView();
}
}
}
}
/// <summary>
/// Allow temporary intersection during drag: overlapped data will be moved to another line.
/// </summary>
[SerializeField]
[Tooltip("Allow temporary intersection during drag.")]
public bool AllowIntersection = true;
/// <summary>
/// DefaultItem size.
/// </summary>
public Vector2 DefaultItemSize
{
get;
protected set;
}
/// <summary>
/// DataHeader size,
/// </summary>
[NonSerialized]
protected Vector2 DataHeaderSize;
/// <summary>
/// Layout.
/// </summary>
protected TrackLayout<TData, TPoint> Layout;
/// <summary>
/// Start this instance.
/// </summary>
protected override void Start()
{
base.Start();
Init();
}
bool isInited;
/// <summary>
/// Init this instance.
/// </summary>
public virtual void Init()
{
if (isInited)
{
return;
}
isInited = true;
tracks.OnChange += UpdateView;
}
/// <summary>
/// Process destroy event.
/// </summary>
protected override void OnDestroy()
{
DisableDataView(TracksDataView);
DisableTracksView(TracksNamesView);
DisablePointsView(PointsNamesView);
if (tracks != null)
{
tracks.OnChange -= UpdateView;
tracks = null;
}
base.OnDestroy();
}
/// <summary>
/// Get string representation of ValueAtCenter at specified distance.
/// </summary>
/// <param name="distance">Distance.</param>
/// <returns>String representation of value at specified distance.</returns>
protected abstract string Value2Text(int distance);
/// <summary>
/// Change value on specified delta.
/// </summary>
/// <param name="delta">Delta.</param>
/// <returns>New value.</returns>
protected abstract TPoint ChangeValue(int delta);
/// <summary>
/// Increase ValueAtCenter at 1.
/// </summary>
protected virtual void Increase()
{
ValueAtCenter = ChangeValue(+1);
}
/// <summary>
/// Decrease ValueAtCenter at 1.
/// </summary>
protected virtual void Decrease()
{
ValueAtCenter = ChangeValue(-1);
}
/// <summary>
/// Set track settings.
/// </summary>
/// <param name="track">Track.</param>
protected virtual void SetTrackSettings(Track<TData, TPoint> track)
{
track.SeparateGroups = true;
track.Layout = Layout;
track.ItemsToTop = ItemsToTop;
}
/// <summary>
/// Update views.
/// </summary>
protected virtual void UpdateView()
{
if (Layout == null)
{
Layout = GetLayout();
}
foreach (var track in Tracks)
{
SetTrackSettings(track);
}
var half = (PointsNamesView.Count / 2) + 1;
VisibleStart = ChangeValue(-half);
VisibleEnd = ChangeValue(half);
UpdateDataView();
UpdateTracksView();
}
/// <summary>
/// Get layout for the tracks.
/// </summary>
/// <returns>Layout function.</returns>
protected virtual TrackLayout<TData, TPoint> GetLayout()
{
if (ItemsToTop)
{
if (Compact)
{
return new TrackLayoutTopLineCompact<TData, TPoint>();
}
else
{
return new TrackLayoutTopLine<TData, TPoint>();
}
}
else
{
if (Compact)
{
return new TrackLayoutAnyLineCompact<TData, TPoint>();
}
else
{
return new TrackLayoutAnyLine<TData, TPoint>();
}
}
}
/// <summary>
/// Update view on scroll.
/// </summary>
protected virtual void UpdateViewScroll()
{
var half = (PointsNamesView.Count / 2) + 1;
var new_start = ChangeValue(-half);
var new_end = ChangeValue(half);
var is_changed = (VisibleStart.CompareTo(new_start) != 0) || (VisibleEnd.CompareTo(new_end) != 0);
if (is_changed)
{
VisibleStart = new_start;
VisibleEnd = new_end;
UpdateDataView();
}
else
{
UpdateDataViewPositions();
}
}
/// <summary>
/// Update data view.
/// </summary>
protected abstract void UpdateDataView();
/// <summary>
/// Update data view positions.
/// </summary>
protected abstract void UpdateDataViewPositions();
/// <summary>
/// Update tracks view.
/// </summary>
protected abstract void UpdateTracksView();
/// <summary>
/// Get track height.
/// </summary>
/// <param name="track">Track.</param>
/// <returns>Height.</returns>
protected virtual float TrackHeight(Track<TData, TPoint> track)
{
return (track.MaxItemsAtSamePoint * (DefaultItemSize.y + ItemsSpacing)) - ItemsSpacing;
}
/// <summary>
/// Convert point to base value.
/// </summary>
/// <param name="point">Point.</param>
/// <returns>Base value.</returns>
protected abstract float Point2Base(TPoint point);
/// <summary>
/// Convert base value to point.
/// </summary>
/// <param name="baseValue">Base value.</param>
/// <returns>Point.</returns>
protected abstract TPoint Base2Point(float baseValue);
/// <summary>
/// Convert point to position.
/// </summary>
/// <param name="point">Point.</param>
/// <returns>Position.</returns>
public virtual float Point2Position(TPoint point)
{
return (Point2Base(point) * DataHeaderSize.x) - PointsNamesView.DistanceToCenter - (DataHeaderSize.x / 2f);
}
/// <summary>
/// Convert position to point.
/// </summary>
/// <param name="position">Position.</param>
/// <returns>Point.</returns>
public virtual TPoint Position2Point(float position)
{
position += PointsNamesView.DistanceToCenter;
position += DataHeaderSize.x / 2f;
return Base2Point(position / DataHeaderSize.x);
}
/// <summary>
/// Temporary list.
/// Used by TrackIntersection() method.
/// </summary>
protected List<TData> TempList = new List<TData>();
/// <summary>
/// Check if target item has intersection with items in the track within range and order.
/// </summary>
/// <param name="track">Track.</param>
/// <param name="start">Start point.</param>
/// <param name="end">End item.</param>
/// <param name="order">New order of the target item.</param>
/// <param name="target">Target item. Will be ignored if presents in the items list.</param>
/// <returns>true if any items has intersection; otherwise false.</returns>
public virtual bool TrackIntersection(Track<TData, TPoint> track, TPoint start, TPoint end, int order, TData target)
{
var is_new = !track.Data.Contains(target);
if ((!is_new) && (target.Order != order))
{
return false;
}
GetPossibleIntersections(track.Data, order, target, TempList);
var result = ListIntersection(TempList, start, end, order, target);
TempList.Clear();
return result;
}
/// <summary>
/// Get possible intersections with the target.
/// </summary>
/// <param name="items">Items.</param>
/// <param name="order">Order.</param>
/// <param name="target">Target.</param>
/// <param name="output">List of the possible intersections,</param>
protected virtual void GetPossibleIntersections(ObservableList<TData> items, int order, TData target, List<TData> output)
{
foreach (var item in items)
{
if ((item.Order == order) && !ReferenceEquals(item, target))
{
output.Add(item);
}
}
}
/// <summary>
/// Check if target item has intersection with items within range and order.
/// </summary>
/// <param name="items">Items.</param>
/// <param name="start">Start point.</param>
/// <param name="end">End item.</param>
/// <param name="order">New order of the target item.</param>
/// <param name="target">Target item. Will be ignored if presents in the items list.</param>
/// <returns>true if any items has intersection with specified points; otherwise false.</returns>
protected virtual bool ListIntersection(List<TData> items, TPoint start, TPoint end, int order, TData target)
{
foreach (var item in items)
{
if (ItemIntersection(item, start, end))
{
return true;
}
}
return false;
}
/// <summary>
/// Is item has intersection with specified range?
/// </summary>
/// <param name="item">Item.</param>
/// <param name="start">Start point.</param>
/// <param name="end">End range.</param>
/// <returns>true if item has intersection; otherwise false.</returns>
protected bool ItemIntersection(TData item, TPoint start, TPoint end)
{
// item.Start in [start..end)
var start_intersect = (item.StartPoint.CompareTo(start) >= 0)
&& (item.StartPoint.CompareTo(end) < 0);
// item.End in [start..end)
var end_intersect = (item.EndPoint.CompareTo(start) > 0)
&& (item.EndPoint.CompareTo(end) <= 0);
// item.Start <= start and Item.end >= end
var full_intersect = (item.StartPoint.CompareTo(start) <= 0)
&& (item.EndPoint.CompareTo(end) > 0);
return start_intersect || end_intersect || full_intersect;
}
/// <summary>
/// Convert position based event data to point.
/// </summary>
/// <param name="position">Position.</param>
/// <param name="camera">Camera.</param>
/// <returns>Point.</returns>
public virtual TPoint Position2Point(Vector2 position, Camera camera)
{
Vector2 point;
RectTransformUtility.ScreenPointToLocalPointInRectangle(TracksDataView.transform as RectTransform, position, camera, out point);
return Position2Point(point.x);
}
/// <summary>
/// Get minimal width of the item.
/// </summary>
/// <returns>Minimal width.</returns>
protected abstract float GetItemMinWidth();
/// <summary>
/// Get width of the point names header.
/// </summary>
/// <returns>Width of the point names header.</returns>
protected virtual float GetPointHeaderWidth()
{
PointsNamesView.Init();
return PointsNamesView.DefaultItemSize.x;
}
/// <summary>
/// Change settings of DefaultItem.Resizable component.
/// </summary>
protected abstract void ChangeDefaultItemResizable();
/// <summary>
/// Process resize event.
/// </summary>
protected virtual void OnResize()
{
PointsNamesView.Init();
DataHeaderSize = PointsNamesView.DefaultItemSize;
UpdateView();
}
/// <summary>
/// Enable data view.
/// </summary>
/// <param name="dataView">Data view.</param>
protected virtual void EnableDataView(ScrollRect dataView)
{
if (dataView == null)
{
return;
}
dataView.content.pivot = new Vector2(0.5f, 1f);
dataView.inertia = false;
dataView.horizontal = true;
dataView.vertical = true;
var data_drag = Utilities.GetOrAddComponent<DragListener>(dataView);
data_drag.OnInitializePotentialDragEvent.AddListener(OnDataDragInit);
data_drag.OnDragStartEvent.AddListener(OnDataDragBegin);
data_drag.OnDragEvent.AddListener(OnDataDrag);
data_drag.OnDragEndEvent.AddListener(OnDataDragEnd);
data_drag.OnScrollEvent.AddListener(OnDataScroll);
var data_resize = Utilities.GetOrAddComponent<ResizeListener>(dataView);
data_resize.OnResizeNextFrame.AddListener(OnResize);
}
/// <summary>
/// Disable data view.
/// </summary>
/// <param name="dataView">Data view.</param>
protected virtual void DisableDataView(ScrollRect dataView)
{
if (dataView == null)
{
return;
}
var data_drag = dataView.GetComponent<DragListener>();
if (data_drag != null)
{
data_drag.OnInitializePotentialDragEvent.RemoveListener(OnDataDragInit);
data_drag.OnDragStartEvent.RemoveListener(OnDataDragBegin);
data_drag.OnDragEvent.RemoveListener(OnDataDrag);
data_drag.OnDragEndEvent.RemoveListener(OnDataDragEnd);
data_drag.OnScrollEvent.RemoveListener(OnDataScroll);
}
var data_resize = dataView.GetComponent<ResizeListener>();
if (data_resize != null)
{
data_resize.OnResizeNextFrame.RemoveListener(OnResize);
}
}
/// <summary>
/// Enable tracks view.
/// </summary>
/// <param name="tracksView">Tracks view.</param>
protected virtual void EnableTracksView(ScrollRect tracksView)
{
if (tracksView == null)
{
return;
}
tracksView.content.pivot = new Vector2(0.5f, 1f);
tracksView.inertia = false;
tracksView.horizontal = true;
tracksView.vertical = true;
var tracks_drag = Utilities.GetOrAddComponent<DragListener>(tracksView);
tracks_drag.OnInitializePotentialDragEvent.AddListener(OnTracksDragInit);
tracks_drag.OnDragStartEvent.AddListener(OnTracksDragBegin);
tracks_drag.OnDragEvent.AddListener(OnTracksDrag);
tracks_drag.OnDragEndEvent.AddListener(OnTracksDragEnd);
tracks_drag.OnScrollEvent.AddListener(OnTracksScroll);
}
/// <summary>
/// Disable tracks view.
/// </summary>
/// <param name="tracksView">Tracks view.</param>
protected virtual void DisableTracksView(ScrollRect tracksView)
{
if (tracksView == null)
{
return;
}
var tracks_drag = tracksView.GetComponent<DragListener>();
if (tracks_drag != null)
{
tracks_drag.OnInitializePotentialDragEvent.RemoveListener(OnTracksDragInit);
tracks_drag.OnDragStartEvent.RemoveListener(OnTracksDragBegin);
tracks_drag.OnDragEvent.RemoveListener(OnTracksDrag);
tracks_drag.OnDragEndEvent.RemoveListener(OnTracksDragEnd);
tracks_drag.OnScrollEvent.RemoveListener(OnTracksScroll);
}
}
/// <summary>
/// Enable points view.
/// </summary>
/// <param name="pointsView">Points view.</param>
protected virtual void EnablePointsView(ScrollBlockBase pointsView)
{
if (pointsView == null)
{
return;
}
pointsView.AlwaysCenter = false;
pointsView.Increase = Increase;
pointsView.Decrease = Decrease;
pointsView.Value = Value2Text;
pointsView.UpdateView();
DataHeaderSize = pointsView.DefaultItemSize;
var points_drag = Utilities.GetOrAddComponent<DragListener>(pointsView);
points_drag.OnInitializePotentialDragEvent.AddListener(OnPointsDragInit);
points_drag.OnDragStartEvent.AddListener(OnPointsDragBegin);
points_drag.OnDragEvent.AddListener(OnPointsDrag);
points_drag.OnDragEndEvent.AddListener(OnPointsDragEnd);
points_drag.OnScrollEvent.AddListener(OnPointsScroll);
}
/// <summary>
/// Disable points view.
/// </summary>
/// <param name="pointsView">Points view.</param>
protected virtual void DisablePointsView(ScrollBlockBase pointsView)
{
if (pointsView == null)
{
return;
}
pointsView.Increase = ScrollBlockBase.DoNothing;
pointsView.Decrease = ScrollBlockBase.DoNothing;
pointsView.Value = ScrollBlockBase.DefaultValue;
var points_drag = pointsView.GetComponent<DragListener>();
if (points_drag != null)
{
points_drag.OnInitializePotentialDragEvent.RemoveListener(OnPointsDragInit);
points_drag.OnDragStartEvent.RemoveListener(OnPointsDragBegin);
points_drag.OnDragEvent.RemoveListener(OnPointsDrag);
points_drag.OnDragEndEvent.RemoveListener(OnPointsDragEnd);
points_drag.OnScrollEvent.RemoveListener(OnPointsScroll);
}
}
#region drag events
/// <summary>
/// Process DataView drag init event.
/// </summary>
/// <param name="eventData">Event data.</param>
protected void OnDataDragInit(PointerEventData eventData)
{
TracksNamesView.OnInitializePotentialDrag(eventData);
PointsNamesView.OnInitializePotentialDrag(eventData);
}
/// <summary>
/// Process DataView drag begin event.
/// </summary>
/// <param name="eventData">Event data.</param>
protected void OnDataDragBegin(PointerEventData eventData)
{
TracksNamesView.OnBeginDrag(eventData);
PointsNamesView.OnBeginDrag(eventData);
}
/// <summary>
/// Process DataView drag event.
/// </summary>
/// <param name="eventData">Event data.</param>
protected void OnDataDrag(PointerEventData eventData)
{
TracksNamesView.OnDrag(eventData);
PointsNamesView.OnDrag(eventData);
UpdateViewScroll();
}
/// <summary>
/// Process DataView drag end event.
/// </summary>
/// <param name="eventData">Event data.</param>
protected void OnDataDragEnd(PointerEventData eventData)
{
TracksNamesView.OnEndDrag(eventData);
PointsNamesView.OnEndDrag(eventData);
}
/// <summary>
/// Process DataView scroll event.
/// </summary>
/// <param name="eventData">Event data.</param>
protected void OnDataScroll(PointerEventData eventData)
{
TracksNamesView.OnScroll(eventData);
PointsNamesView.OnScroll(eventData);
UpdateViewScroll();
}
/// <summary>
/// Process TracksHeadersView drag init event.
/// </summary>
/// <param name="eventData">Event data.</param>
protected void OnTracksDragInit(PointerEventData eventData)
{
TracksDataView.OnInitializePotentialDrag(eventData);
PointsNamesView.OnInitializePotentialDrag(eventData);
}
/// <summary>
/// Process TracksHeadersView drag begin event.
/// </summary>
/// <param name="eventData">Event data.</param>
protected void OnTracksDragBegin(PointerEventData eventData)
{
TracksDataView.OnBeginDrag(eventData);
PointsNamesView.OnBeginDrag(eventData);
}
/// <summary>
/// Process TracksHeadersView drag event.
/// </summary>
/// <param name="eventData">Event data.</param>
protected void OnTracksDrag(PointerEventData eventData)
{
TracksDataView.OnDrag(eventData);
PointsNamesView.OnDrag(eventData);
UpdateViewScroll();
}
/// <summary>
/// Process TracksHeadersView drag end event.
/// </summary>
/// <param name="eventData">Event data.</param>
protected void OnTracksDragEnd(PointerEventData eventData)
{
TracksDataView.OnEndDrag(eventData);
PointsNamesView.OnEndDrag(eventData);
}
/// <summary>
/// Process TracksHeadersView scroll event.
/// </summary>
/// <param name="eventData">Event data.</param>
protected void OnTracksScroll(PointerEventData eventData)
{
TracksDataView.OnScroll(eventData);
PointsNamesView.OnScroll(eventData);
UpdateViewScroll();
}
/// <summary>
/// Process PointsNamesView drag init event.
/// </summary>
/// <param name="eventData">Event data.</param>
protected void OnPointsDragInit(PointerEventData eventData)
{
TracksDataView.OnInitializePotentialDrag(eventData);
TracksNamesView.OnInitializePotentialDrag(eventData);
}
/// <summary>
/// Process PointsNamesView drag begin event.
/// </summary>
/// <param name="eventData">Event data.</param>
protected void OnPointsDragBegin(PointerEventData eventData)
{
TracksDataView.OnBeginDrag(eventData);
TracksNamesView.OnBeginDrag(eventData);
}
/// <summary>
/// Process PointsNamesView drag event.
/// </summary>
/// <param name="eventData">Event data.</param>
protected void OnPointsDrag(PointerEventData eventData)
{
TracksDataView.OnDrag(eventData);
TracksNamesView.OnDrag(eventData);
UpdateViewScroll();
}
/// <summary>
/// Process PointsNamesView drag end event.
/// </summary>
/// <param name="eventData">Event data.</param>
protected void OnPointsDragEnd(PointerEventData eventData)
{
TracksDataView.OnEndDrag(eventData);
TracksNamesView.OnEndDrag(eventData);
}
/// <summary>
/// Process PointsNamesView scroll event.
/// </summary>
/// <param name="eventData">Event data.</param>
protected void OnPointsScroll(PointerEventData eventData)
{
TracksDataView.OnScroll(eventData);
TracksNamesView.OnScroll(eventData);
UpdateViewScroll();
}
#endregion
/// <summary>
/// Open dialog to create track.
/// </summary>
public abstract void OpenCreateTrackDialog();
/// <summary>
/// Open dialog to edit track.
/// </summary>
/// <param name="track">Track.</param>
public abstract void OpenEditTrackDialog(Track<TData, TPoint> track);
/// <summary>
/// Open dialog to create data.
/// </summary>
/// <param name="track">Track to created data.</param>
/// <param name="startPoint">Start point for the data.</param>
public abstract void OpenCreateTrackDataDialog(Track<TData, TPoint> track, TPoint startPoint);
/// <summary>
/// Open dialog to edit data.
/// </summary>
/// <param name="data">Data.</param>
public abstract void OpenEditTrackDataDialog(TData data);
/// <summary>
/// Copy data from source to target.
/// </summary>
/// <param name="source">Source.</param>
/// <param name="target">Target.</param>
public abstract void DataCopy(TData source, TData target);
#region Auto-Scroll
/// <summary>
/// Allow auto-scroll.
/// </summary>
[SerializeField]
[FormerlySerializedAs("AllowAutoDrag")]
public bool AllowAutoScroll = true;
/// <summary>
/// Distance from the border to start auto-scroll.
/// </summary>
[SerializeField]
[EditorConditionBool("AllowAutoScroll")]
[FormerlySerializedAs("AutoDragBorderDistance")]
protected float AutoScrollBorderDistance = 20f;
/// <summary>
/// Auto-scroll speed.
/// </summary>
[SerializeField]
[EditorConditionBool("AllowAutoScroll")]
[FormerlySerializedAs("AutoDragSpeed")]
protected float AutoScrollSpeed = 3f;
/// <summary>
/// Is auto-scroll currently enabled?
/// </summary>
[NonSerialized]
protected bool AutoScrollEnabled;
/// <summary>
/// Auto-scroll direction.
/// </summary>
[NonSerialized]
protected Vector2 AutoScrollDirection;
/// <summary>
/// Action to run when auto-scroll executed.
/// </summary>
[NonSerialized]
protected Action OnAutoScrollAction;
/// <summary>
/// Start auto-scroll.
/// </summary>
/// <param name="eventData">Event data.</param>
/// <param name="action">Action to call during auto-scroll.</param>
public void StartAutoScroll(PointerEventData eventData, Action action)
{
if (!AllowAutoScroll)
{
return;
}
Vector2 point;
var target = TracksDataView.transform as RectTransform;
RectTransformUtility.ScreenPointToLocalPointInRectangle(target, eventData.position, eventData.pressEventCamera, out point);
var pivot = target.pivot;
var size = target.rect.size;
point.x += size.x * pivot.x;
point.y -= size.y * (1f - pivot.y);
point.y = Mathf.Abs(point.y);
var allow = false;
AutoScrollDirection = Vector2.zero;
if (point.x < AutoScrollBorderDistance)
{
allow = true;
AutoScrollDirection.x = +1f;
}
else if (point.x > (size.x - AutoScrollBorderDistance))
{
allow = true;
AutoScrollDirection.x = -1f;
}
if (point.y < AutoScrollBorderDistance)
{
allow = true;
AutoScrollDirection.y = -1f;
}
else if (point.y > (size.y - AutoScrollBorderDistance))
{
allow = true;
AutoScrollDirection.y = +1f;
}
if (allow)
{
AutoScrollEnabled = true;
OnAutoScrollAction = action;
}
else
{
StopAutoScroll();
}
}
/// <summary>
/// Stop auto-scroll.
/// </summary>
public void StopAutoScroll()
{
if (AutoScrollEnabled)
{
AutoScrollEnabled = false;
}
}
/// <summary>
/// Auto-scroll.
/// </summary>
protected void AutoScroll()
{
var scroll_y = AutoScrollDirection.y * AutoScrollSpeed;
PointsNamesView.Padding += AutoScrollDirection.x * AutoScrollSpeed;
var scroll_height = (TracksDataView.transform as RectTransform).rect.height;
var data_pos = TracksDataView.content.anchoredPosition;
data_pos.y = Mathf.Clamp(data_pos.y + scroll_y, 0f, TracksDataView.content.rect.height - scroll_height);
TracksDataView.content.anchoredPosition = data_pos;
var names_pos = TracksNamesView.content.anchoredPosition;
names_pos.y = Mathf.Clamp(names_pos.y + scroll_y, 0f, TracksNamesView.content.rect.height - scroll_height);
TracksNamesView.content.anchoredPosition = names_pos;
UpdateView();
if (OnAutoScrollAction != null)
{
OnAutoScrollAction();
}
}
/// <summary>
/// Process the enable event.
/// </summary>
protected override void OnEnable()
{
base.OnEnable();
Updater.Add(this);
}
/// <summary>
/// Process the disable event.
/// </summary>
protected override void OnDisable()
{
base.OnDisable();
Updater.Remove(this);
}
/// <summary>
/// Update.
/// </summary>
public virtual void RunUpdate()
{
if (AllowAutoScroll && AutoScrollEnabled && CompatibilityInput.IsPointerOverScreen)
{
AutoScroll();
}
}
#endregion
#region serialization support
/// <summary>
/// Serialized data.
/// </summary>
public class SerializedData
{
/// <summary>
/// Tracks names.
/// </summary>
public List<string> TracksNames;
/// <summary>
/// Tracks data.
/// </summary>
public List<TData[]> TracksData;
/// <summary>
/// Is serialized data valid?
/// </summary>
public bool IsValid
{
get
{
if ((TracksNames == null) || (TracksData == null))
{
return false;
}
return TracksNames.Count == TracksData.Count;
}
}
}
/// <summary>
/// Convert this instance to serialized data.
/// </summary>
/// <returns>Serialized data.</returns>
public SerializedData AsSerialized()
{
var serialized = new SerializedData()
{
TracksNames = new List<string>(Tracks.Count),
TracksData = new List<TData[]>(Tracks.Count),
};
serialized.TracksNames.Capacity = Tracks.Count;
serialized.TracksData.Capacity = Tracks.Count;
for (int i = 0; i < Tracks.Count; i++)
{
serialized.TracksNames.Add(Tracks[i].Name);
serialized.TracksData.Add(Tracks[i].Data.ToArray());
}
return serialized;
}
/// <summary>
/// Restore this instance from serialized data.
/// </summary>
/// <param name="serialized">Serialized data.</param>
public void FromSerialized(SerializedData serialized)
{
if (!serialized.IsValid)
{
Debug.LogWarning("Invalid serialized data.", this);
return;
}
Tracks.BeginUpdate();
Tracks.Clear();
for (int i = 0; i < serialized.TracksNames.Count; i++)
{
var track = new Track<TData, TPoint>()
{
Name = serialized.TracksNames[i],
};
track.Data.AddRange(serialized.TracksData[i]);
Tracks.Add(track);
}
Tracks.EndUpdate();
}
#endregion
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/TracksView/TracksViewBase.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/TracksView/TracksViewBase.cs",
"repo_id": "jynew",
"token_count": 12054
}
| 1,483 |
fileFormatVersion: 2
guid: 53761368c1a3c9e4bb7d14aa8c3cf8a6
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/TreeView/Events/NodeToggleEvent.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/TreeView/Events/NodeToggleEvent.cs.meta",
"repo_id": "jynew",
"token_count": 75
}
| 1,484 |
namespace UIWidgets
{
using System;
/// <summary>
/// Interface for the Updater proxy.
/// Replace Unity Update() with custom one without reflection.
/// </summary>
public interface IUpdaterProxy
{
/// <summary>
/// Add target.
/// </summary>
/// <param name="target">Target.</param>
void Add(IUpdatable target);
/// <summary>
/// Remove target.
/// </summary>
/// <param name="target">Target.</param>
void Remove(IUpdatable target);
/// <summary>
/// Add target to LateUpdate.
/// </summary>
/// <param name="target">Target.</param>
void AddLateUpdate(ILateUpdatable target);
/// <summary>
/// Remove target from LateUpdate.
/// </summary>
/// <param name="target">Target.</param>
void RemoveLateUpdate(ILateUpdatable target);
/// <summary>
/// Add target to LateUpdate.
/// </summary>
/// <param name="target">Target.</param>
[Obsolete("Renamed to AddLateUpdate().")]
void LateUpdateAdd(ILateUpdatable target);
/// <summary>
/// Remove target from LateUpdate.
/// </summary>
/// <param name="target">Target.</param>
[Obsolete("Renamed to RemoveLateUpdate().")]
void LateUpdateRemove(ILateUpdatable target);
/// <summary>
/// Add target to FixedUpdate.
/// </summary>
/// <param name="target">Target.</param>
void AddFixedUpdate(IFixedUpdatable target);
/// <summary>
/// Remove target from FixedUpdate.
/// </summary>
/// <param name="target">Target.</param>
void RemoveFixedUpdate(IFixedUpdatable target);
/// <summary>
/// Add target to run update only once.
/// </summary>
/// <param name="target">Target.</param>
void RunOnce(IUpdatable target);
/// <summary>
/// Add action to run only once.
/// </summary>
/// <param name="action">Action.</param>
void RunOnce(Action action);
/// <summary>
/// Remove target from run update only once.
/// </summary>
/// <param name="target">Target.</param>
void RemoveRunOnce(IUpdatable target);
/// <summary>
/// Remove action from run only once.
/// </summary>
/// <param name="action">Action.</param>
void RemoveRunOnce(Action action);
/// <summary>
/// Add target to run update only once at next frame.
/// </summary>
/// <param name="target">Target.</param>
void RunOnceNextFrame(IUpdatable target);
/// <summary>
/// Add action to run only once at next frame.
/// </summary>
/// <param name="action">Action.</param>
void RunOnceNextFrame(Action action);
/// <summary>
/// Remove target from run update only once at next frame.
/// </summary>
/// <param name="target">Target.</param>
void RemoveRunOnceNextFrame(IUpdatable target);
/// <summary>
/// Remove action from run only once at next frame.
/// </summary>
/// <param name="action">Action.</param>
void RemoveRunOnceNextFrame(Action action);
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Updater/IUpdaterProxy.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Updater/IUpdaterProxy.cs",
"repo_id": "jynew",
"token_count": 945
}
| 1,485 |
fileFormatVersion: 2
guid: bea0d237c1bd7994a8a3fdf382385f46
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Utilities/Compatibility.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Utilities/Compatibility.cs.meta",
"repo_id": "jynew",
"token_count": 72
}
| 1,486 |
namespace UIWidgets.Extensions
{
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Reflection;
using System.Text;
/// <summary>
/// For each extensions.
/// </summary>
public static class Extensions
{
/// <summary>
/// For each with index.
/// </summary>
/// <param name="enumerable">Enumerable.</param>
/// <param name="handler">Handler.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "HAA0401:Possible allocation of reference type enumerator", Justification = "Required.")]
public static void ForEach<T>(this IEnumerable<T> enumerable, Action<T, int> handler)
{
int i = 0;
foreach (T item in enumerable)
{
handler(item, i);
i++;
}
}
/// <summary>
/// For each with index.
/// </summary>
/// <param name="enumerable">Enumerable.</param>
/// <param name="handler">Handler.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
public static void ForEach<T>(this T[] enumerable, Action<T, int> handler)
{
int i = 0;
foreach (T item in enumerable)
{
handler(item, i);
i++;
}
}
/// <summary>
/// For each with index.
/// </summary>
/// <param name="enumerable">Enumerable.</param>
/// <param name="handler">Handler.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
public static void ForEach<T>(this List<T> enumerable, Action<T, int> handler)
{
int i = 0;
foreach (T item in enumerable)
{
handler(item, i);
i++;
}
}
/// <summary>
/// For each with index.
/// </summary>
/// <param name="enumerable">Enumerable.</param>
/// <param name="handler">Handler.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
public static void ForEach<T>(this ObservableList<T> enumerable, Action<T, int> handler)
{
int i = 0;
foreach (T item in enumerable)
{
handler(item, i);
i++;
}
}
/// <summary>
/// For each.
/// </summary>
/// <param name="enumerable">Enumerable.</param>
/// <param name="handler">Handler.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "HAA0401:Possible allocation of reference type enumerator", Justification = "Required.")]
public static void ForEach<T>(this IEnumerable<T> enumerable, Action<T> handler)
{
foreach (T item in enumerable)
{
handler(item);
}
}
/// <summary>
/// For each.
/// </summary>
/// <param name="enumerable">Enumerable.</param>
/// <param name="handler">Handler.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
public static void ForEach<T>(this T[] enumerable, Action<T> handler)
{
foreach (T item in enumerable)
{
handler(item);
}
}
/// <summary>
/// For each.
/// </summary>
/// <param name="enumerable">Enumerable.</param>
/// <param name="handler">Handler.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
public static void ForEach<T>(this List<T> enumerable, Action<T> handler)
{
foreach (T item in enumerable)
{
handler(item);
}
}
/// <summary>
/// For each.
/// </summary>
/// <param name="enumerable">Enumerable.</param>
/// <param name="handler">Handler.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
public static void ForEach<T>(this ObservableList<T> enumerable, Action<T> handler)
{
foreach (T item in enumerable)
{
handler(item);
}
}
/// <summary>
/// Convert IEnumerable{T} to ObservableList{T}.
/// </summary>
/// <returns>The observable list.</returns>
/// <param name="enumerable">Enumerable.</param>
/// <param name="observeItems">Is need to observe items?</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
public static ObservableList<T> ToObservableList<T>(this IEnumerable<T> enumerable, bool observeItems = true)
{
return new ObservableList<T>(enumerable, observeItems);
}
/// <summary>
/// Convert IEnumerable{T} to ObservableList{T}.
/// </summary>
/// <returns>The observable list.</returns>
/// <param name="enumerable">Enumerable.</param>
/// <param name="observeItems">Is need to observe items?</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
public static ObservableList<T> ToObservableList<T>(this T[] enumerable, bool observeItems = true)
{
return new ObservableList<T>(enumerable, observeItems);
}
/// <summary>
/// Convert IEnumerable{T} to ObservableList{T}.
/// </summary>
/// <returns>The observable list.</returns>
/// <param name="enumerable">Enumerable.</param>
/// <param name="observeItems">Is need to observe items?</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
public static ObservableList<T> ToObservableList<T>(this List<T> enumerable, bool observeItems = true)
{
return new ObservableList<T>(enumerable, observeItems);
}
/// <summary>
/// Convert IEnumerable{T} to ObservableList{T}.
/// </summary>
/// <returns>The observable list.</returns>
/// <param name="enumerable">Enumerable.</param>
/// <param name="observeItems">Is need to observe items?</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
public static ObservableList<T> ToObservableList<T>(this ObservableList<T> enumerable, bool observeItems = true)
{
return new ObservableList<T>(enumerable, observeItems);
}
/// <summary>
/// Sums the float.
/// </summary>
/// <returns>The float.</returns>
/// <param name="list">List.</param>
[Obsolete("Will be removed in next releases.")]
public static float SumFloat(this IList<float> list)
{
var result = 0f;
for (int i = 0; i < list.Count; i++)
{
result += list[i];
}
return result;
}
/// <summary>
/// Sums the float.
/// </summary>
/// <returns>The float.</returns>
/// <param name="list">List.</param>
/// <param name="calculate">Calculate.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
[Obsolete("Will be removed in next releases.")]
public static float SumFloat<T>(this IList<T> list, Func<T, float> calculate)
{
var result = 0f;
for (int i = 0; i < list.Count; i++)
{
result += calculate(list[i]);
}
return result;
}
/// <summary>
/// Convert the specified list with converter.
/// </summary>
/// <param name="input">Input.</param>
/// <param name="converter">Converter.</param>
/// <typeparam name="TInput">The 1st type parameter.</typeparam>
/// <typeparam name="TOutput">The 2nd type parameter.</typeparam>
/// <returns>List with converted items.</returns>
public static List<TOutput> Convert<TInput, TOutput>(this List<TInput> input, Converter<TInput, TOutput> converter)
{
#if NETFX_CORE
var output = new List<TOutput>(input.Count);
foreach (var item in input)
{
output.Add(converter(item));
}
return output;
#else
return input.ConvertAll<TOutput>(converter);
#endif
}
/// <summary>
/// Gets all sub nodes.
/// </summary>
/// <returns>The all sub nodes.</returns>
/// <param name="nodes">Nodes.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
public static List<TreeNode<T>> GetAllSubNodes<T>(this ObservableList<TreeNode<T>> nodes)
{
var all_subnodes = new List<TreeNode<T>>();
foreach (var node in nodes)
{
GetSubNodes(node.Nodes, all_subnodes);
}
return all_subnodes;
}
/// <summary>
/// Gets the sub nodes from specified nodes list.
/// </summary>
/// <param name="nodes">Nodes.</param>
/// <param name="subnodes">Sub nodes.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
public static void GetSubNodes<T>(ObservableList<TreeNode<T>> nodes, List<TreeNode<T>> subnodes)
{
if (nodes == null)
{
return;
}
foreach (var subnode in nodes)
{
subnodes.Add(subnode);
GetSubNodes(subnode.Nodes, subnodes);
}
}
/// <summary>
/// Convert list to the string.
/// </summary>
/// <returns>The string.</returns>
/// <param name="list">List.</param>
/// <param name="format">Format.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
public static string ToString<T>(this IList<T> list, string format)
where T : IFormattable
{
return list.ToString(format, CultureInfo.CurrentCulture);
}
/// <summary>
/// Convert list to the string.
/// </summary>
/// <returns>The string.</returns>
/// <param name="list">List.</param>
/// <param name="format">Format.</param>
/// <param name="formatProvider">Format provider.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
public static string ToString<T>(this IList<T> list, string format, IFormatProvider formatProvider)
where T : IFormattable
{
if (list.Count == 0)
{
return string.Empty;
}
var result = new StringBuilder(list.Count);
for (int i = 0; i < list.Count; i++)
{
result.Append(string.Format(format, list[i].ToString(), formatProvider));
}
return result.ToString();
}
/// <summary>
/// Convert list to the string.
/// </summary>
/// <returns>The string.</returns>
/// <param name="list">List.</param>
/// <param name="format">Format.</param>
/// <param name="arg1">Argument 1 object.</param>
/// <param name="formatProvider">Format provider.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "HAA0601:Value type to reference type conversion causing boxing allocation", Justification = "Required.")]
public static string ToString<T>(this IList<T> list, string format, object arg1, IFormatProvider formatProvider)
where T : IFormattable
{
if (list.Count == 0)
{
return string.Empty;
}
var result = new StringBuilder(list.Count);
for (int i = 0; i < list.Count; i++)
{
result.Append(string.Format(format, list[i], arg1, formatProvider));
}
return result.ToString();
}
/// <summary>
/// Remove and return the item in the end of the list.
/// </summary>
/// <typeparam name="T">Type of the item.</typeparam>
/// <param name="list">List.</param>
/// <returns>Last item.</returns>
public static T Pop<T>(this IList<T> list)
{
var n = list.Count - 1;
var result = list[n];
list.RemoveAt(n);
return result;
}
#if NETFX_CORE
/// <summary>
/// Determines if is assignable from the specified source from.
/// </summary>
/// <returns><c>true</c> if is assignable from the specified source from; otherwise, <c>false</c>.</returns>
/// <param name="source">Source.</param>
/// <param name="from">From.</param>
static public bool IsAssignableFrom(this Type source, Type from)
{
return source.GetTypeInfo().IsAssignableFrom(from.GetTypeInfo());
}
/// <summary>
/// Apply action for each item in list.
/// </summary>
/// <param name="list">List.</param>
/// <param name="action">Action.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
static public void ForEach<T>(this List<T> list, Action<T> action)
{
for (int i = 0; i < list.Count; i++)
{
action(list[i]);
}
}
#endif
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Utilities/Extensions.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Utilities/Extensions.cs",
"repo_id": "jynew",
"token_count": 4199
}
| 1,487 |
namespace UIWidgets
{
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
/// <summary>
/// Resize listener.
/// </summary>
public class ResizeListener : UIBehaviour, IUpdatable
{
RectTransform rectTransform;
/// <summary>
/// Gets the RectTransform.
/// </summary>
/// <value>The RectTransform.</value>
public RectTransform RectTransform
{
get
{
if (rectTransform == null)
{
rectTransform = transform as RectTransform;
}
return rectTransform;
}
}
/// <summary>
/// The OnResize event.
/// </summary>
public UnityEvent OnResize = new UnityEvent();
/// <summary>
/// The OnResize event raised at next frame.
/// </summary>
public UnityEvent OnResizeNextFrame = new UnityEvent();
Rect oldRect;
bool raiseNextFrame;
/// <summary>
/// Handle RectTransform dimensions change event.
/// </summary>
protected override void OnRectTransformDimensionsChange()
{
if (!IsActive())
{
return;
}
var newRect = RectTransform.rect;
if (oldRect.Equals(newRect))
{
return;
}
oldRect = newRect;
OnResize.Invoke();
if (!raiseNextFrame)
{
raiseNextFrame = true;
Updater.RunOnceNextFrame(this);
}
}
/// <summary>
/// Process destroy event.
/// </summary>
protected override void OnDestroy()
{
base.OnDestroy();
Updater.RemoveRunOnceNextFrame(this);
}
/// <summary>
/// Process enable event.
/// </summary>
protected override void OnEnable()
{
OnRectTransformDimensionsChange();
}
/// <summary>
/// Run update.
/// </summary>
public virtual void RunUpdate()
{
OnResizeNextFrame.Invoke();
raiseNextFrame = false;
}
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Utilities/ResizeListener.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Utilities/ResizeListener.cs",
"repo_id": "jynew",
"token_count": 657
}
| 1,488 |
namespace UIWidgets
{
using System.Globalization;
using UnityEngine;
/// <summary>
/// Color functions.
/// </summary>
public static class UtilitiesColor
{
/// <summary>
/// Convert specified color to RGB hex.
/// </summary>
/// <returns>RGB hex.</returns>
/// <param name="c">Color.</param>
public static string RGB2Hex(Color32 c)
{
return string.Format("#{0}", ColorUtility.ToHtmlStringRGB(c));
}
/// <summary>
/// Convert specified color to RGBA hex.
/// </summary>
/// <returns>RGBA hex.</returns>
/// <param name="c">Color.</param>
public static string RGBA2Hex(Color32 c)
{
return string.Format("#{0}", ColorUtility.ToHtmlStringRGBA(c));
}
/// <summary>
/// Converts the string representation of a number to its Byte equivalent. A return value indicates whether the conversion succeeded or failed.
/// </summary>
/// <returns><c>true</c> if hex was converted successfully; otherwise, <c>false</c>.</returns>
/// <param name="hex">A string containing a number to convert.</param>
/// <param name="result">When this method returns, contains the 8-bit unsigned integer value equivalent to the number contained in s if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or String.Empty, is not of the correct format, or represents a number less than MinValue or greater than MaxValue. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.</param>
public static bool TryParseHex(string hex, out byte result)
{
return byte.TryParse(hex, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out result);
}
static char[] HexTrimChars = new char[] { '#', ';' };
/// <summary>
/// Converts the string representation of a color to its Color equivalent. A return value indicates whether the conversion succeeded or failed.
/// </summary>
/// <returns><c>true</c> if hex was converted successfully; otherwise, <c>false</c>.</returns>
/// <param name="hex">A string containing a color to convert.</param>
/// <param name="result">When this method returns, contains the color value equivalent to the color contained in hex if the conversion succeeded, or Color.black if the conversion failed. The conversion fails if the hex parameter is null or String.Empty, is not of the correct format. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.</param>
[System.Obsolete("Use ColorUtility.TryParseHtmlString")]
public static bool TryHexToRGBA(string hex, out Color32 result)
{
result = Color.black;
if (string.IsNullOrEmpty(hex))
{
return false;
}
var h = hex.Trim(HexTrimChars);
byte r, g, b, a;
if (h.Length == 8)
{
if (!TryParseHex(h.Substring(0, 2), out r))
{
return false;
}
if (!TryParseHex(h.Substring(2, 2), out g))
{
return false;
}
if (!TryParseHex(h.Substring(4, 2), out b))
{
return false;
}
if (!TryParseHex(h.Substring(6, 2), out a))
{
return false;
}
}
else if (h.Length == 6)
{
if (!TryParseHex(h.Substring(0, 2), out r))
{
return false;
}
if (!TryParseHex(h.Substring(2, 2), out g))
{
return false;
}
if (!TryParseHex(h.Substring(4, 2), out b))
{
return false;
}
a = 255;
}
else if (h.Length == 3)
{
if (!TryParseHex(h.Substring(0, 1), out r))
{
return false;
}
if (!TryParseHex(h.Substring(1, 1), out g))
{
return false;
}
if (!TryParseHex(h.Substring(2, 1), out b))
{
return false;
}
r *= 17;
g *= 17;
b *= 17;
a = 255;
}
else
{
return false;
}
result = new Color32(r, g, b, a);
return true;
}
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Utilities/UtilitiesColor.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/Utilities/UtilitiesColor.cs",
"repo_id": "jynew",
"token_count": 1467
}
| 1,489 |
fileFormatVersion: 2
guid: 5fb3b0cf18b8ea144972339274183be8
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/WidgetGeneration/AutocompleteGeneratorHelper.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/WidgetGeneration/AutocompleteGeneratorHelper.cs.meta",
"repo_id": "jynew",
"token_count": 69
}
| 1,490 |
namespace UIWidgets.WidgetGeneration
{
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// TreeView generator helper.
/// </summary>
public class TreeViewGeneratorHelper : ListViewGeneratorHelper
{
/// <summary>
/// Viewport.
/// </summary>
public LayoutElement Indentation;
/// <summary>
/// Toggle.
/// </summary>
public TreeNodeToggle Toggle;
}
}
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/WidgetGeneration/TreeViewGeneratorHelper.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Scripts/WidgetGeneration/TreeViewGeneratorHelper.cs",
"repo_id": "jynew",
"token_count": 133
}
| 1,491 |
fileFormatVersion: 2
guid: 924310371a4ad61468c5bd37d72c42e2
ShaderImporter:
defaultTextures: []
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Shaders/UIGradientShaderPlaneHSV.shader.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Shaders/UIGradientShaderPlaneHSV.shader.meta",
"repo_id": "jynew",
"token_count": 47
}
| 1,492 |
fileFormatVersion: 2
guid: efc30ba907af3c74a83101592d38f3f0
folderAsset: yes
DefaultImporter:
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Styles/BlueStyle.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Styles/BlueStyle.meta",
"repo_id": "jynew",
"token_count": 47
}
| 1,493 |
fileFormatVersion: 2
guid: 329a51b283b91654fbb8ee16756b4438
labels:
- UiwidgetsStyleBlueAsset
NativeFormatImporter:
userData:
|
jynew/jyx2/Assets/Plugins/New UI Widgets/Styles/UIWidgets Style Blue.asset.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/New UI Widgets/Styles/UIWidgets Style Blue.asset.meta",
"repo_id": "jynew",
"token_count": 52
}
| 1,494 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &100000
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400000}
- 114: {fileID: 11400000}
m_Layer: 0
m_Name: DebugInformation
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &400000
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1559198062, guid: 09c9b883b79ef864a99683bb36c5776d, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 100000}
m_IsPrefabParent: 1
m_IsExploded: 1
|
jynew/jyx2/Assets/Plugins/Rewired/DevTools/DebugInformation.prefab/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/DevTools/DebugInformation.prefab",
"repo_id": "jynew",
"token_count": 591
}
| 1,495 |
fileFormatVersion: 2
guid: 08b543946cb9c8d47bca2202aa8b018d
labels:
- Input
- Joysticks
- Controllers
- Rewired
- Hotplugging
- Keyboard
- Mouse
- Touch
- InputManager
- Control
- Gamepad
- Controller
- Joystick
- Xbox360
- XInput
- DirectInput
TextScriptImporter:
userData:
|
jynew/jyx2/Assets/Plugins/Rewired/Documentation/licences.txt.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/Documentation/licences.txt.meta",
"repo_id": "jynew",
"token_count": 105
}
| 1,496 |
// Copyright (c) 2016 Augie R. Maddox, Guavaman Enterprises. All rights reserved.
// Based on Unity StandaloneInputModule.cs
// https://bitbucket.org/Unity-Technologies/ui/src
#region Defines
#if UNITY_2020 || UNITY_2021 || UNITY_2022 || UNITY_2023 || UNITY_2024 || UNITY_2025
#define UNITY_2020_PLUS
#endif
#if UNITY_2019 || UNITY_2020_PLUS
#define UNITY_2019_PLUS
#endif
#if UNITY_2018 || UNITY_2019_PLUS
#define UNITY_2018_PLUS
#endif
#if UNITY_2017 || UNITY_2018_PLUS
#define UNITY_2017_PLUS
#endif
#if UNITY_5 || UNITY_2017_PLUS
#define UNITY_5_PLUS
#endif
#if UNITY_5_1 || UNITY_5_2 || UNITY_5_3_OR_NEWER || UNITY_2017_PLUS
#define UNITY_5_1_PLUS
#endif
#if UNITY_5_2 || UNITY_5_3_OR_NEWER || UNITY_2017_PLUS
#define UNITY_5_2_PLUS
#endif
#if UNITY_5_3_OR_NEWER || UNITY_2017_PLUS
#define UNITY_5_3_PLUS
#endif
#if UNITY_5_4_OR_NEWER || UNITY_2017_PLUS
#define UNITY_5_4_PLUS
#endif
#if UNITY_5_5_OR_NEWER || UNITY_2017_PLUS
#define UNITY_5_5_PLUS
#endif
#if UNITY_5_6_OR_NEWER || UNITY_2017_PLUS
#define UNITY_5_6_PLUS
#endif
#if UNITY_5_7_OR_NEWER || UNITY_2017_PLUS
#define UNITY_5_7_PLUS
#endif
#if UNITY_5_8_OR_NEWER || UNITY_2017_PLUS
#define UNITY_5_8_PLUS
#endif
#if UNITY_5_9_OR_NEWER || UNITY_2017_PLUS
#define UNITY_5_9_PLUS
#endif
#pragma warning disable 0219
#pragma warning disable 0618
#pragma warning disable 0649
#endregion
namespace Rewired.Integration.UnityUI {
using System;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Serialization;
using System.Collections.Generic;
using Rewired.UI;
[AddComponentMenu("Rewired/Rewired Standalone Input Module")]
public sealed class RewiredStandaloneInputModule : RewiredPointerInputModule {
#region Rewired Constants
private const string DEFAULT_ACTION_MOVE_HORIZONTAL = "UIHorizontal";
private const string DEFAULT_ACTION_MOVE_VERTICAL = "UIVertical";
private const string DEFAULT_ACTION_SUBMIT = "UISubmit";
private const string DEFAULT_ACTION_CANCEL = "UICancel";
#endregion
#region Rewired Inspector Variables
[Tooltip("(Optional) Link the Rewired Input Manager here for easier access to Player ids, etc.")]
[SerializeField]
private InputManager_Base rewiredInputManager;
/// <summary>
/// Allow all Rewired game Players to control the UI. This does not include the System Player. If enabled, this setting overrides individual Player Ids set in Rewired Player Ids.
/// </summary>
[SerializeField]
[Tooltip("Use all Rewired game Players to control the UI. This does not include the System Player. If enabled, this setting overrides individual Player Ids set in Rewired Player Ids.")]
private bool useAllRewiredGamePlayers = false;
/// <summary>
/// Allow the Rewired System Player to control the UI.
/// </summary>
[SerializeField]
[Tooltip("Allow the Rewired System Player to control the UI.")]
private bool useRewiredSystemPlayer = false;
/// <summary>
/// A list of Player Ids that are allowed to control the UI. If Use All Rewired Game Players = True, this list will be ignored.
/// </summary>
[SerializeField]
[Tooltip("A list of Player Ids that are allowed to control the UI. If Use All Rewired Game Players = True, this list will be ignored.")]
private int[] rewiredPlayerIds = new int[1] { 0 };
/// <summary>
/// Allow only Players with Player.isPlaying = true to control the UI.
/// </summary>
[SerializeField]
[Tooltip("Allow only Players with Player.isPlaying = true to control the UI.")]
private bool usePlayingPlayersOnly = false;
/// <summary>
/// Player Mice allowed to interact with the UI.
/// </summary>
[SerializeField]
[Tooltip("Player Mice allowed to interact with the UI. Each Player that owns a Player Mouse must also be allowed to control the UI or the Player Mouse will not function.")]
private List<Rewired.Components.PlayerMouse> playerMice = new List<Rewired.Components.PlayerMouse>();
/// <summary>
/// Makes an axis press always move only one UI selection. Enable if you do not want to allow scrolling through UI elements by holding an axis direction.
/// </summary>
[SerializeField]
[Tooltip("Makes an axis press always move only one UI selection. Enable if you do not want to allow scrolling through UI elements by holding an axis direction.")]
private bool moveOneElementPerAxisPress;
/// <summary>
/// If enabled, Action Ids will be used to set the Actions. If disabled, string names will be used to set the Actions.
/// </summary>
[SerializeField]
[Tooltip("If enabled, Action Ids will be used to set the Actions. If disabled, string names will be used to set the Actions.")]
private bool setActionsById = false;
/// <summary>
/// Name of the horizontal axis for movement (if axis events are used).
/// </summary>
[SerializeField]
[Tooltip("Id of the horizontal Action for movement (if axis events are used).")]
private int horizontalActionId = -1;
/// <summary>
/// Name of the vertical axis for movement (if axis events are used).
/// </summary>
[SerializeField]
[Tooltip("Id of the vertical Action for movement (if axis events are used).")]
private int verticalActionId = -1;
/// <summary>
/// Name of the action used to submit.
/// </summary>
[SerializeField]
[Tooltip("Id of the Action used to submit.")]
private int submitActionId = -1;
/// <summary>
/// Name of the action used to cancel.
/// </summary>
[SerializeField]
[Tooltip("Id of the Action used to cancel.")]
private int cancelActionId = -1;
#endregion
#region StandaloneInputModule Inspector Variables
/// <summary>
/// Name of the horizontal axis for movement (if axis events are used).
/// </summary>
[SerializeField]
[Tooltip("Name of the horizontal axis for movement (if axis events are used).")]
private string m_HorizontalAxis = DEFAULT_ACTION_MOVE_HORIZONTAL;
/// <summary>
/// Name of the vertical axis for movement (if axis events are used).
/// </summary>
[SerializeField]
[Tooltip("Name of the vertical axis for movement (if axis events are used).")]
private string m_VerticalAxis = DEFAULT_ACTION_MOVE_VERTICAL;
/// <summary>
/// Name of the action used to submit.
/// </summary>
[SerializeField]
[Tooltip("Name of the action used to submit.")]
private string m_SubmitButton = DEFAULT_ACTION_SUBMIT;
/// <summary>
/// Name of the action used to cancel.
/// </summary>
[SerializeField]
[Tooltip("Name of the action used to cancel.")]
private string m_CancelButton = DEFAULT_ACTION_CANCEL;
/// <summary>
/// Number of selection changes allowed per second when a movement button/axis is held in a direction.
/// </summary>
[SerializeField]
[Tooltip("Number of selection changes allowed per second when a movement button/axis is held in a direction.")]
private float m_InputActionsPerSecond = 10;
/// <summary>
/// Delay in seconds before vertical/horizontal movement starts repeating continouously when a movement direction is held.
/// </summary>
[SerializeField]
[Tooltip("Delay in seconds before vertical/horizontal movement starts repeating continouously when a movement direction is held.")]
private float m_RepeatDelay = 0.0f;
/// <summary>
/// Allows the mouse to be used to select elements.
/// </summary>
[SerializeField]
[Tooltip("Allows the mouse to be used to select elements.")]
private bool m_allowMouseInput = true;
/// <summary>
/// Allows the mouse to be used to select elements if the device also supports touch control.
/// </summary>
[SerializeField]
[Tooltip("Allows the mouse to be used to select elements if the device also supports touch control.")]
private bool m_allowMouseInputIfTouchSupported = true;
/// <summary>
/// Allows touch input to be used to select elements.
/// </summary>
[SerializeField]
[Tooltip("Allows touch input to be used to select elements.")]
private bool m_allowTouchInput = true;
/// <summary>
/// Deselects the current selection on mouse/touch click when the pointer is not over a selectable object.
/// </summary>
[SerializeField]
[Tooltip("Deselects the current selection on mouse/touch click when the pointer is not over a selectable object.")]
private bool m_deselectIfBackgroundClicked = true;
/// <summary>
/// Deselects the current selection on mouse/touch click before selecting the next object.
/// </summary>
[SerializeField]
[Tooltip("Deselects the current selection on mouse/touch click before selecting the next object.")]
private bool m_deselectBeforeSelecting = true;
/// <summary>
/// Forces the module to always be active.
/// </summary>
[SerializeField]
[FormerlySerializedAs("m_AllowActivationOnMobileDevice")]
[Tooltip("Forces the module to always be active.")]
private bool m_ForceModuleActive;
#endregion
#region Rewired Variables and Properties
[NonSerialized]
private int[] playerIds;
private bool recompiling;
[NonSerialized]
private bool isTouchSupported;
/// <summary>
/// (Optional) Link the Rewired Input Manager here for easier access to Player ids, etc.
/// </summary>
public InputManager_Base RewiredInputManager {
get { return rewiredInputManager; }
set { rewiredInputManager = value; }
}
/// <summary>
/// Allow all Rewired game Players to control the UI. This does not include the System Player. If enabled, this setting overrides individual Player Ids set in Rewired Player Ids.
/// </summary>
public bool UseAllRewiredGamePlayers {
get { return useAllRewiredGamePlayers; }
set {
bool changed = value != useAllRewiredGamePlayers;
useAllRewiredGamePlayers = value;
if (changed) SetupRewiredVars();
}
}
/// <summary>
/// Allow the Rewired System Player to control the UI.
/// </summary>
public bool UseRewiredSystemPlayer {
get { return useRewiredSystemPlayer; }
set {
bool changed = value != useRewiredSystemPlayer;
useRewiredSystemPlayer = value;
if (changed) SetupRewiredVars();
}
}
/// <summary>
/// A list of Player Ids that are allowed to control the UI. If Use All Rewired Game Players = True, this list will be ignored.
/// Returns a clone of the array.
/// </summary>
public int[] RewiredPlayerIds {
get { return (int[])rewiredPlayerIds.Clone(); }
set {
rewiredPlayerIds = (value != null ? (int[])value.Clone() : new int[0]);
SetupRewiredVars();
}
}
/// <summary>
/// Allow only Players with Player.isPlaying = true to control the UI.
/// </summary>
public bool UsePlayingPlayersOnly {
get { return usePlayingPlayersOnly; }
set { usePlayingPlayersOnly = value; }
}
/// <summary>
/// Player Mice allowed to interact with the UI.
/// Each Player that owns a Player Mouse must also be allowed to control the UI or the Player Mouse will not function.
/// </summary>
public List<Rewired.Components.PlayerMouse> PlayerMice {
get {
return new List<Rewired.Components.PlayerMouse>(playerMice);
}
set {
if(value == null) {
playerMice = new List<Rewired.Components.PlayerMouse>();
SetupRewiredVars();
return;
}
playerMice = new List<Rewired.Components.PlayerMouse>(value);
SetupRewiredVars();
}
}
/// <summary>
/// Makes an axis press always move only one UI selection. Enable if you do not want to allow scrolling through UI elements by holding an axis direction.
/// </summary>
public bool MoveOneElementPerAxisPress {
get { return moveOneElementPerAxisPress; }
set { moveOneElementPerAxisPress = value; }
}
/// <summary>
/// Allows the mouse to be used to select elements.
/// </summary>
public bool allowMouseInput {
get { return m_allowMouseInput; }
set { m_allowMouseInput = value; }
}
/// <summary>
/// Allows the mouse to be used to select elements if the device also supports touch control.
/// </summary>
public bool allowMouseInputIfTouchSupported {
get { return m_allowMouseInputIfTouchSupported; }
set { m_allowMouseInputIfTouchSupported = value; }
}
/// <summary>
/// Allows touch input to be used to select elements.
/// </summary>
public bool allowTouchInput {
get { return m_allowTouchInput; }
set { m_allowTouchInput = value; }
}
/// <summary>
/// Deselects the current selection on mouse/touch click when the pointer is not over a selectable object.
/// </summary>
public bool deselectIfBackgroundClicked {
get {
return m_deselectIfBackgroundClicked;
}
set {
m_deselectIfBackgroundClicked = value;
}
}
/// <summary>
/// Deselects the current selection on mouse/touch click before selecting the next object.
/// </summary>
private bool deselectBeforeSelecting {
get {
return m_deselectBeforeSelecting;
}
set {
m_deselectBeforeSelecting = value;
}
}
/// <summary>
/// If enabled, Action Ids will be used to set the Actions. If disabled, string names will be used to set the Actions.
/// </summary>
public bool SetActionsById {
get {
return setActionsById;
}
set {
if(setActionsById == value) return;
setActionsById = value;
SetupRewiredVars();
}
}
/// <summary>
/// Name of the horizontal axis for movement (if axis events are used).
/// </summary>
public int HorizontalActionId {
get {
return horizontalActionId;
}
set {
if(value == horizontalActionId) return;
horizontalActionId = value;
if(Rewired.ReInput.isReady) {
m_HorizontalAxis = Rewired.ReInput.mapping.GetAction(value) != null ? Rewired.ReInput.mapping.GetAction(value).name : string.Empty;
}
}
}
/// <summary>
/// Name of the vertical axis for movement (if axis events are used).
/// </summary>
public int VerticalActionId {
get {
return verticalActionId;
}
set {
if(value == verticalActionId) return;
verticalActionId = value;
if(Rewired.ReInput.isReady) {
m_VerticalAxis = Rewired.ReInput.mapping.GetAction(value) != null ? Rewired.ReInput.mapping.GetAction(value).name : string.Empty;
}
}
}
/// <summary>
/// Name of the action used to submit.
/// </summary>
public int SubmitActionId {
get {
return submitActionId;
}
set {
if(value == submitActionId) return;
submitActionId = value;
if(Rewired.ReInput.isReady) {
m_SubmitButton = Rewired.ReInput.mapping.GetAction(value) != null ? Rewired.ReInput.mapping.GetAction(value).name : string.Empty;
}
}
}
/// <summary>
/// Name of the action used to cancel.
/// </summary>
public int CancelActionId {
get {
return cancelActionId;
}
set {
if(value == cancelActionId) return;
cancelActionId = value;
if(Rewired.ReInput.isReady) {
m_CancelButton = Rewired.ReInput.mapping.GetAction(value) != null ? Rewired.ReInput.mapping.GetAction(value).name : string.Empty;
}
}
}
protected override bool isMouseSupported {
get {
if(!base.isMouseSupported) return false;
if (!m_allowMouseInput) return false;
return isTouchSupported ? m_allowMouseInputIfTouchSupported : true;
}
}
private bool isTouchAllowed {
get {
// if (!isTouchSupported) return false; // Removed because Unity Remote will return touches even on platforms that report touch not supported and returning on this will break it.
return m_allowTouchInput;
}
}
#endregion
[NonSerialized]
private double m_PrevActionTime;
[NonSerialized]
Vector2 m_LastMoveVector;
[NonSerialized]
int m_ConsecutiveMoveCount = 0;
[NonSerialized]
private bool m_HasFocus = true;
/// <summary>
/// Allows the module to control UI input on mobile devices..
/// </summary>
[Obsolete("allowActivationOnMobileDevice has been deprecated. Use forceModuleActive instead")]
public bool allowActivationOnMobileDevice {
get { return m_ForceModuleActive; }
set { m_ForceModuleActive = value; }
}
/// <summary>
/// Forces the module to always be active.
/// </summary>
public bool forceModuleActive {
get { return m_ForceModuleActive; }
set { m_ForceModuleActive = value; }
}
// <summary>
/// Number of selection changes allowed per second when a movement button/axis is held in a direction.
/// </summary>
public float inputActionsPerSecond {
get { return m_InputActionsPerSecond; }
set { m_InputActionsPerSecond = value; }
}
/// <summary>
/// Delay in seconds before vertical/horizontal movement starts repeating continouously when a movement direction is held.
/// </summary>
public float repeatDelay {
get { return m_RepeatDelay; }
set { m_RepeatDelay = value; }
}
/// <summary>
/// Name of the horizontal axis for movement (if axis events are used).
/// </summary>
public string horizontalAxis {
get { return m_HorizontalAxis; }
set {
if(m_HorizontalAxis == value) return;
m_HorizontalAxis = value;
if(Rewired.ReInput.isReady) {
horizontalActionId = Rewired.ReInput.mapping.GetActionId(value);
}
}
}
/// <summary>
/// Name of the vertical axis for movement (if axis events are used).
/// </summary>
public string verticalAxis {
get { return m_VerticalAxis; }
set {
if(m_VerticalAxis == value) return;
m_VerticalAxis = value;
if(Rewired.ReInput.isReady) {
verticalActionId = Rewired.ReInput.mapping.GetActionId(value);
}
}
}
/// <summary>
/// Name of the action used to submit.
/// </summary>
public string submitButton {
get { return m_SubmitButton; }
set {
if(m_SubmitButton == value) return;
m_SubmitButton = value;
if(Rewired.ReInput.isReady) {
submitActionId = Rewired.ReInput.mapping.GetActionId(value);
}
}
}
/// <summary>
/// Name of the action used to cancel.
/// </summary>
public string cancelButton {
get { return m_CancelButton; }
set {
if(m_CancelButton == value) return;
m_CancelButton = value;
if(Rewired.ReInput.isReady) {
cancelActionId = Rewired.ReInput.mapping.GetActionId(value);
}
}
}
// Constructor
private RewiredStandaloneInputModule() { }
// Methods
protected override void Awake() {
base.Awake();
// Determine if touch is supported
isTouchSupported = defaultTouchInputSource.touchSupported;
// Deactivate the TouchInputModule because it has been deprecated in 5.3. Functionality was moved into here on all versions.
TouchInputModule tim = GetComponent<TouchInputModule>();
if (tim != null) {
tim.enabled = false;
#if UNITY_EDITOR
Debug.LogWarning("The TouchInputModule is no longer used as the functionality has been moved into the RewiredStandaloneInputModule. Please remove the TouchInputModule component.");
#endif
}
Rewired.ReInput.InitializedEvent += OnRewiredInitialized;
// Initialize Rewired
InitializeRewired();
}
public override void UpdateModule() {
CheckEditorRecompile();
if (recompiling) return;
if (!Rewired.ReInput.isReady) return;
if (!m_HasFocus && ShouldIgnoreEventsOnNoFocus()) return;
}
public override bool IsModuleSupported() {
return true; // there is never any reason this module should not be supported now that TouchInputModule is deprecated, so always return true.
}
public override bool ShouldActivateModule() {
if (!base.ShouldActivateModule()) return false;
if (recompiling) return false;
if (!Rewired.ReInput.isReady) return false;
bool shouldActivate = m_ForceModuleActive;
// Combine input for all players
for (int i = 0; i < playerIds.Length; i++) {
Rewired.Player player = Rewired.ReInput.players.GetPlayer(playerIds[i]);
if (player == null) continue;
if (usePlayingPlayersOnly && !player.isPlaying) continue;
shouldActivate |= GetButtonDown(player, submitActionId);
shouldActivate |= GetButtonDown(player, cancelActionId);
if (moveOneElementPerAxisPress) { // axis press moves only to the next UI element with each press
shouldActivate |= GetButtonDown(player, horizontalActionId) || GetNegativeButtonDown(player, horizontalActionId);
shouldActivate |= GetButtonDown(player, verticalActionId) || GetNegativeButtonDown(player, verticalActionId);
} else { // default behavior - axis press scrolls quickly through UI elements
shouldActivate |= !Mathf.Approximately(GetAxis(player, horizontalActionId), 0.0f);
shouldActivate |= !Mathf.Approximately(GetAxis(player, verticalActionId), 0.0f);
}
}
// Mouse input
if (isMouseSupported) {
shouldActivate |= DidAnyMouseMove();
shouldActivate |= GetMouseButtonDownOnAnyMouse(0);
}
// Touch input
if (isTouchAllowed) {
for(int i = 0; i < defaultTouchInputSource.touchCount; ++i) {
Touch touch = defaultTouchInputSource.GetTouch(i);
shouldActivate |= touch.phase == TouchPhase.Began
|| touch.phase == TouchPhase.Moved
|| touch.phase == TouchPhase.Stationary;
}
}
return shouldActivate;
}
public override void ActivateModule() {
if (!m_HasFocus && ShouldIgnoreEventsOnNoFocus()) return;
base.ActivateModule();
var toSelect = eventSystem.currentSelectedGameObject;
if (toSelect == null)
toSelect = eventSystem.firstSelectedGameObject;
eventSystem.SetSelectedGameObject(toSelect, GetBaseEventData());
}
public override void DeactivateModule() {
base.DeactivateModule();
ClearSelection();
}
public override void Process() {
if (!Rewired.ReInput.isReady) return;
if (!m_HasFocus && ShouldIgnoreEventsOnNoFocus()) return;
if (!enabled || !gameObject.activeInHierarchy) return;
bool usedEvent = SendUpdateEventToSelectedObject();
if (eventSystem.sendNavigationEvents) {
if (!usedEvent)
usedEvent |= SendMoveEventToSelectedObject();
if (!usedEvent)
SendSubmitEventToSelectedObject();
}
// touch needs to take precedence because of the mouse emulation layer
if (!ProcessTouchEvents()) {
if (isMouseSupported) ProcessMouseEvents();
}
}
private bool ProcessTouchEvents() {
if (!isTouchAllowed) return false;
for(int i = 0; i < defaultTouchInputSource.touchCount; ++i) {
Touch touch = defaultTouchInputSource.GetTouch(i);
#if UNITY_5_3_OR_NEWER
if(touch.type == TouchType.Indirect)
continue;
#endif
bool released;
bool pressed;
var pointer = GetTouchPointerEventData(0, 0, touch, out pressed, out released);
ProcessTouchPress(pointer, pressed, released);
if (!released) {
ProcessMove(pointer);
ProcessDrag(pointer);
} else
RemovePointerData(pointer);
}
return defaultTouchInputSource.touchCount > 0;
}
private void ProcessTouchPress(PointerEventData pointerEvent, bool pressed, bool released) {
var currentOverGo = pointerEvent.pointerCurrentRaycast.gameObject;
// PointerDown notification
if (pressed) {
pointerEvent.eligibleForClick = true;
pointerEvent.delta = Vector2.zero;
pointerEvent.dragging = false;
pointerEvent.useDragThreshold = true;
pointerEvent.pressPosition = pointerEvent.position;
pointerEvent.pointerPressRaycast = pointerEvent.pointerCurrentRaycast;
HandleMouseTouchDeselectionOnSelectionChanged(currentOverGo, pointerEvent);
if (pointerEvent.pointerEnter != currentOverGo) {
// send a pointer enter to the touched element if it isn't the one to select...
HandlePointerExitAndEnter(pointerEvent, currentOverGo);
pointerEvent.pointerEnter = currentOverGo;
}
// search for the control that will receive the press
// if we can't find a press handler set the press
// handler to be what would receive a click.
var newPressed = ExecuteEvents.ExecuteHierarchy(currentOverGo, pointerEvent, ExecuteEvents.pointerDownHandler);
// didnt find a press handler... search for a click handler
if (newPressed == null)
newPressed = ExecuteEvents.GetEventHandler<IPointerClickHandler>(currentOverGo);
// Debug.Log("Pressed: " + newPressed);
double time = Rewired.ReInput.time.unscaledTime;
if (newPressed == pointerEvent.lastPress) {
var diffTime = time - pointerEvent.clickTime;
if (diffTime < 0.3f)
++pointerEvent.clickCount;
else
pointerEvent.clickCount = 1;
pointerEvent.clickTime = (float)time;
} else {
pointerEvent.clickCount = 1;
}
pointerEvent.pointerPress = newPressed;
pointerEvent.rawPointerPress = currentOverGo;
pointerEvent.clickTime = (float)time;
// Save the drag handler as well
pointerEvent.pointerDrag = ExecuteEvents.GetEventHandler<IDragHandler>(currentOverGo);
if (pointerEvent.pointerDrag != null)
ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.initializePotentialDrag);
}
// PointerUp notification
if (released) {
// Debug.Log("Executing pressup on: " + pointer.pointerPress);
ExecuteEvents.Execute(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerUpHandler);
// Debug.Log("KeyCode: " + pointer.eventData.keyCode);
// see if we mouse up on the same element that we clicked on...
var pointerUpHandler = ExecuteEvents.GetEventHandler<IPointerClickHandler>(currentOverGo);
// PointerClick and Drop events
if (pointerEvent.pointerPress == pointerUpHandler && pointerEvent.eligibleForClick) {
ExecuteEvents.Execute(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerClickHandler);
} else if (pointerEvent.pointerDrag != null && pointerEvent.dragging) {
ExecuteEvents.ExecuteHierarchy(currentOverGo, pointerEvent, ExecuteEvents.dropHandler);
}
pointerEvent.eligibleForClick = false;
pointerEvent.pointerPress = null;
pointerEvent.rawPointerPress = null;
if (pointerEvent.pointerDrag != null && pointerEvent.dragging)
ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.endDragHandler);
pointerEvent.dragging = false;
pointerEvent.pointerDrag = null;
if (pointerEvent.pointerDrag != null)
ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.endDragHandler);
pointerEvent.pointerDrag = null;
// send exit events as we need to simulate this on touch up on touch device
ExecuteEvents.ExecuteHierarchy(pointerEvent.pointerEnter, pointerEvent, ExecuteEvents.pointerExitHandler);
pointerEvent.pointerEnter = null;
}
}
/// <summary>
/// Process submit keys.
/// </summary>
private bool SendSubmitEventToSelectedObject() {
if (eventSystem.currentSelectedGameObject == null)
return false;
if (recompiling) return false;
var data = GetBaseEventData();
for (int i = 0; i < playerIds.Length; i++) {
Rewired.Player player = Rewired.ReInput.players.GetPlayer(playerIds[i]);
if (player == null) continue;
if (usePlayingPlayersOnly && !player.isPlaying) continue;
if (GetButtonDown(player, submitActionId)) {
ExecuteEvents.Execute(eventSystem.currentSelectedGameObject, data, ExecuteEvents.submitHandler);
break;
}
if (GetButtonDown(player, cancelActionId)) {
ExecuteEvents.Execute(eventSystem.currentSelectedGameObject, data, ExecuteEvents.cancelHandler);
break;
}
}
return data.used;
}
private Vector2 GetRawMoveVector() {
if (recompiling) return Vector2.zero;
Vector2 move = Vector2.zero;
bool horizButton = false;
bool vertButton = false;
// Combine inputs of all Players
for (int i = 0; i < playerIds.Length; i++) {
Rewired.Player player = Rewired.ReInput.players.GetPlayer(playerIds[i]);
if (player == null) continue;
if (usePlayingPlayersOnly && !player.isPlaying) continue;
// Must double check against axis value because "Activate Action Buttons on Negative Value" may be enabled
// and will prevent negative axis values from working because they're cancelled out by positive values.
float horizontal = GetAxis(player, horizontalActionId);
float vertical = GetAxis(player, verticalActionId);
if(Mathf.Approximately(horizontal, 0f)) horizontal = 0f;
if(Mathf.Approximately(vertical, 0f)) vertical = 0f;
if (moveOneElementPerAxisPress) { // axis press moves only to the next UI element with each press
if (GetButtonDown(player, horizontalActionId) && horizontal > 0f) move.x += 1.0f;
if (GetNegativeButtonDown(player, horizontalActionId) && horizontal < 0f) move.x -= 1.0f;
if (GetButtonDown(player, verticalActionId) && vertical > 0f) move.y += 1.0f;
if (GetNegativeButtonDown(player, verticalActionId) && vertical < 0f) move.y -= 1.0f;
} else { // default behavior - axis press scrolls quickly through UI elements
// Use GetButton instead of GetAxis so the Input Behavior's Button Dead Zone is used for each Player
if(GetButton(player, horizontalActionId) && horizontal > 0f) move.x += 1.0f;
if(GetNegativeButton(player, horizontalActionId) && horizontal < 0f) move.x -= 1.0f;
if(GetButton(player, verticalActionId) && vertical > 0f) move.y += 1.0f;
if(GetNegativeButton(player, verticalActionId) && vertical < 0f) move.y -= 1.0f;
}
}
return move;
}
/// <summary>
/// Process keyboard events.
/// </summary>
private bool SendMoveEventToSelectedObject() {
if (recompiling) return false; // never allow movement while recompiling
double time = Rewired.ReInput.time.unscaledTime; // get the current time
// Check for zero movement and clear
Vector2 movement = GetRawMoveVector();
if (Mathf.Approximately(movement.x, 0f) && Mathf.Approximately(movement.y, 0f)) {
m_ConsecutiveMoveCount = 0;
return false;
}
// Check if movement is in the same direction as previously
bool similarDir = (Vector2.Dot(movement, m_LastMoveVector) > 0);
// Check if a button/key/axis was just pressed this frame
bool buttonDownHorizontal, buttonDownVertical;
CheckButtonOrKeyMovement(out buttonDownHorizontal, out buttonDownVertical);
AxisEventData axisEventData = null;
// If user just pressed button/key/axis, always allow movement
bool allow = buttonDownHorizontal || buttonDownVertical;
if (allow) { // we had a button down event
// Get the axis move event now so we can tell the direction it will be moving
axisEventData = GetAxisEventData(movement.x, movement.y, 0f);
// Make sure the button down event was in the direction we would be moving, otherwise don't allow it.
// This filters out double movements when pressing somewhat diagonally and getting down events for both
// horizontal and vertical at the same time but both ending up being resolved in the same direction.
MoveDirection moveDir = axisEventData.moveDir;
allow = ((moveDir == MoveDirection.Up || moveDir == MoveDirection.Down) && buttonDownVertical) ||
((moveDir == MoveDirection.Left || moveDir == MoveDirection.Right) && buttonDownHorizontal);
}
if (!allow) {
// Apply repeat delay and input actions per second limits
if (m_RepeatDelay > 0.0f) { // apply repeat delay
// Otherwise, user held down key or axis.
// If direction didn't change at least 90 degrees, wait for delay before allowing consecutive event.
if (similarDir && m_ConsecutiveMoveCount == 1) { // this is the 2nd tick after the initial that activated the movement in this direction
allow = (time > m_PrevActionTime + m_RepeatDelay);
// If direction changed at least 90 degree, or we already had the delay, repeat at repeat rate.
} else {
allow = (time > m_PrevActionTime + 1f / m_InputActionsPerSecond); // apply input actions per second limit
}
} else { // not using a repeat delay
allow = (time > m_PrevActionTime + 1f / m_InputActionsPerSecond); // apply input actions per second limit
}
}
if (!allow) return false; // movement not allowed, done
// Get the axis move event
if (axisEventData == null) {
axisEventData = GetAxisEventData(movement.x, movement.y, 0f);
}
if (axisEventData.moveDir != MoveDirection.None) {
ExecuteEvents.Execute(eventSystem.currentSelectedGameObject, axisEventData, ExecuteEvents.moveHandler);
if (!similarDir)
m_ConsecutiveMoveCount = 0;
if (m_ConsecutiveMoveCount == 0 || !(buttonDownHorizontal || buttonDownVertical))
m_ConsecutiveMoveCount++;
m_PrevActionTime = time;
m_LastMoveVector = movement;
} else {
m_ConsecutiveMoveCount = 0;
}
return axisEventData.used;
}
private void CheckButtonOrKeyMovement(out bool downHorizontal, out bool downVertical) {
downHorizontal = false;
downVertical = false;
for (int i = 0; i < playerIds.Length; i++) {
Rewired.Player player = Rewired.ReInput.players.GetPlayer(playerIds[i]);
if (player == null) continue;
if (usePlayingPlayersOnly && !player.isPlaying) continue;
downHorizontal |= GetButtonDown(player, horizontalActionId) || GetNegativeButtonDown(player, horizontalActionId);
downVertical |= GetButtonDown(player, verticalActionId) || GetNegativeButtonDown(player, verticalActionId);
}
}
private void ProcessMouseEvents() {
for(int i = 0; i < playerIds.Length; i++) {
Rewired.Player player = Rewired.ReInput.players.GetPlayer(playerIds[i]);
if(player == null) continue;
if(usePlayingPlayersOnly && !player.isPlaying) continue;
int pointerCount = GetMouseInputSourceCount(playerIds[i]);
for(int j = 0; j < pointerCount; j++) {
ProcessMouseEvent(playerIds[i], j);
}
}
}
/// <summary>
/// Process all mouse events.
/// </summary>
private void ProcessMouseEvent(int playerId, int pointerIndex) {
var mouseData = GetMousePointerEventData(playerId, pointerIndex);
if(mouseData == null) return;
var leftButtonData = mouseData.GetButtonState(0).eventData;
// Process the first mouse button fully
ProcessMousePress(leftButtonData);
ProcessMove(leftButtonData.buttonData);
ProcessDrag(leftButtonData.buttonData);
// Now process right / middle clicks
ProcessMousePress(mouseData.GetButtonState(1).eventData);
ProcessDrag(mouseData.GetButtonState(1).eventData.buttonData);
ProcessMousePress(mouseData.GetButtonState(2).eventData);
ProcessDrag(mouseData.GetButtonState(2).eventData.buttonData);
IMouseInputSource mouseInputSource = GetMouseInputSource(playerId, pointerIndex);
if (mouseInputSource == null) return; // in case mouse source removed by user in event callback
for(int i = 3; i < mouseInputSource.buttonCount; i++) {
ProcessMousePress(mouseData.GetButtonState(i).eventData);
ProcessDrag(mouseData.GetButtonState(i).eventData.buttonData);
}
if (!Mathf.Approximately(leftButtonData.buttonData.scrollDelta.sqrMagnitude, 0.0f)) {
var scrollHandler = ExecuteEvents.GetEventHandler<IScrollHandler>(leftButtonData.buttonData.pointerCurrentRaycast.gameObject);
ExecuteEvents.ExecuteHierarchy(scrollHandler, leftButtonData.buttonData, ExecuteEvents.scrollHandler);
}
}
private bool SendUpdateEventToSelectedObject() {
if (eventSystem.currentSelectedGameObject == null)
return false;
var data = GetBaseEventData();
ExecuteEvents.Execute(eventSystem.currentSelectedGameObject, data, ExecuteEvents.updateSelectedHandler);
return data.used;
}
/// <summary>
/// Process the current mouse press.
/// </summary>
private void ProcessMousePress(MouseButtonEventData data) {
var pointerEvent = data.buttonData;
if (GetMouseInputSource(pointerEvent.playerId, pointerEvent.inputSourceIndex) == null) return; // invalid mouse source
var currentOverGo = pointerEvent.pointerCurrentRaycast.gameObject;
// PointerDown notification
if (data.PressedThisFrame()) {
pointerEvent.eligibleForClick = true;
pointerEvent.delta = Vector2.zero;
pointerEvent.dragging = false;
pointerEvent.useDragThreshold = true;
pointerEvent.pressPosition = pointerEvent.position;
pointerEvent.pointerPressRaycast = pointerEvent.pointerCurrentRaycast;
HandleMouseTouchDeselectionOnSelectionChanged(currentOverGo, pointerEvent);
// search for the control that will receive the press
// if we can't find a press handler set the press
// handler to be what would receive a click.
var newPressed = ExecuteEvents.ExecuteHierarchy(currentOverGo, pointerEvent, ExecuteEvents.pointerDownHandler);
// didnt find a press handler... search for a click handler
if (newPressed == null)
newPressed = ExecuteEvents.GetEventHandler<IPointerClickHandler>(currentOverGo);
// Debug.Log("Pressed: " + newPressed);
double time = Rewired.ReInput.time.unscaledTime;
if (newPressed == pointerEvent.lastPress) {
var diffTime = time - pointerEvent.clickTime;
if (diffTime < 0.3f)
++pointerEvent.clickCount;
else
pointerEvent.clickCount = 1;
pointerEvent.clickTime = (float)time;
} else {
pointerEvent.clickCount = 1;
}
pointerEvent.pointerPress = newPressed;
pointerEvent.rawPointerPress = currentOverGo;
pointerEvent.clickTime = (float)time;
// Save the drag handler as well
pointerEvent.pointerDrag = ExecuteEvents.GetEventHandler<IDragHandler>(currentOverGo);
if (pointerEvent.pointerDrag != null)
ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.initializePotentialDrag);
}
// PointerUp notification
if (data.ReleasedThisFrame()) {
// Debug.Log("Executing pressup on: " + pointer.pointerPress);
ExecuteEvents.Execute(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerUpHandler);
// Debug.Log("KeyCode: " + pointer.eventData.keyCode);
// see if we mouse up on the same element that we clicked on...
var pointerUpHandler = ExecuteEvents.GetEventHandler<IPointerClickHandler>(currentOverGo);
// PointerClick and Drop events
if (pointerEvent.pointerPress == pointerUpHandler && pointerEvent.eligibleForClick) {
ExecuteEvents.Execute(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerClickHandler);
} else if (pointerEvent.pointerDrag != null && pointerEvent.dragging) {
ExecuteEvents.ExecuteHierarchy(currentOverGo, pointerEvent, ExecuteEvents.dropHandler);
}
pointerEvent.eligibleForClick = false;
pointerEvent.pointerPress = null;
pointerEvent.rawPointerPress = null;
if (pointerEvent.pointerDrag != null && pointerEvent.dragging)
ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.endDragHandler);
pointerEvent.dragging = false;
pointerEvent.pointerDrag = null;
// redo pointer enter / exit to refresh state
// so that if we moused over somethign that ignored it before
// due to having pressed on something else
// it now gets it.
if (currentOverGo != pointerEvent.pointerEnter) {
HandlePointerExitAndEnter(pointerEvent, null);
HandlePointerExitAndEnter(pointerEvent, currentOverGo);
}
}
}
private void HandleMouseTouchDeselectionOnSelectionChanged(GameObject currentOverGo, BaseEventData pointerEvent) {
if (m_deselectIfBackgroundClicked && m_deselectBeforeSelecting) {
DeselectIfSelectionChanged(currentOverGo, pointerEvent);
return;
}
var selectHandlerGO = ExecuteEvents.GetEventHandler<ISelectHandler>(currentOverGo);
if (m_deselectIfBackgroundClicked) {
// Deselect only if no new object will be selected
if (selectHandlerGO != eventSystem.currentSelectedGameObject && selectHandlerGO != null) {
eventSystem.SetSelectedGameObject(null, pointerEvent);
}
} else if(m_deselectBeforeSelecting) {
// Deselect only if there is a new selection
if (selectHandlerGO != null && selectHandlerGO != eventSystem.currentSelectedGameObject) {
eventSystem.SetSelectedGameObject(null, pointerEvent);
}
}
}
private void OnApplicationFocus(bool hasFocus) {
m_HasFocus = hasFocus;
}
private bool ShouldIgnoreEventsOnNoFocus() {
#if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_STANDALONE_LINUX || UNITY_WSA || UNITY_WINRT
#if UNITY_EDITOR && UNITY_5_PLUS
if(UnityEditor.EditorApplication.isRemoteConnected) return false;
#endif
if(!Rewired.ReInput.isReady) return true;
#else
if (!Rewired.ReInput.isReady) return false;
#endif
return Rewired.ReInput.configuration.ignoreInputWhenAppNotInFocus;
}
#if UNITY_EDITOR
protected override void OnValidate() {
base.OnValidate();
SetupRewiredVars();
}
#endif
protected override void OnDestroy() {
base.OnDestroy();
Rewired.ReInput.InitializedEvent -= OnRewiredInitialized;
Rewired.ReInput.ShutDownEvent -= OnRewiredShutDown;
Rewired.ReInput.EditorRecompileEvent -= OnEditorRecompile;
}
#region Rewired Methods
protected override bool IsDefaultPlayer(int playerId) {
if(playerIds == null) return false;
if(!Rewired.ReInput.isReady) return false;
for(int tries = 0; tries < 3; tries++) {
// Try 0: Find the first Player that has the mouse assigned and is playing
// Try 1: Find the first Player that has the mouse assigned
// Try 2: Find the first Player
for(int i = 0; i < playerIds.Length; i++) {
Rewired.Player player = Rewired.ReInput.players.GetPlayer(playerIds[i]);
if(player == null) continue;
if(tries < 1 && usePlayingPlayersOnly && !player.isPlaying) continue;
if(tries < 2 && !player.controllers.hasMouse) continue;
return playerIds[i] == playerId;
}
}
return false;
}
private void InitializeRewired() {
if (!Rewired.ReInput.isReady) {
Debug.LogError("Rewired is not initialized! Are you missing a Rewired Input Manager in your scene?");
return;
}
Rewired.ReInput.ShutDownEvent -= OnRewiredShutDown;
Rewired.ReInput.ShutDownEvent += OnRewiredShutDown;
Rewired.ReInput.EditorRecompileEvent -= OnEditorRecompile;
Rewired.ReInput.EditorRecompileEvent += OnEditorRecompile;
SetupRewiredVars();
}
private void SetupRewiredVars() {
if(!Rewired.ReInput.isReady) return;
// Set up Rewired vars
// Set up actions
SetUpRewiredActions();
// Set up Rewired Players
if (useAllRewiredGamePlayers) {
IList<Rewired.Player> rwPlayers = useRewiredSystemPlayer ? Rewired.ReInput.players.AllPlayers : Rewired.ReInput.players.Players;
this.playerIds = new int[rwPlayers.Count];
for (int i = 0; i < rwPlayers.Count; i++) {
this.playerIds[i] = rwPlayers[i].id;
}
} else {
bool foundSystem = false;
List<int> playerIds = new List<int>(rewiredPlayerIds.Length + 1);
for (int i = 0; i < rewiredPlayerIds.Length; i++) {
Rewired.Player player = Rewired.ReInput.players.GetPlayer(rewiredPlayerIds[i]);
if(player == null) continue;
if(playerIds.Contains(player.id)) continue; // already in list
playerIds.Add(player.id);
if(player.id == Consts.systemPlayerId) foundSystem = true;
}
if(useRewiredSystemPlayer && !foundSystem) playerIds.Insert(0, Rewired.ReInput.players.GetSystemPlayer().id);
this.playerIds = playerIds.ToArray();
}
SetUpRewiredPlayerMice();
}
private void SetUpRewiredPlayerMice() {
if(!Rewired.ReInput.isReady) return;
ClearMouseInputSources();
for(int i = 0; i < playerMice.Count; i++) {
var mouse = playerMice[i];
if(Utils.UnityTools.IsNullOrDestroyed(mouse)) continue;
AddMouseInputSource(mouse);
}
}
private void SetUpRewiredActions() {
if(!Rewired.ReInput.isReady) return;
if(!setActionsById) {
horizontalActionId = Rewired.ReInput.mapping.GetActionId(m_HorizontalAxis);
verticalActionId = Rewired.ReInput.mapping.GetActionId(m_VerticalAxis);
submitActionId = Rewired.ReInput.mapping.GetActionId(m_SubmitButton);
cancelActionId = Rewired.ReInput.mapping.GetActionId(m_CancelButton);
} else {
InputAction action;
action = Rewired.ReInput.mapping.GetAction(horizontalActionId);
m_HorizontalAxis = action != null ? action.name : string.Empty;
if(action == null) horizontalActionId = -1;
action = Rewired.ReInput.mapping.GetAction(verticalActionId);
m_VerticalAxis = action != null ? action.name : string.Empty;
if(action == null) verticalActionId = -1;
action = Rewired.ReInput.mapping.GetAction(submitActionId);
m_SubmitButton = action != null ? action.name : string.Empty;
if(action == null) submitActionId = -1;
action = Rewired.ReInput.mapping.GetAction(cancelActionId);
m_CancelButton = action != null ? action.name : string.Empty;
if(action == null) cancelActionId = -1;
}
}
private bool GetButton(Rewired.Player player, int actionId) {
if(actionId < 0) return false; // silence warnings
return player.GetButton(actionId);
}
private bool GetButtonDown(Rewired.Player player, int actionId) {
if(actionId < 0) return false; // silence warnings
return player.GetButtonDown(actionId);
}
private bool GetNegativeButton(Rewired.Player player, int actionId) {
if(actionId < 0) return false; // silence warnings
return player.GetNegativeButton(actionId);
}
private bool GetNegativeButtonDown(Rewired.Player player, int actionId) {
if(actionId < 0) return false; // silence warnings
return player.GetNegativeButtonDown(actionId);
}
private float GetAxis(Rewired.Player player, int actionId) {
if(actionId < 0) return 0f; // silence warnings
return player.GetAxis(actionId);
}
private void CheckEditorRecompile() {
if (!recompiling) return;
if (!Rewired.ReInput.isReady) return;
recompiling = false;
InitializeRewired();
}
private void OnEditorRecompile() {
recompiling = true;
ClearRewiredVars();
}
private void ClearRewiredVars() {
Array.Clear(playerIds, 0, playerIds.Length);
ClearMouseInputSources();
}
private bool DidAnyMouseMove() {
for(int i = 0; i < playerIds.Length; i++) {
int playerId = playerIds[i];
Rewired.Player player = Rewired.ReInput.players.GetPlayer(playerId);
if(player == null) continue;
if(usePlayingPlayersOnly && !player.isPlaying) continue;
int mouseCount = GetMouseInputSourceCount(playerId);
for(int j = 0; j < mouseCount; j++) {
IMouseInputSource source = GetMouseInputSource(playerId, j);
if(source == null) continue;
if(source.screenPositionDelta.sqrMagnitude > 0f) return true;
}
}
return false;
}
private bool GetMouseButtonDownOnAnyMouse(int buttonIndex) {
for(int i = 0; i < playerIds.Length; i++) {
int playerId = playerIds[i];
Rewired.Player player = Rewired.ReInput.players.GetPlayer(playerId);
if(player == null) continue;
if(usePlayingPlayersOnly && !player.isPlaying) continue;
int mouseCount = GetMouseInputSourceCount(playerId);
for(int j = 0; j < mouseCount; j++) {
IMouseInputSource source = GetMouseInputSource(playerId, j);
if(source == null) continue;
if(source.GetButtonDown(buttonIndex)) return true;
}
}
return false;
}
private void OnRewiredInitialized() {
InitializeRewired();
}
private void OnRewiredShutDown() {
ClearRewiredVars();
}
#endregion
[Serializable]
public class PlayerSetting {
public int playerId;
public List<Rewired.Components.PlayerMouse> playerMice = new List<Components.PlayerMouse>();
public PlayerSetting() {
}
private PlayerSetting(PlayerSetting other) {
if(other == null) throw new ArgumentNullException("other");
this.playerId = other.playerId;
this.playerMice = new List<Components.PlayerMouse>();
if(other.playerMice != null) {
foreach(var m in other.playerMice) {
this.playerMice.Add(m);
}
}
}
public PlayerSetting Clone() {
return new PlayerSetting(this);
}
}
}
}
|
jynew/jyx2/Assets/Plugins/Rewired/Integration/UnityUI/RewiredStandaloneInputModule.cs/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/Integration/UnityUI/RewiredStandaloneInputModule.cs",
"repo_id": "jynew",
"token_count": 25645
}
| 1,497 |
fileFormatVersion: 2
guid: bcea3028aba255e42b05f81f46156fc9
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/Plugins/Rewired/Internal/Assets/InputManagerSettings.json.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/Internal/Assets/InputManagerSettings.json.meta",
"repo_id": "jynew",
"token_count": 64
}
| 1,498 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -2084043497, guid: 09c9b883b79ef864a99683bb36c5776d, type: 3}
m_Name: ControllerDataFiles
m_EditorClassIdentifier:
defaultHardwareJoystickMap: {fileID: 11400000, guid: 3cbd233ccf0431c449af2fbcc882f266,
type: 2}
hardwareJoystickMaps:
- {fileID: 11400000, guid: 5c669fd16bb10994dbff55501bb6e4e9, type: 2}
- {fileID: 11400000, guid: 05f66480300b88645aebf9962934d554, type: 2}
- {fileID: 11400000, guid: 5d47793e65ad5314e8955046fa11f359, type: 2}
- {fileID: 11400000, guid: 8806bfb92931c4544a7ebd42e9cb53ce, type: 2}
- {fileID: 11400000, guid: c8e7ee694c990d14aa843d0b82d1552d, type: 2}
- {fileID: 11400000, guid: 98e7e439b7575794c912c559cbd3ea87, type: 2}
- {fileID: 11400000, guid: 25d5197998148774d93d9d5b6ba675a2, type: 2}
- {fileID: 11400000, guid: 1f82de0297b149644bfe83407c1f4e5c, type: 2}
- {fileID: 11400000, guid: b57975934979d6648a55b7ced4876c3a, type: 2}
- {fileID: 11400000, guid: 2caab1cb4e6f06f4a9716c1dd9957888, type: 2}
- {fileID: 11400000, guid: dd2c1503536274001bdc3d5d6be8a98f, type: 2}
- {fileID: 11400000, guid: a25f0c1e102b54019bf551294306b277, type: 2}
- {fileID: 11400000, guid: 3cab29e88959c2d42911cf27a48f2163, type: 2}
- {fileID: 11400000, guid: 2b7ee0c33df0529408f498728b85f0c3, type: 2}
- {fileID: 11400000, guid: 900f3cdee29d1094ab71941e4388d65e, type: 2}
- {fileID: 11400000, guid: e6e9df3e9f7255b4e921898470665e24, type: 2}
- {fileID: 11400000, guid: 0abf19c79e122564ea3bc13997aa6a0c, type: 2}
- {fileID: 11400000, guid: e5bc394572819a648b90d8483652b557, type: 2}
- {fileID: 11400000, guid: b5c24589e9394e9469e02e159cd4b300, type: 2}
- {fileID: 11400000, guid: 8f2e152662e7af44bbde84db680e68a8, type: 2}
- {fileID: 11400000, guid: 62fbf5c15be04534ba5481b7e58fdd23, type: 2}
- {fileID: 11400000, guid: b186918a3dc573d418a27db01de28d97, type: 2}
- {fileID: 11400000, guid: 7e7529bbaedef4b4dae64ce9a394cadf, type: 2}
- {fileID: 11400000, guid: 72e492b3613040a42a1e0f65b46977e4, type: 2}
- {fileID: 11400000, guid: 87aa295af3d3b82448809f03e665bd40, type: 2}
- {fileID: 11400000, guid: d7472ca496136ab4c9bdc72e2c3b3128, type: 2}
- {fileID: 11400000, guid: 8731720e2f07247409ad527524844284, type: 2}
- {fileID: 11400000, guid: 81f1ed74960dd9b48bfd5de10f395e96, type: 2}
- {fileID: 11400000, guid: b7555beb916fdb240946a8c456314f1c, type: 2}
- {fileID: 11400000, guid: 8c63fd25535ce7c48baac52091effb5f, type: 2}
- {fileID: 11400000, guid: 63de6a6dd78215f47aac0880102bd423, type: 2}
- {fileID: 11400000, guid: 46e756e6a26ac41e0866892fbdaef490, type: 2}
- {fileID: 11400000, guid: aad0ba8612167154c8221413c776cf26, type: 2}
- {fileID: 11400000, guid: 6edd643fa9960c543ac4e3f29998a38a, type: 2}
- {fileID: 11400000, guid: 2fc2bee364a1e1646ae4a645bf762f91, type: 2}
- {fileID: 11400000, guid: f24f41c79902d444cb9c85b30e5e17d6, type: 2}
- {fileID: 11400000, guid: 354b5611a5b35c84f9ed9aab314b3937, type: 2}
- {fileID: 11400000, guid: 1ba49b42a7c859a4fa4efbf57bef7d28, type: 2}
- {fileID: 11400000, guid: adb1c7c9e4af1214e8aad8c668439293, type: 2}
- {fileID: 11400000, guid: 64d65c436e6c76b439242af365b23920, type: 2}
- {fileID: 11400000, guid: 142410a998465ef4099aaeee5610474a, type: 2}
- {fileID: 11400000, guid: 71c1dcbfc357cde4a931acdac705470e, type: 2}
- {fileID: 11400000, guid: 8a320167d6be8bb4cbefb4f77e0ae23f, type: 2}
- {fileID: 11400000, guid: 8781775f3250cb84e837f9a6d789b942, type: 2}
- {fileID: 11400000, guid: 456200858fc98d94592f4616ef3360ce, type: 2}
- {fileID: 11400000, guid: 467dcd0bc018415409ef89ef0a127cef, type: 2}
- {fileID: 11400000, guid: a7a3b1e248b756a41a43d848a4d6bb4c, type: 2}
- {fileID: 11400000, guid: f8d6a9fae36bf8049bfe2a826adf5c13, type: 2}
- {fileID: 11400000, guid: 202c7fe068759a44ba37902aacf581ba, type: 2}
- {fileID: 11400000, guid: a651c1f2b3c166240955b7d410965076, type: 2}
- {fileID: 11400000, guid: c70965609466c8f4eb3b220d97a0c0fb, type: 2}
- {fileID: 11400000, guid: 5dfd51f303db12c47adb859f6c94a7ef, type: 2}
- {fileID: 11400000, guid: f11698b2b8346ac49a3d8d65d06b2627, type: 2}
- {fileID: 11400000, guid: 861f879f8377fa442997d510f0405e0f, type: 2}
- {fileID: 11400000, guid: f582cc7332b3acc44b2602257d6b8f6a, type: 2}
- {fileID: 11400000, guid: fa485c60aeeb46a4487bfa7fb7359a75, type: 2}
- {fileID: 11400000, guid: 2de1da9406378ec4895e7e41ba110568, type: 2}
- {fileID: 11400000, guid: 2c3abc1af66b5a048846463a3436068a, type: 2}
- {fileID: 11400000, guid: 0c4661ff643806645a81195682e61a0e, type: 2}
- {fileID: 11400000, guid: 0b0721dbd1ad3554a8ac4e4928b8547a, type: 2}
- {fileID: 11400000, guid: f37439def9763f043bc4b3dcebb0b52e, type: 2}
- {fileID: 11400000, guid: 2b887b409c566ef47a6bb5ecdb6833c0, type: 2}
- {fileID: 11400000, guid: d1fc5cad96c798246a95282448296d08, type: 2}
- {fileID: 11400000, guid: 5511e294250c2fc42b735f1cc4d94be4, type: 2}
- {fileID: 11400000, guid: 14f342bd8308100479b8029fe6e86765, type: 2}
- {fileID: 11400000, guid: 1ccbc3795f0f144f6a61bcc35c4ea0cd, type: 2}
- {fileID: 11400000, guid: 0b6c51a2bf6a17248be8a58431acf8a1, type: 2}
- {fileID: 11400000, guid: e34a98c39b9ad0d4fa35be4bed909998, type: 2}
- {fileID: 11400000, guid: 1061f9c39091cf242bd6958aca060c2d, type: 2}
- {fileID: 11400000, guid: 48092104093e47246aacaddecb6c81f2, type: 2}
- {fileID: 11400000, guid: 9ec45b94bd8c5c145be4ea6830db80be, type: 2}
- {fileID: 11400000, guid: 80487ad48e254e343a231e8344cb22b4, type: 2}
- {fileID: 11400000, guid: 737eae044d53fc94b9c28b110fbb6019, type: 2}
- {fileID: 11400000, guid: c2c9ba16ad481a743b4a1857caf45c8c, type: 2}
- {fileID: 11400000, guid: bab987e4a193e39429f4d1826e07fad8, type: 2}
- {fileID: 11400000, guid: 4454cb89c8ca0994493486094e90e9f1, type: 2}
- {fileID: 11400000, guid: 210ce8f0c7c11b144bbed6b1b2ee612f, type: 2}
- {fileID: 11400000, guid: 87c5910af6e23be42a447b364d70df44, type: 2}
- {fileID: 11400000, guid: 1fa459b73e5712a4a95e3e71655b8767, type: 2}
- {fileID: 11400000, guid: 78fc0032fa6200749ab3b81dbd732c1f, type: 2}
- {fileID: 11400000, guid: cb1b9179d02576242ba9b5f2f3cd6c0d, type: 2}
- {fileID: 11400000, guid: 7a307642c32f15647bc6b0f77d6672c9, type: 2}
- {fileID: 11400000, guid: e2743c5f596f9ab488ff7c94afdda17e, type: 2}
- {fileID: 11400000, guid: a01ca6d704b9ae748a1c6e481731bd21, type: 2}
- {fileID: 11400000, guid: 9b3a2bb648ad56f439c49e68956d9895, type: 2}
- {fileID: 11400000, guid: 2a9e7ff84ddd8e746aaad83f49422399, type: 2}
- {fileID: 11400000, guid: c48f5bea066ef4e4da2721d090b16aed, type: 2}
- {fileID: 11400000, guid: f7b2846204f0d004a8b874b9ec76fd82, type: 2}
- {fileID: 11400000, guid: ef930b86d6724c346999c4d74a9a97d6, type: 2}
- {fileID: 11400000, guid: faaaddd7598d81745872208f0fb1a9d3, type: 2}
- {fileID: 11400000, guid: 58b12e276280b164ba6cdf3783035565, type: 2}
- {fileID: 11400000, guid: 781efbf224353364d9476bc90f3ba38f, type: 2}
- {fileID: 11400000, guid: 52a7405c6e6693d49a2f7efa62d41ead, type: 2}
- {fileID: 11400000, guid: f4dd06702b43a5647b740fa002a8fe27, type: 2}
- {fileID: 11400000, guid: 91631b7cfb2e5d444a5b6f652ffaf6dc, type: 2}
- {fileID: 11400000, guid: ba74a3e163bd0304d8c6ce949d2114b2, type: 2}
- {fileID: 11400000, guid: 5c2a0fe88d613814a8bb32c2bd52b0fe, type: 2}
- {fileID: 11400000, guid: a50255e213cfc2a488ea01d926ff1190, type: 2}
- {fileID: 11400000, guid: 7bd31b74388e3cd4c982edd4c543be55, type: 2}
- {fileID: 11400000, guid: 10f138a68fc210146abb61e0f19f8433, type: 2}
- {fileID: 11400000, guid: 9809fd086825ed548be96453cc73d514, type: 2}
- {fileID: 11400000, guid: bf496c1269e18af47861cbffb62c2636, type: 2}
- {fileID: 11400000, guid: f6fb8bb24a87a9e47b993b0be9b3800e, type: 2}
- {fileID: 11400000, guid: 495ca4e700b67094da44a69256bf8938, type: 2}
- {fileID: 11400000, guid: 72f9d507f6cb1ef4ea6988ea95cf367a, type: 2}
- {fileID: 11400000, guid: 39c79777d7cf36242a843da13f704d9f, type: 2}
- {fileID: 11400000, guid: 6edf15f9b85364e4ea2dacfcb876addc, type: 2}
- {fileID: 11400000, guid: 05c3d0c75cbd74947a8e2b366e776b68, type: 2}
- {fileID: 11400000, guid: e7867d47a3411394e9969cd4a82bfe79, type: 2}
- {fileID: 11400000, guid: 7c86271a5aa17a8459191b8f7fd6c98f, type: 2}
- {fileID: 11400000, guid: 92890da0643b2394e9f4aa2231ac78bf, type: 2}
- {fileID: 11400000, guid: 7e9b5836ed400864b81cb0175ae50e21, type: 2}
- {fileID: 11400000, guid: 4a44f7dfc47d2a544ac3c7497f0b7973, type: 2}
- {fileID: 11400000, guid: 2d4ceaf2efcfc1146ade149a97a1364e, type: 2}
- {fileID: 11400000, guid: c7eae5af8577fdc4cb28c1b4eef8990e, type: 2}
- {fileID: 11400000, guid: 228192069e855894ea68d577ba449e4f, type: 2}
- {fileID: 11400000, guid: b30ad908be1266e4eabb9e05de547164, type: 2}
- {fileID: 11400000, guid: df86f8a4434a18143ae01af07586426b, type: 2}
- {fileID: 11400000, guid: 47066c55bbf750348a292bf06d03e4c6, type: 2}
- {fileID: 11400000, guid: 0e96c4c02687d9349ad0ff44ae9d9fcf, type: 2}
- {fileID: 11400000, guid: 6aeba615ab8394c43b0f67bc9be1c6da, type: 2}
- {fileID: 11400000, guid: 5b4ec7826eed24222ba948f77f2fa65c, type: 2}
- {fileID: 11400000, guid: 54338de8d46db2449af94046055c161c, type: 2}
- {fileID: 11400000, guid: 0709046a0fd63764babf9e69b062bbee, type: 2}
- {fileID: 11400000, guid: 61b8b45ce0d7f6840b81320de46d0284, type: 2}
- {fileID: 11400000, guid: d604681f0d3a82d488e5cc5650c38595, type: 2}
- {fileID: 11400000, guid: 1f79a2aea78f58646aa6348d3a97b1a3, type: 2}
- {fileID: 11400000, guid: 1eebf7efc8bda234282ef13ff5a825a3, type: 2}
- {fileID: 11400000, guid: b4d506bcfb54a344c9f3f68bea11d657, type: 2}
- {fileID: 11400000, guid: f2dd8718315e730418fc148089a673ec, type: 2}
- {fileID: 11400000, guid: 2d5946819e6a7604e9215e4ec1cda8b1, type: 2}
- {fileID: 11400000, guid: bd7bc65f4bae14b4cae2fed6714f46ae, type: 2}
- {fileID: 11400000, guid: 559012aaa7bf4a047bca356093787995, type: 2}
- {fileID: 11400000, guid: a60184a06f4e6b74eaa1a61a47f602d3, type: 2}
- {fileID: 11400000, guid: bd7d5c0c34396c348ac8c50237ce7919, type: 2}
- {fileID: 11400000, guid: 5172655583bc9c94f8f5eca9f44266aa, type: 2}
- {fileID: 11400000, guid: 8fbde7dec15699945a8797cfc0cf37f2, type: 2}
- {fileID: 11400000, guid: d3c894e51fd28d84e8aa97fa8afbd715, type: 2}
- {fileID: 11400000, guid: 532dcc58022f3de45973784c5878ddde, type: 2}
- {fileID: 11400000, guid: bd5c168ccfd771047b3b046934982159, type: 2}
- {fileID: 11400000, guid: 724de1f3a2213094f88f5ad4cd10cc89, type: 2}
- {fileID: 11400000, guid: 2ee88f97f16cab24bbd1e996a9721812, type: 2}
- {fileID: 11400000, guid: 66680992b0f85d4498441e130e3892d6, type: 2}
- {fileID: 11400000, guid: 70783f06a0182a643bde17f845c1b4b3, type: 2}
- {fileID: 11400000, guid: 15a7e6233f6ae4044b27ab1368afde34, type: 2}
- {fileID: 11400000, guid: b3133b6889cce86478ecabb569e5220e, type: 2}
- {fileID: 11400000, guid: 7ad725ead4528fe49a591f901be858ad, type: 2}
- {fileID: 11400000, guid: d13d1bbf4510c45419ee6a683921f11c, type: 2}
- {fileID: 11400000, guid: 1f6828ee3e5f79e42a6ec393edcf8875, type: 2}
- {fileID: 11400000, guid: 3c01df426ab1b5940995688f8e8b8049, type: 2}
- {fileID: 11400000, guid: 7b69f30fe572e6e40bc8ea5937acac47, type: 2}
- {fileID: 11400000, guid: cf80366decf286845a889ef8bd8c39d1, type: 2}
- {fileID: 11400000, guid: 52bff7a274246f641a58d7c22b604e32, type: 2}
- {fileID: 11400000, guid: 850ae8baf1914314eb043f9bf01c1872, type: 2}
- {fileID: 11400000, guid: bb64fb959113f5447a64cd4bb517fd18, type: 2}
- {fileID: 11400000, guid: 2eaf41098f6f59147b10436abc7eea84, type: 2}
- {fileID: 11400000, guid: 8200ea05f0e37fb4f9a16a56ed27da68, type: 2}
- {fileID: 11400000, guid: dabaf28fe56461c4fb37d5f909cb3914, type: 2}
- {fileID: 11400000, guid: c76c0b911c59ffe43b4e909f33d0057d, type: 2}
- {fileID: 11400000, guid: ab34c8825048ddb46a02e63d10928a47, type: 2}
- {fileID: 11400000, guid: 22d64389a3ac78245a2d54f8ae889fb3, type: 2}
- {fileID: 11400000, guid: 973630cd12acc694a9d661dd9c3c53e2, type: 2}
- {fileID: 11400000, guid: acecd302c0ec46a4f97170a61dce15d4, type: 2}
- {fileID: 11400000, guid: 85dd666458e007548970f68ea256f9ee, type: 2}
- {fileID: 11400000, guid: b647750ae970617478e5d358cf1b0dbf, type: 2}
- {fileID: 11400000, guid: 770a22fe483520746b98d10d6bfa723b, type: 2}
joystickTemplates:
- {fileID: 11400000, guid: 91b946f6f6823f4469dbe63db04db904, type: 2}
- {fileID: 11400000, guid: fd777f863083e2d4fb0c40f6bcbfdc78, type: 2}
- {fileID: 11400000, guid: 23f087422fe63934982aa23827dd7675, type: 2}
- {fileID: 11400000, guid: ceb24dfdde952bf4a9127ec6f7e4bf9b, type: 2}
- {fileID: 11400000, guid: 40040093ad7fef24297e648d2ea233c2, type: 2}
- {fileID: 11400000, guid: f66a77febba0c48418401f8c5cbcaff1, type: 2}
|
jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/ControllerDataFiles.asset/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/ControllerDataFiles.asset",
"repo_id": "jynew",
"token_count": 6651
}
| 1,499 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 323110133, guid: 09c9b883b79ef864a99683bb36c5776d, type: 3}
m_Name: CHCombatStickUSB
m_EditorClassIdentifier:
controllerName: CH CombatStick
editorControllerName:
description:
controllerGuid: 030d0f5e-b700-461d-81ee-834c9acbfae9
templateGuids:
- 061a00cf-d8c2-4f8d-8cb5-a15a010bc53e
hideInLists: 0
joystickTypes: 0a0000000b0000001400000015000000
elementIdentifiers:
- _id: 0
_name: Stick X
_positiveName: Stick Right
_negativeName: Stick Left
_elementType: 0
_compoundElementType: 0
- _id: 1
_name: Stick Y
_positiveName: Stick Up
_negativeName: Stick Down
_elementType: 0
_compoundElementType: 0
- _id: 2
_name: Throttle
_positiveName: Throttle Up
_negativeName: Throttle Down
_elementType: 0
_compoundElementType: 0
- _id: 3
_name: Trigger
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 4
_name: Grip Button
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 5
_name: Bottom Thumb Button
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 6
_name: Top Thumb Button
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 7
_name: Pinky Button
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 8
_name: Left Switch Up
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 9
_name: Left Switch Right
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 10
_name: Left Switch Down
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 11
_name: Left Switch Left
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 12
_name: POV Up
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 13
_name: POV Up-Right
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 14
_name: POV Right
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 15
_name: POV Down-Right
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 16
_name: POV Down
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 17
_name: POV Down-Left
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 18
_name: POV Left
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 19
_name: POV Up-Left
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 20
_name: Stick
_positiveName:
_negativeName:
_elementType: 100
_compoundElementType: 0
- _id: 21
_name: Left Switch
_positiveName:
_negativeName:
_elementType: 100
_compoundElementType: 11
- _id: 23
_name: POV HAT
_positiveName:
_negativeName:
_elementType: 100
_compoundElementType: 11
- _id: 25
_name: Side (Mode) button
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 11
compoundElements:
- type: 0
elementIdentifier: 20
componentElementIdentifiers: 0000000001000000
- type: 11
elementIdentifier: 21
componentElementIdentifiers: 08000000090000000a0000000b000000
- type: 11
elementIdentifier: 23
componentElementIdentifiers: 0c0000000e00000010000000120000000d0000000f0000001100000013000000
directInput:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
hatCount: 0
productName_useRegex: 0
productName: []
productGUID: []
productId:
deviceType: 0
elements:
axes: []
buttons: []
variants: []
rawInput:
description:
matchingCriteria:
axisCount: 3
buttonCount: 10
disabled: 0
tag:
hatCount: 1
productName_useRegex: 0
productName:
- CH COMBATSTICK USB
productGUID:
- 00f068e-0000-0000-0000-5049445694
productId: f4000000
deviceType: 20
elements:
axes:
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 0
sourceType: 1
sourceAxis: 1
sourceAxisRange: 0
invert: 0
axisDeadZone: .100000001
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
alternateCalibrations: []
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 1
sourceType: 1
sourceAxis: 2
sourceAxisRange: 0
invert: 1
axisDeadZone: .100000001
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
alternateCalibrations: []
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 2
sourceType: 1
sourceAxis: 3
sourceAxisRange: 0
invert: 1
axisDeadZone: .100000001
calibrateAxis: 1
axisZero: 1
axisMin: -1
axisMax: 1
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 1
alternateCalibrations:
- key: 1
calibration:
_applyRangeCalibration: 0
_invert: 1
_deadZone: .100000001
_zero: 0
_min: 0
_max: 0
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
sourceOtherAxis: 0
buttons:
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 3
sourceType: 0
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 4
sourceType: 0
sourceButton: 1
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 5
sourceType: 0
sourceButton: 2
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 7
sourceType: 0
sourceButton: 3
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 8
sourceType: 0
sourceButton: 4
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 9
sourceType: 0
sourceButton: 5
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 10
sourceType: 0
sourceButton: 6
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 11
sourceType: 0
sourceButton: 7
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 25
sourceType: 0
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 6
sourceType: 0
sourceButton: 9
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 12
sourceType: 2
sourceButton: 9
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 13
sourceType: 2
sourceButton: 9
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 4
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 14
sourceType: 2
sourceButton: 9
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 1
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 15
sourceType: 2
sourceButton: 9
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 5
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 16
sourceType: 2
sourceButton: 9
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 2
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 17
sourceType: 2
sourceButton: 9
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 6
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 18
sourceType: 2
sourceButton: 9
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 3
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 19
sourceType: 2
sourceButton: 9
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 7
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
variants: []
xInput:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
subType:
elements:
axes: []
buttons: []
variants: []
osx:
description:
matchingCriteria:
axisCount: 3
buttonCount: 10
disabled: 0
tag:
hatCount: 1
productName_useRegex: 0
productName:
- CH COMBATSTICK USB
manufacturer:
- CH PRODUCTS
productId: f4000000
vendorId: 8e060000
elements:
axes:
- elementIdentifier: 0
sourceType: 1
sourceStick: 0
sourceAxis: 1
sourceOtherAxis: 0
sourceAxisRange: 0
invert: 0
axisDeadZone: .100000001
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
alternateCalibrations: []
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
- elementIdentifier: 1
sourceType: 1
sourceStick: 0
sourceAxis: 2
sourceOtherAxis: 0
sourceAxisRange: 0
invert: 1
axisDeadZone: .100000001
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
alternateCalibrations: []
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
- elementIdentifier: 2
sourceType: 1
sourceStick: 0
sourceAxis: 3
sourceOtherAxis: 0
sourceAxisRange: 0
invert: 1
axisDeadZone: .100000001
calibrateAxis: 1
axisZero: 1
axisMin: -1
axisMax: 1
alternateCalibrations:
- key: 1
calibration:
_applyRangeCalibration: 0
_invert: 1
_deadZone: .100000001
_zero: 0
_min: 0
_max: 0
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 1
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
buttons:
- elementIdentifier: 3
sourceType: 0
sourceButton: 0
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 4
sourceType: 0
sourceButton: 1
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 5
sourceType: 0
sourceButton: 2
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 7
sourceType: 0
sourceButton: 3
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 8
sourceType: 0
sourceButton: 4
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 9
sourceType: 0
sourceButton: 5
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 10
sourceType: 0
sourceButton: 6
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 11
sourceType: 0
sourceButton: 7
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 25
sourceType: 0
sourceButton: 8
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 6
sourceType: 0
sourceButton: 9
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 12
sourceType: 2
sourceButton: 9
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 13
sourceType: 2
sourceButton: 9
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 4
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 14
sourceType: 2
sourceButton: 9
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 1
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 15
sourceType: 2
sourceButton: 9
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 5
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 16
sourceType: 2
sourceButton: 9
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 2
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 17
sourceType: 2
sourceButton: 9
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 6
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 18
sourceType: 2
sourceButton: 9
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 3
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 19
sourceType: 2
sourceButton: 9
sourceStick: 0
sourceAxis: 0
sourceOtherAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 7
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
variants: []
linux:
description:
matchingCriteria:
axisCount: 3
buttonCount: 10
disabled: 0
tag:
hatCount: 1
manufacturer_useRegex: 0
productName_useRegex: 0
systemName_useRegex: 0
manufacturer:
- CH PRODUCTS
productName:
- CH COMBATSTICK USB
systemName:
- CH PRODUCTS CH COMBATSTICK USB
productGUID:
- 00f068e-0000-0000-0000-5049445694
elements:
axes:
- elementIdentifier: 0
sourceType: 1
sourceAxis: 0
sourceAxisRange: 0
invert: 0
axisDeadZone: .100000001
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
alternateCalibrations: []
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
- elementIdentifier: 1
sourceType: 1
sourceAxis: 1
sourceAxisRange: 0
invert: 1
axisDeadZone: .100000001
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
alternateCalibrations: []
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
- elementIdentifier: 2
sourceType: 1
sourceAxis: 2
sourceAxisRange: 0
invert: 1
axisDeadZone: .100000001
calibrateAxis: 1
axisZero: 1
axisMin: -1
axisMax: 1
alternateCalibrations:
- key: 1
calibration:
_applyRangeCalibration: 0
_invert: 1
_deadZone: .100000001
_zero: 0
_min: 0
_max: 0
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 1
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
buttons:
- elementIdentifier: 3
sourceType: 0
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 4
sourceType: 0
sourceButton: 1
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 5
sourceType: 0
sourceButton: 2
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 6
sourceType: 0
sourceButton: 9
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 7
sourceType: 0
sourceButton: 3
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 8
sourceType: 0
sourceButton: 4
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 9
sourceType: 0
sourceButton: 5
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 10
sourceType: 0
sourceButton: 6
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 11
sourceType: 0
sourceButton: 7
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 25
sourceType: 0
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 12
sourceType: 2
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 13
sourceType: 2
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 4
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 14
sourceType: 2
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 1
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 15
sourceType: 2
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 5
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 16
sourceType: 2
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 2
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 17
sourceType: 2
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 6
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 18
sourceType: 2
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 3
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 19
sourceType: 2
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 7
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
variants: []
windowsUWP:
description:
matchingCriteria:
axisCount: 3
buttonCount: 10
disabled: 0
tag:
hatCount: 1
manufacturer_useRegex: 0
productName_useRegex: 0
manufacturer:
- CH PRODUCTS
productName:
- CH COMBATSTICK USB
productGUID:
- 00f068e-0000-0000-0000-5049445694
elements:
axes:
- elementIdentifier: 0
sourceType: 1
sourceAxis: 0
sourceAxisRange: 0
invert: 0
axisDeadZone: .100000001
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
alternateCalibrations: []
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
- elementIdentifier: 1
sourceType: 1
sourceAxis: 1
sourceAxisRange: 0
invert: 1
axisDeadZone: .100000001
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
alternateCalibrations: []
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
- elementIdentifier: 2
sourceType: 1
sourceAxis: 2
sourceAxisRange: 0
invert: 1
axisDeadZone: .100000001
calibrateAxis: 1
axisZero: 1
axisMin: -1
axisMax: 1
alternateCalibrations:
- key: 1
calibration:
_applyRangeCalibration: 0
_invert: 1
_deadZone: .100000001
_zero: 0
_min: 0
_max: 0
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 1
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
buttons:
- elementIdentifier: 3
sourceType: 0
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 4
sourceType: 0
sourceButton: 1
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 5
sourceType: 0
sourceButton: 2
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 6
sourceType: 0
sourceButton: 9
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 7
sourceType: 0
sourceButton: 3
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 8
sourceType: 0
sourceButton: 4
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 9
sourceType: 0
sourceButton: 5
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 10
sourceType: 0
sourceButton: 6
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 11
sourceType: 0
sourceButton: 7
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 25
sourceType: 0
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 12
sourceType: 2
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 13
sourceType: 2
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 4
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 14
sourceType: 2
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 1
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 15
sourceType: 2
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 5
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 16
sourceType: 2
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 2
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 17
sourceType: 2
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 6
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 18
sourceType: 2
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 3
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 19
sourceType: 2
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 1
sourceHatDirection: 7
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
variants: []
fallback_Windows:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_WindowsUWP:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_OSX:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_Linux:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_Linux_PreConfigured:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_Android:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_iOS:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_Blackberry:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_WindowsPhone8:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_XBox360:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_XBoxOne:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_PS3:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_PS4:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_PSM:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_PSVita:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_Wii:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_WiiU:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_AmazonFireTV:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_RazerForgeTV:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
elements:
axes: []
buttons: []
variants: []
webGL:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
productGUID: []
mapping:
elementCount: []
clientInfo: []
elements:
axes: []
buttons: []
variants: []
ouya:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
elements:
axes: []
buttons: []
variants: []
xboxOne:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
elements:
axes: []
buttons: []
variants: []
ps4:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
elements:
axes: []
buttons: []
variants: []
nintendoSwitch:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
elements:
axes: []
buttons: []
variants: []
internalDriver:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
vidPid: []
hatCount: 0
elements:
axes: []
buttons: []
variants: []
sdl2_Linux:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
hatCount: 0
manufacturer_useRegex: 0
productName_useRegex: 0
systemName_useRegex: 0
manufacturer: []
productName: []
systemName: []
productGUID: []
elements:
axes: []
buttons: []
variants: []
sdl2_Windows:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
hatCount: 0
manufacturer_useRegex: 0
productName_useRegex: 0
systemName_useRegex: 0
manufacturer: []
productName: []
systemName: []
productGUID: []
elements:
axes: []
buttons: []
variants: []
sdl2_OSX:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
hatCount: 0
manufacturer_useRegex: 0
productName_useRegex: 0
systemName_useRegex: 0
manufacturer: []
productName: []
systemName: []
productGUID: []
elements:
axes: []
buttons: []
variants: []
elementIdentifierIdCounter: 26
|
jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/CHCombatStickUSB.asset/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/CHCombatStickUSB.asset",
"repo_id": "jynew",
"token_count": 28501
}
| 1,500 |
fileFormatVersion: 2
guid: 0b6c51a2bf6a17248be8a58431acf8a1
labels:
- Input
- Joysticks
- Controllers
- Rewired
- Hotplugging
- Keyboard
- Mouse
- Touch
- InputManager
- Control
- Gamepad
- Controller
- Joystick
- Xbox360
- XInput
- DirectInput
- RawInput
NativeFormatImporter:
userData:
|
jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/GoogleNexusPlayerGamepad.asset.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/GoogleNexusPlayerGamepad.asset.meta",
"repo_id": "jynew",
"token_count": 111
}
| 1,501 |
fileFormatVersion: 2
guid: b57975934979d6648a55b7ced4876c3a
labels:
- Input
- Joysticks
- Controllers
- Rewired
- Hotplugging
- Keyboard
- Mouse
- Touch
- InputManager
- Control
- Gamepad
- Controller
- Joystick
- Xbox360
- XInput
- DirectInput
- RawInput
NativeFormatImporter:
userData:
|
jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/LogitechRumblePad2.asset.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/LogitechRumblePad2.asset.meta",
"repo_id": "jynew",
"token_count": 107
}
| 1,502 |
fileFormatVersion: 2
guid: c7eae5af8577fdc4cb28c1b4eef8990e
NativeFormatImporter:
userData:
|
jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/MicrosoftSideWinderForceFeedbackPro.asset.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/MicrosoftSideWinderForceFeedbackPro.asset.meta",
"repo_id": "jynew",
"token_count": 44
}
| 1,503 |
fileFormatVersion: 2
guid: c2c9ba16ad481a743b4a1857caf45c8c
NativeFormatImporter:
userData:
|
jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/NintendoSwitchHandheld.asset.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/NintendoSwitchHandheld.asset.meta",
"repo_id": "jynew",
"token_count": 44
}
| 1,504 |
fileFormatVersion: 2
guid: 66680992b0f85d4498441e130e3892d6
NativeFormatImporter:
userData:
|
jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/SaitekHeavyEquipmentControlPanel.asset.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/SaitekHeavyEquipmentControlPanel.asset.meta",
"repo_id": "jynew",
"token_count": 40
}
| 1,505 |
fileFormatVersion: 2
guid: ba74a3e163bd0304d8c6ce949d2114b2
NativeFormatImporter:
userData:
|
jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/SaitekProFlightThrottleQuadrant.asset.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/SaitekProFlightThrottleQuadrant.asset.meta",
"repo_id": "jynew",
"token_count": 42
}
| 1,506 |
fileFormatVersion: 2
guid: faaaddd7598d81745872208f0fb1a9d3
timeCreated: 1490575623
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/SaitekX56RhinoStick.asset.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/SaitekX56RhinoStick.asset.meta",
"repo_id": "jynew",
"token_count": 72
}
| 1,507 |
fileFormatVersion: 2
guid: b647750ae970617478e5d358cf1b0dbf
labels:
- Input
- Joysticks
- Controllers
- Rewired
- Hotplugging
- Keyboard
- Mouse
- Touch
- InputManager
- Control
- Gamepad
- Controller
- Joystick
- Xbox360
- XInput
- DirectInput
- RawInput
NativeFormatImporter:
userData:
|
jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/SonyPS4AimController.asset.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/SonyPS4AimController.asset.meta",
"repo_id": "jynew",
"token_count": 108
}
| 1,508 |
fileFormatVersion: 2
guid: 5c669fd16bb10994dbff55501bb6e4e9
NativeFormatImporter:
userData:
|
jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/SteamController.asset.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/SteamController.asset.meta",
"repo_id": "jynew",
"token_count": 40
}
| 1,509 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1351212051, guid: 09c9b883b79ef864a99683bb36c5776d, type: 3}
m_Name: FlightYoke
m_EditorClassIdentifier:
controllerName: Flight Yoke
description:
templateGuid: f311fa16-0ccc-41c0-ac4b-50f7100bb8ff
templateType: 3
className: FlightYokeTemplate
elementIdentifiers:
- _id: 0
_name: Rotate Yoke
_positiveName: Rotate Yoke Right
_negativeName: Rotate Yoke Left
_elementType: 0
_scriptingName: rotateYoke
_excludeFromExport: 1
- _id: 1
_name: Yoke Z
_positiveName:
_negativeName:
_elementType: 0
_scriptingName: yokeZ
_excludeFromExport: 1
- _id: 59
_name: Left Paddle
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: leftPaddle
_excludeFromExport: 0
- _id: 60
_name: Right Paddle
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: rightPaddle
_excludeFromExport: 0
- _id: 2
_name: Lever 1
_positiveName:
_negativeName:
_elementType: 0
_scriptingName: lever1Axis
_excludeFromExport: 1
- _id: 64
_name: Lever 1 Min Detent
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: lever1MinDetent
_excludeFromExport: 1
- _id: 3
_name: Lever 2
_positiveName:
_negativeName:
_elementType: 0
_scriptingName: lever2Axis
_excludeFromExport: 1
- _id: 65
_name: Lever 2 Min Detent
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: lever2MinDetent
_excludeFromExport: 1
- _id: 4
_name: Lever 3
_positiveName:
_negativeName:
_elementType: 0
_scriptingName: lever3Axis
_excludeFromExport: 1
- _id: 66
_name: Lever 3 Min Detent
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: lever3MinDetent
_excludeFromExport: 1
- _id: 5
_name: Lever 4
_positiveName:
_negativeName:
_elementType: 0
_scriptingName: lever4Axis
_excludeFromExport: 1
- _id: 67
_name: Lever 4 Min Detent
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: lever4MinDetent
_excludeFromExport: 1
- _id: 6
_name: Lever 5
_positiveName:
_negativeName:
_elementType: 0
_scriptingName: lever5Axis
_excludeFromExport: 1
- _id: 68
_name: Lever 5 Min Detent
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: lever5MinDetent
_excludeFromExport: 1
- _id: 7
_name: Left Grip Button 1
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: leftGripButton1
_excludeFromExport: 0
- _id: 8
_name: Left Grip Button 2
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: leftGripButton2
_excludeFromExport: 0
- _id: 9
_name: Left Grip Button 3
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: leftGripButton3
_excludeFromExport: 0
- _id: 10
_name: Left Grip Button 4
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: leftGripButton4
_excludeFromExport: 0
- _id: 11
_name: Left Grip Button 5
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: leftGripButton5
_excludeFromExport: 0
- _id: 12
_name: Left Grip Button 6
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: leftGripButton6
_excludeFromExport: 0
- _id: 13
_name: Right Grip Button 1
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: rightGripButton1
_excludeFromExport: 0
- _id: 14
_name: Right Grip Button 2
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: rightGripButton2
_excludeFromExport: 0
- _id: 15
_name: Right Grip Button 3
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: rightGripButton3
_excludeFromExport: 0
- _id: 16
_name: Right Grip Button 4
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: rightGripButton4
_excludeFromExport: 0
- _id: 17
_name: Right Grip Button 5
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: rightGripButton5
_excludeFromExport: 0
- _id: 18
_name: Right Grip Button 6
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: rightGripButton6
_excludeFromExport: 0
- _id: 19
_name: Center Button 1
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: centerButton1
_excludeFromExport: 0
- _id: 20
_name: Center Button 2
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: centerButton2
_excludeFromExport: 0
- _id: 21
_name: Center Button 3
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: centerButton3
_excludeFromExport: 0
- _id: 22
_name: Center Button 4
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: centerButton4
_excludeFromExport: 0
- _id: 23
_name: Center Button 5
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: centerButton5
_excludeFromExport: 0
- _id: 24
_name: Center Button 6
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: centerButton6
_excludeFromExport: 0
- _id: 25
_name: Center Button 7
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: centerButton7
_excludeFromExport: 0
- _id: 26
_name: Center Button 8
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: centerButton8
_excludeFromExport: 0
- _id: 53
_name: Wheel 1 Up
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: wheel1Up
_excludeFromExport: 0
- _id: 54
_name: Wheel 1 Down
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: wheel1Down
_excludeFromExport: 0
- _id: 55
_name: Wheel 1 Press
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: wheel1Press
_excludeFromExport: 0
- _id: 56
_name: Wheel 2 Up
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: wheel2Up
_excludeFromExport: 0
- _id: 57
_name: Wheel 2 Down
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: wheel2Down
_excludeFromExport: 0
- _id: 58
_name: Wheel 2 Press
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: wheel2Press
_excludeFromExport: 0
- _id: 27
_name: Left Grip Hat Up
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: leftGripHatUp
_excludeFromExport: 1
- _id: 28
_name: Left Grip Hat Up-Right
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: leftGripHatUpRight
_excludeFromExport: 1
- _id: 29
_name: Left Grip Hat Right
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: leftGripHatRight
_excludeFromExport: 1
- _id: 30
_name: Left Grip Hat Down-Right
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: leftGripHatDownRight
_excludeFromExport: 1
- _id: 31
_name: Left Grip Hat Down
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: leftGripHatDown
_excludeFromExport: 1
- _id: 32
_name: Left Grip Hat Down-Left
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: leftGripHatDownLeft
_excludeFromExport: 1
- _id: 33
_name: Left Grip Hat Left
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: leftGripHatLeft
_excludeFromExport: 1
- _id: 34
_name: Left Grip Hat Up-Left
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: leftGripHatUpLeft
_excludeFromExport: 1
- _id: 35
_name: Right Grip Hat Up
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: rightGripHatUp
_excludeFromExport: 1
- _id: 36
_name: Right Grip Hat Up-Right
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: rightGripHatUpRight
_excludeFromExport: 1
- _id: 37
_name: Right Grip Hat Right
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: rightGripHatRight
_excludeFromExport: 1
- _id: 38
_name: Right Grip Hat Down-Right
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: rightGripHatDownRight
_excludeFromExport: 1
- _id: 39
_name: Right Grip Hat Down
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: rightGripHatDown
_excludeFromExport: 1
- _id: 40
_name: Right Grip Hat Down-Left
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: rightGripHatDownLeft
_excludeFromExport: 1
- _id: 41
_name: Right Grip Hat Left
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: rightGripHatLeft
_excludeFromExport: 1
- _id: 42
_name: Right Grip Hat Up-Left
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: rightGripHatUpLeft
_excludeFromExport: 1
- _id: 43
_name: Console Button 1
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: consoleButton1
_excludeFromExport: 0
- _id: 44
_name: Console Button 2
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: consoleButton2
_excludeFromExport: 0
- _id: 45
_name: Console Button 3
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: consoleButton3
_excludeFromExport: 0
- _id: 46
_name: Console Button 4
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: consoleButton4
_excludeFromExport: 0
- _id: 47
_name: Console Button 5
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: consoleButton5
_excludeFromExport: 0
- _id: 48
_name: Console Button 6
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: consoleButton6
_excludeFromExport: 0
- _id: 49
_name: Console Button 7
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: consoleButton7
_excludeFromExport: 0
- _id: 50
_name: Console Button 8
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: consoleButton8
_excludeFromExport: 0
- _id: 51
_name: Console Button 9
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: consoleButton9
_excludeFromExport: 0
- _id: 52
_name: Console Button 10
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: consoleButton10
_excludeFromExport: 0
- _id: 61
_name: Mode 1
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: mode1
_excludeFromExport: 0
- _id: 62
_name: Mode 2
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: mode2
_excludeFromExport: 0
- _id: 63
_name: Mode 3
_positiveName:
_negativeName:
_elementType: 1
_scriptingName: mode3
_excludeFromExport: 0
- _id: 69
_name: Yoke
_positiveName:
_negativeName:
_elementType: 8
_scriptingName: yoke
_excludeFromExport: 0
- _id: 70
_name: Lever 1
_positiveName:
_negativeName:
_elementType: 6
_scriptingName: lever1
_excludeFromExport: 0
- _id: 71
_name: Lever 2
_positiveName:
_negativeName:
_elementType: 6
_scriptingName: lever2
_excludeFromExport: 0
- _id: 72
_name: Lever 3
_positiveName:
_negativeName:
_elementType: 6
_scriptingName: lever3
_excludeFromExport: 0
- _id: 73
_name: Lever 4
_positiveName:
_negativeName:
_elementType: 6
_scriptingName: lever4
_excludeFromExport: 0
- _id: 74
_name: Lever 5
_positiveName:
_negativeName:
_elementType: 6
_scriptingName: lever5
_excludeFromExport: 0
- _id: 75
_name: Left Grip Hat
_positiveName:
_negativeName:
_elementType: 7
_scriptingName: leftGripHat
_excludeFromExport: 0
- _id: 76
_name: Right Grip Hat
_positiveName:
_negativeName:
_elementType: 7
_scriptingName: rightGripHat
_excludeFromExport: 0
joysticks:
- id: 0
name: CH Eclipse Yoke
joystickGuid: acd80423-3ce9-4029-9c4b-9230907ea4b1
fileGuid: 7a307642c32f15647bc6b0f77d6672c9
elementIdentifierMappings:
- templateId: 0
joystickId: 0
joystickId2: 0
splitAxis: 0
- templateId: 1
joystickId: 1
joystickId2: 0
splitAxis: 0
- templateId: 59
joystickId: 2
joystickId2: 0
splitAxis: 0
- templateId: 60
joystickId: 28
joystickId2: 0
splitAxis: 0
- templateId: 2
joystickId: 3
joystickId2: 0
splitAxis: 0
- templateId: 3
joystickId: 4
joystickId2: 0
splitAxis: 0
- templateId: 4
joystickId: 5
joystickId2: 0
splitAxis: 0
- templateId: 7
joystickId: 6
joystickId2: 0
splitAxis: 0
- templateId: 13
joystickId: 7
joystickId2: 0
splitAxis: 0
- templateId: 8
joystickId: 8
joystickId2: 0
splitAxis: 0
- templateId: 9
joystickId: 9
joystickId2: 0
splitAxis: 0
- templateId: 14
joystickId: 10
joystickId2: 0
splitAxis: 0
- templateId: 15
joystickId: 11
joystickId2: 0
splitAxis: 0
- templateId: 43
joystickId: 12
joystickId2: 0
splitAxis: 0
- templateId: 44
joystickId: 13
joystickId2: 0
splitAxis: 0
- templateId: 45
joystickId: 14
joystickId2: 0
splitAxis: 0
- templateId: 46
joystickId: 15
joystickId2: 0
splitAxis: 0
- templateId: 19
joystickId: 16
joystickId2: 0
splitAxis: 0
- templateId: 20
joystickId: 18
joystickId2: 0
splitAxis: 0
- templateId: 21
joystickId: 17
joystickId2: 0
splitAxis: 0
- templateId: 53
joystickId: 20
joystickId2: 0
splitAxis: 0
- templateId: 54
joystickId: 21
joystickId2: 0
splitAxis: 0
- templateId: 55
joystickId: 19
joystickId2: 0
splitAxis: 0
- templateId: 56
joystickId: 24
joystickId2: 0
splitAxis: 0
- templateId: 57
joystickId: 23
joystickId2: 0
splitAxis: 0
- templateId: 58
joystickId: 22
joystickId2: 0
splitAxis: 0
- templateId: 61
joystickId: 25
joystickId2: 0
splitAxis: 0
- templateId: 62
joystickId: 26
joystickId2: 0
splitAxis: 0
- templateId: 63
joystickId: 27
joystickId2: 0
splitAxis: 0
- templateId: 27
joystickId: 29
joystickId2: 0
splitAxis: 0
- templateId: 28
joystickId: 30
joystickId2: 0
splitAxis: 0
- templateId: 29
joystickId: 31
joystickId2: 0
splitAxis: 0
- templateId: 30
joystickId: 32
joystickId2: 0
splitAxis: 0
- templateId: 31
joystickId: 33
joystickId2: 0
splitAxis: 0
- templateId: 32
joystickId: 34
joystickId2: 0
splitAxis: 0
- templateId: 33
joystickId: 35
joystickId2: 0
splitAxis: 0
- templateId: 34
joystickId: 36
joystickId2: 0
splitAxis: 0
- templateId: 35
joystickId: 37
joystickId2: 0
splitAxis: 0
- templateId: 36
joystickId: 38
joystickId2: 0
splitAxis: 0
- templateId: 37
joystickId: 39
joystickId2: 0
splitAxis: 0
- templateId: 38
joystickId: 40
joystickId2: 0
splitAxis: 0
- templateId: 39
joystickId: 41
joystickId2: 0
splitAxis: 0
- templateId: 40
joystickId: 42
joystickId2: 0
splitAxis: 0
- templateId: 41
joystickId: 43
joystickId2: 0
splitAxis: 0
- templateId: 42
joystickId: 44
joystickId2: 0
splitAxis: 0
- id: 1
name: Saitek Pro Flight Yoke
joystickGuid: 6476e035-08d3-4b91-a336-f2e94ad89e6e
fileGuid: 91631b7cfb2e5d444a5b6f652ffaf6dc
elementIdentifierMappings:
- templateId: 0
joystickId: 0
joystickId2: 0
splitAxis: 0
- templateId: 1
joystickId: 1
joystickId2: 0
splitAxis: 0
- templateId: 2
joystickId: 2
joystickId2: 0
splitAxis: 0
- templateId: 3
joystickId: 3
joystickId2: 0
splitAxis: 0
- templateId: 4
joystickId: 4
joystickId2: 0
splitAxis: 0
- templateId: 7
joystickId: 12
joystickId2: 0
splitAxis: 0
- templateId: 8
joystickId: 5
joystickId2: 0
splitAxis: 0
- templateId: 8
joystickId: 6
joystickId2: 0
splitAxis: 0
- templateId: 13
joystickId: 11
joystickId2: 0
splitAxis: 0
- templateId: 14
joystickId: 7
joystickId2: 0
splitAxis: 0
- templateId: 15
joystickId: 8
joystickId2: 0
splitAxis: 0
- templateId: 16
joystickId: 9
joystickId2: 0
splitAxis: 0
- templateId: 17
joystickId: 10
joystickId2: 0
splitAxis: 0
- templateId: 19
joystickId: 13
joystickId2: 0
splitAxis: 0
- templateId: 20
joystickId: 14
joystickId2: 0
splitAxis: 0
- templateId: 21
joystickId: 15
joystickId2: 0
splitAxis: 0
- templateId: 61
joystickId: 16
joystickId2: 0
splitAxis: 0
- templateId: 62
joystickId: 17
joystickId2: 0
splitAxis: 0
- templateId: 63
joystickId: 18
joystickId2: 0
splitAxis: 0
- templateId: 43
joystickId: 19
joystickId2: 0
splitAxis: 0
- templateId: 44
joystickId: 20
joystickId2: 0
splitAxis: 0
- templateId: 45
joystickId: 21
joystickId2: 0
splitAxis: 0
- templateId: 46
joystickId: 22
joystickId2: 0
splitAxis: 0
- templateId: 47
joystickId: 23
joystickId2: 0
splitAxis: 0
- templateId: 48
joystickId: 24
joystickId2: 0
splitAxis: 0
- templateId: 27
joystickId: 28
joystickId2: 0
splitAxis: 0
- templateId: 28
joystickId: 29
joystickId2: 0
splitAxis: 0
- templateId: 29
joystickId: 30
joystickId2: 0
splitAxis: 0
- templateId: 30
joystickId: 31
joystickId2: 0
splitAxis: 0
- templateId: 31
joystickId: 32
joystickId2: 0
splitAxis: 0
- templateId: 32
joystickId: 33
joystickId2: 0
splitAxis: 0
- templateId: 33
joystickId: 34
joystickId2: 0
splitAxis: 0
- templateId: 34
joystickId: 35
joystickId2: 0
splitAxis: 0
- templateId: 64
joystickId: 25
joystickId2: 0
splitAxis: 0
- templateId: 65
joystickId: 26
joystickId2: 0
splitAxis: 0
- templateId: 66
joystickId: 27
joystickId2: 0
splitAxis: 0
specialElements:
- elementIdentifierId: 69
data: '{"eid_axisX":0,"eid_axisZ":1}'
- elementIdentifierId: 70
data: '{"eid_axis":2,"eid_MinDetent":64}'
- elementIdentifierId: 71
data: '{"eid_axis":3,"eid_MinDetent":65}'
- elementIdentifierId: 72
data: '{"eid_axis":4,"eid_MinDetent":66}'
- elementIdentifierId: 73
data: '{"eid_axis":5,"eid_MinDetent":67}'
- elementIdentifierId: 74
data: '{"eid_axis":6,"eid_MinDetent":68}'
- elementIdentifierId: 75
data: '{"eid_up":27,"eid_upRight":28,"eid_right":29,"eid_downRight":30,"eid_down":31,"eid_downLeft":32,"eid_left":33,"eid_upLeft":34}'
- elementIdentifierId: 76
data: '{"eid_up":35,"eid_upRight":36,"eid_right":37,"eid_downRight":38,"eid_down":39,"eid_downLeft":40,"eid_left":41,"eid_upLeft":42}'
elementIdentifierIdCounter: 77
joystickIdCounter: 2
|
jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/Templates/FlightYoke.asset/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/Templates/FlightYoke.asset",
"repo_id": "jynew",
"token_count": 9397
}
| 1,510 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 323110133, guid: 09c9b883b79ef864a99683bb36c5776d, type: 3}
m_Name: ThrustmasterDualAnalog3
m_EditorClassIdentifier:
controllerName: Thrustmaster Dual Analog 3.2
editorControllerName:
description:
controllerGuid: 8bf3582e-cc1c-4c09-9c69-a8ea04050d16
templateGuids:
- 83b427e4-086f-47f3-bb06-be266abd1ca5
hideInLists: 0
joystickTypes: 0100000002000000
elementIdentifiers:
- _id: 0
_name: Left Stick X
_positiveName: Left Stick Right
_negativeName: Left Stick Left
_elementType: 0
_compoundElementType: 0
- _id: 1
_name: Left Stick Y
_positiveName: Left Stick Up
_negativeName: Left Stick Down
_elementType: 0
_compoundElementType: 0
- _id: 2
_name: Right Stick X
_positiveName: Right Stick Right
_negativeName: Right Stick Left
_elementType: 0
_compoundElementType: 0
- _id: 3
_name: Right Stick Y
_positiveName: Right Stick Up
_negativeName: Right Stick Down
_elementType: 0
_compoundElementType: 0
- _id: 10
_name: Lower Button 1
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 11
_name: Lower Button 2
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 12
_name: Upper Button 1
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 13
_name: Upper Button 2
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 5
_name: Left Shoulder 1
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 7
_name: Left Shoulder 2
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 4
_name: Right Shoulder 1
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 6
_name: Right Shoulder 2
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 8
_name: Left Trigger
_positiveName: Left Trigger
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 9
_name: Right Trigger
_positiveName: Right Trigger
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 14
_name: Left Stick Button
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 15
_name: Right Stick Button
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 16
_name: D-Pad Up
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 17
_name: D-Pad Right
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 19
_name: D-Pad Down
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 18
_name: D-Pad Left
_positiveName:
_negativeName:
_elementType: 1
_compoundElementType: 0
- _id: 20
_name: Left Stick
_positiveName:
_negativeName:
_elementType: 100
_compoundElementType: 0
- _id: 21
_name: Right Stick
_positiveName:
_negativeName:
_elementType: 100
_compoundElementType: 0
compoundElements:
- type: 0
elementIdentifier: 20
componentElementIdentifiers: 0000000001000000
- type: 0
elementIdentifier: 21
componentElementIdentifiers: 0200000003000000
directInput:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
hatCount: 0
alternateElementCounts: []
productName_useRegex: 0
productName: []
productGUID: []
productId:
deviceType: 0
elements:
axes: []
buttons: []
variants: []
rawInput:
description:
matchingCriteria:
axisCount: 4
buttonCount: 12
disabled: 0
tag:
hatCount: 1
alternateElementCounts: []
productName_useRegex: 0
productName:
- Thrustmaster dual analog 3.2
productGUID:
- b315044f
productId: 15b30000
deviceType: 21
elements:
axes:
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 0
sourceType: 1
sourceAxis: 1
sourceAxisRange: 0
invert: 0
axisDeadZone: .200000003
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
alternateCalibrations: []
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 1
sourceType: 1
sourceAxis: 2
sourceAxisRange: 0
invert: 1
axisDeadZone: .200000003
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
alternateCalibrations: []
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 2
sourceType: 1
sourceAxis: 6
sourceAxisRange: 0
invert: 0
axisDeadZone: .200000003
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
alternateCalibrations: []
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 3
sourceType: 1
sourceAxis: 7
sourceAxisRange: 0
invert: 1
axisDeadZone: .200000003
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
alternateCalibrations: []
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
sourceOtherAxis: 0
buttons:
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 10
sourceType: 0
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 11
sourceType: 0
sourceButton: 2
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 12
sourceType: 0
sourceButton: 1
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 13
sourceType: 0
sourceButton: 3
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 5
sourceType: 0
sourceButton: 4
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 7
sourceType: 0
sourceButton: 5
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 4
sourceType: 0
sourceButton: 6
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 6
sourceType: 0
sourceButton: 7
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 8
sourceType: 0
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 9
sourceType: 0
sourceButton: 9
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 14
sourceType: 0
sourceButton: 10
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 15
sourceType: 0
sourceButton: 11
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 16
sourceType: 2
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 17
sourceType: 2
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 1
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 19
sourceType: 2
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 2
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
- customCalculation: {fileID: 0}
customCalculationSourceData: []
elementIdentifier: 18
sourceType: 2
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 3
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
sourceOtherAxis: 0
variants: []
xInput:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
subType:
elements:
axes: []
buttons: []
variants: []
osx:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
hatCount: 0
alternateElementCounts: []
productName_useRegex: 0
productName: []
manufacturer: []
productId:
vendorId:
elements:
axes: []
buttons: []
variants: []
linux:
description:
matchingCriteria:
axisCount: 4
buttonCount: 12
disabled: 0
tag:
hatCount: 1
alternateElementCounts: []
manufacturer_useRegex: 0
productName_useRegex: 0
systemName_useRegex: 0
manufacturer: []
productName:
- Thrustmaster dual analog 3.2
systemName: []
productGUID:
- b315044f
elements:
axes:
- elementIdentifier: 0
sourceType: 1
sourceAxis: 0
sourceAxisRange: 0
invert: 0
axisDeadZone: .200000003
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
alternateCalibrations: []
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
- elementIdentifier: 1
sourceType: 1
sourceAxis: 1
sourceAxisRange: 0
invert: 1
axisDeadZone: .200000003
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
alternateCalibrations: []
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
- elementIdentifier: 2
sourceType: 1
sourceAxis: 5
sourceAxisRange: 0
invert: 0
axisDeadZone: .200000003
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
alternateCalibrations: []
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
- elementIdentifier: 3
sourceType: 1
sourceAxis: 6
sourceAxisRange: 0
invert: 1
axisDeadZone: .200000003
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
alternateCalibrations: []
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
buttons:
- elementIdentifier: 10
sourceType: 0
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 11
sourceType: 0
sourceButton: 2
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 12
sourceType: 0
sourceButton: 1
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 13
sourceType: 0
sourceButton: 3
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 5
sourceType: 0
sourceButton: 4
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 7
sourceType: 0
sourceButton: 5
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 4
sourceType: 0
sourceButton: 6
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 6
sourceType: 0
sourceButton: 7
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 8
sourceType: 0
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 9
sourceType: 0
sourceButton: 9
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 14
sourceType: 0
sourceButton: 10
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 15
sourceType: 0
sourceButton: 11
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 16
sourceType: 2
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 17
sourceType: 2
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 1
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 19
sourceType: 2
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 2
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 18
sourceType: 2
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 3
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
variants: []
windowsUWP:
description:
matchingCriteria:
axisCount: 4
buttonCount: 12
disabled: 0
tag:
hatCount: 1
alternateElementCounts: []
manufacturer_useRegex: 0
productName_useRegex: 0
manufacturer: []
productName:
- Thrustmaster dual analog 3.2
productGUID:
- b315044f
elements:
axes:
- elementIdentifier: 0
sourceType: 1
sourceAxis: 0
sourceAxisRange: 0
invert: 0
axisDeadZone: .200000003
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
alternateCalibrations: []
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
- elementIdentifier: 1
sourceType: 1
sourceAxis: 1
sourceAxisRange: 0
invert: 1
axisDeadZone: .200000003
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
alternateCalibrations: []
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
- elementIdentifier: 2
sourceType: 1
sourceAxis: 5
sourceAxisRange: 0
invert: 0
axisDeadZone: .200000003
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
alternateCalibrations: []
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
- elementIdentifier: 3
sourceType: 1
sourceAxis: 6
sourceAxisRange: 0
invert: 1
axisDeadZone: .200000003
calibrateAxis: 0
axisZero: 0
axisMin: 0
axisMax: 0
alternateCalibrations: []
axisInfo:
_dataFormat: 0
_excludeFromPolling: 0
_specialAxisType: 0
sourceButton: 0
buttonAxisContribution: 0
sourceHat: 0
sourceHatDirection: 0
sourceHatRange: 0
buttons:
- elementIdentifier: 10
sourceType: 0
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 11
sourceType: 0
sourceButton: 2
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 12
sourceType: 0
sourceButton: 1
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 13
sourceType: 0
sourceButton: 3
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 5
sourceType: 0
sourceButton: 4
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 7
sourceType: 0
sourceButton: 5
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 4
sourceType: 0
sourceButton: 6
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 6
sourceType: 0
sourceButton: 7
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 8
sourceType: 0
sourceButton: 8
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 9
sourceType: 0
sourceButton: 9
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 14
sourceType: 0
sourceButton: 10
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 15
sourceType: 0
sourceButton: 11
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 16
sourceType: 2
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 0
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 17
sourceType: 2
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 1
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 19
sourceType: 2
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 2
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
- elementIdentifier: 18
sourceType: 2
sourceButton: 0
sourceAxis: 0
sourceAxisPole: 0
axisDeadZone: 0
sourceHat: 0
sourceHatType: 0
sourceHatDirection: 3
requireMultipleButtons: 0
requiredButtons:
ignoreIfButtonsActive: 0
ignoreIfButtonsActiveButtons:
buttonInfo:
_excludeFromPolling: 0
_isPressureSensitive: 0
variants: []
fallback_Windows:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_WindowsUWP:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_OSX:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_Linux:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_Linux_PreConfigured:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_Android:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_iOS:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_Blackberry:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_WindowsPhone8:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_XBox360:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_XBoxOne:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_PS3:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_PS4:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_PSM:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_PSVita:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_Wii:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_WiiU:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_AmazonFireTV:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
fallback_RazerForgeTV:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
matchUnityVersion: 0
matchUnityVersion_min:
matchUnityVersion_max:
matchSysVersion: 0
matchSysVersion_min:
matchSysVersion_max:
elements:
axes: []
buttons: []
variants: []
webGL:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
productGUID: []
mapping:
elementCount: []
clientInfo: []
elements:
axes: []
buttons: []
variants: []
ouya:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
elements:
axes: []
buttons: []
variants: []
xboxOne:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
elements:
axes: []
buttons: []
variants: []
ps4:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
elements:
axes: []
buttons: []
variants: []
nintendoSwitch:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
elements:
axes: []
buttons: []
variants: []
internalDriver:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
alwaysMatch: 0
productName_useRegex: 0
productName: []
vidPid: []
hatCount: 0
elements:
axes: []
buttons: []
variants: []
sdl2_Linux:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
hatCount: 0
manufacturer_useRegex: 0
productName_useRegex: 0
systemName_useRegex: 0
manufacturer: []
productName: []
systemName: []
productGUID: []
elements:
axes: []
buttons: []
variants: []
sdl2_Windows:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
hatCount: 0
manufacturer_useRegex: 0
productName_useRegex: 0
systemName_useRegex: 0
manufacturer: []
productName: []
systemName: []
productGUID: []
elements:
axes: []
buttons: []
variants: []
sdl2_OSX:
description:
matchingCriteria:
axisCount: 0
buttonCount: 0
disabled: 0
tag:
hatCount: 0
manufacturer_useRegex: 0
productName_useRegex: 0
systemName_useRegex: 0
manufacturer: []
productName: []
systemName: []
productGUID: []
elements:
axes: []
buttons: []
variants: []
elementIdentifierIdCounter: 22
|
jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/ThrustmasterDualAnalog3.asset/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/ThrustmasterDualAnalog3.asset",
"repo_id": "jynew",
"token_count": 22580
}
| 1,511 |
fileFormatVersion: 2
guid: 92f29122ea90781419cd0403e0143d67
labels:
- Input
- Joysticks
- Controllers
- Rewired
- Hotplugging
- Keyboard
- Mouse
- Touch
- InputManager
- Control
- Gamepad
- Controller
- Joystick
- Xbox360
- XInput
- DirectInput
TextScriptImporter:
userData:
|
jynew/jyx2/Assets/Plugins/Rewired/Internal/Libraries/Runtime/Rewired_Core.XML.meta/0
|
{
"file_path": "jynew/jyx2/Assets/Plugins/Rewired/Internal/Libraries/Runtime/Rewired_Core.XML.meta",
"repo_id": "jynew",
"token_count": 103
}
| 1,512 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.