maint: added livewatch asset
This commit is contained in:
30
Assets/Plugins/LiveWatchLite/Scripts/API/Watch.cs
Normal file
30
Assets/Plugins/LiveWatchLite/Scripts/API/Watch.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ingvar.LiveWatch
|
||||
{
|
||||
public static partial class Watch
|
||||
{
|
||||
public static char PathSeparator { get; set; } = '/';
|
||||
|
||||
internal static int MaxRecursionDepth = 100;
|
||||
|
||||
public static bool IsLive
|
||||
{
|
||||
get => WatchStorageSO.instance.IsLive;
|
||||
set => WatchStorageSO.instance.IsLive = value;
|
||||
}
|
||||
|
||||
internal static WatchStorage Watches
|
||||
{
|
||||
get => WatchStorageSO.instance.Watches;
|
||||
set
|
||||
{
|
||||
DestroyAll();
|
||||
WatchStorageSO.instance.Watches = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
10
Assets/Plugins/LiveWatchLite/Scripts/API/Watch.cs.meta
Normal file
10
Assets/Plugins/LiveWatchLite/Scripts/API/Watch.cs.meta
Normal file
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0ced31b9fdad40c1bc42f90d63659828
|
||||
timeCreated: 1643051681
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 324001
|
||||
packageName: LiveWatch Lite | Debug with full history of changes
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/LiveWatchLite/Scripts/API/Watch.cs
|
||||
uploadId: 770587
|
||||
102
Assets/Plugins/LiveWatchLite/Scripts/API/WatchReference.cs
Normal file
102
Assets/Plugins/LiveWatchLite/Scripts/API/WatchReference.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ingvar.LiveWatch
|
||||
{
|
||||
/// <summary>
|
||||
/// Type for generic Watch methods when you don't know what type it is, or don't want use type based functionality
|
||||
/// </summary>
|
||||
public class Any
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public partial struct WatchReference<T>
|
||||
{
|
||||
internal WatchVariable WatchVariable { get; }
|
||||
|
||||
public int ChildCount
|
||||
{
|
||||
get
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return WatchVariable.Childs.Count;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
internal WatchReference(WatchVariable watchVariable)
|
||||
{
|
||||
WatchVariable = watchVariable;
|
||||
}
|
||||
|
||||
public WatchReference<T> SetAlwaysCollapsable()
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
WatchVariable.RuntimeMeta.AlwaysShrinkable = true;
|
||||
#endif
|
||||
return this;
|
||||
}
|
||||
|
||||
public WatchReference<T> SetDecimalPlaces(int value)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
WatchVariable.RuntimeMeta.DecimalPlaces = value;
|
||||
#endif
|
||||
return this;
|
||||
}
|
||||
|
||||
public WatchReference<T> SetSortOrder(int value)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
if (!WatchVariable.RuntimeMeta.IsOrderSet)
|
||||
{
|
||||
WatchVariable.RuntimeMeta.SortOrder = value;
|
||||
WatchVariable.RuntimeMeta.IsOrderSet = true;
|
||||
WatchVariable.RuntimeMeta.IsSortingRequired = true;
|
||||
}
|
||||
#endif
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public WatchReference<T> UpdateOnce()
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
WatchVariable.RuntimeMeta.UpdateOnce = true;
|
||||
#endif
|
||||
return this;
|
||||
}
|
||||
|
||||
public WatchReference<T> PushEmptyValue(bool withRoot = true, int maxRecursionDepth = 10)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
if (Watch.IsLive)
|
||||
WatchServices.ReferenceCreator.PushEmpty(this, withRoot, maxRecursionDepth);
|
||||
#endif
|
||||
return this;
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetChildNames()
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return WatchVariable.Childs.SortedNames;
|
||||
#else
|
||||
return Array.Empty<string>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public WatchReference<V> GetOrAdd<V>(string path)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return WatchServices.ReferenceCreator.GetOrAdd<V, T>(this, path);
|
||||
#else
|
||||
return WatchServices.ReferenceCreator.Empty<V>();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bde558d1e19241fd9894b6507614c742
|
||||
timeCreated: 1643051866
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 324001
|
||||
packageName: LiveWatch Lite | Debug with full history of changes
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/LiveWatchLite/Scripts/API/WatchReference.cs
|
||||
uploadId: 770587
|
||||
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
|
||||
namespace Ingvar.LiveWatch
|
||||
{
|
||||
public partial struct WatchReference<T>
|
||||
{
|
||||
public WatchReference<double> GetOrAdd(string path, Func<double> valueGetter)
|
||||
{
|
||||
return Watch.GetOrAdd(this, path, valueGetter);
|
||||
}
|
||||
|
||||
public WatchReference<float> GetOrAdd(string path, Func<float> valueGetter)
|
||||
{
|
||||
return Watch.GetOrAdd(this, path, valueGetter);
|
||||
}
|
||||
|
||||
public WatchReference<int> GetOrAdd(string path, Func<int> valueGetter)
|
||||
{
|
||||
return Watch.GetOrAdd(this, path, valueGetter);
|
||||
}
|
||||
|
||||
public WatchReference<string> GetOrAdd(string path, Func<string> valueGetter)
|
||||
{
|
||||
return Watch.GetOrAdd(this, path, valueGetter);
|
||||
}
|
||||
|
||||
public WatchReference<bool> GetOrAdd(string path, Func<bool> valueGetter)
|
||||
{
|
||||
return Watch.GetOrAdd(this, path, valueGetter);
|
||||
}
|
||||
|
||||
public WatchReference<decimal> GetOrAdd(string path, Func<decimal> valueGetter)
|
||||
{
|
||||
return Watch.GetOrAdd(this, path, valueGetter);
|
||||
}
|
||||
|
||||
public WatchReference<long> GetOrAdd(string path, Func<long> valueGetter)
|
||||
{
|
||||
return Watch.GetOrAdd(this, path, valueGetter);
|
||||
}
|
||||
|
||||
public WatchReference<short> GetOrAdd(string path, Func<short> valueGetter)
|
||||
{
|
||||
return Watch.GetOrAdd(this, path, valueGetter);
|
||||
}
|
||||
|
||||
public WatchReference<byte> GetOrAdd(string path, Func<byte> valueGetter)
|
||||
{
|
||||
return Watch.GetOrAdd(this, path, valueGetter);
|
||||
}
|
||||
|
||||
public WatchReference<ulong> GetOrAdd(string path, Func<ulong> valueGetter)
|
||||
{
|
||||
return Watch.GetOrAdd(this, path, valueGetter);
|
||||
}
|
||||
|
||||
public WatchReference<ushort> GetOrAdd(string path, Func<ushort> valueGetter)
|
||||
{
|
||||
return Watch.GetOrAdd(this, path, valueGetter);
|
||||
}
|
||||
|
||||
public WatchReference<sbyte> GetOrAdd(string path, Func<sbyte> valueGetter)
|
||||
{
|
||||
return Watch.GetOrAdd(this, path, valueGetter);
|
||||
}
|
||||
|
||||
public WatchReference<char> GetOrAdd(string path, Func<char> valueGetter)
|
||||
{
|
||||
return Watch.GetOrAdd(this, path, valueGetter);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88d3577466c148bd8198f7e01c7835a1
|
||||
timeCreated: 1748342793
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 324001
|
||||
packageName: LiveWatch Lite | Debug with full history of changes
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/LiveWatchLite/Scripts/API/WatchReference_BasicTypes.cs
|
||||
uploadId: 770587
|
||||
55
Assets/Plugins/LiveWatchLite/Scripts/API/Watch_API.cs
Normal file
55
Assets/Plugins/LiveWatchLite/Scripts/API/Watch_API.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Ingvar.LiveWatch
|
||||
{
|
||||
public static partial class Watch
|
||||
{
|
||||
public static event Action OnClearedAll;
|
||||
public static event Action OnDestroyedAll;
|
||||
|
||||
public static WatchReference<T> GetOrAdd<T>(string path)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return WatchServices.ReferenceCreator.GetOrAdd<T>(path);
|
||||
#else
|
||||
return WatchServices.ReferenceCreator.Empty<T>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Any> PushEmpty(string path)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return WatchServices.ReferenceCreator.GetOrAdd<Any>(path).PushEmptyValue();
|
||||
#else
|
||||
return WatchServices.ReferenceCreator.Empty<Any>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void UpdateAll()
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
WatchServices.VariableUpdater.UpdateAll();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void ClearAll()
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
WatchServices.VariableUpdater.ClearAll();
|
||||
|
||||
OnClearedAll?.Invoke();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void DestroyAll()
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
WatchServices.VariableUpdater.ClearAll();
|
||||
Watches.Clear();
|
||||
|
||||
OnDestroyedAll?.Invoke();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
10
Assets/Plugins/LiveWatchLite/Scripts/API/Watch_API.cs.meta
Normal file
10
Assets/Plugins/LiveWatchLite/Scripts/API/Watch_API.cs.meta
Normal file
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d8dd881e863b44138a5167c7d7feb882
|
||||
timeCreated: 1652649243
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 324001
|
||||
packageName: LiveWatch Lite | Debug with full history of changes
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/LiveWatchLite/Scripts/API/Watch_API.cs
|
||||
uploadId: 770587
|
||||
841
Assets/Plugins/LiveWatchLite/Scripts/API/Watch_BaseTypes.cs
Normal file
841
Assets/Plugins/LiveWatchLite/Scripts/API/Watch_BaseTypes.cs
Normal file
@@ -0,0 +1,841 @@
|
||||
#pragma warning disable CS0162
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Ingvar.LiveWatch;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace Ingvar.LiveWatch
|
||||
{
|
||||
// It's completely generated class, avoid modifying!
|
||||
public static partial class Watch
|
||||
{
|
||||
private static string _tempStr;
|
||||
private static HashSet<string> _tempStrSet = new();
|
||||
private static Dictionary<object, HashSet<string>> _tempSetDict = new();
|
||||
private static WatchReferenceCreator RC = WatchServices.ReferenceCreator;
|
||||
private static WatchCachedNamesBuilder NB = WatchServices.NameBuilder;
|
||||
|
||||
#region Double
|
||||
|
||||
public static WatchReference<Double> GetOrAdd(string path, Func<Double> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Double>(path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Double>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Double> GetOrAdd<T>(WatchReference<T> parent, string path, Func<Double> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Double, T>(parent, path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Double>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Double> Setup(WatchReference<Double> wr)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return RC.TrySetupAs(wr, WatchValueType.Double);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Double> Push(WatchReference<Double> wr, Double value, int depth = 10)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
if (depth <= 0 || !Watch.IsLive || RC.IsInvalidType(wr))
|
||||
return wr;
|
||||
|
||||
Setup(wr);
|
||||
RC.PushDouble(wr, value);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Double> Push(string path, Double value, int depth = 10)
|
||||
{
|
||||
return Push(RC.GetOrAdd<Double>(path), value, depth);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Single
|
||||
|
||||
public static WatchReference<Single> GetOrAdd(string path, Func<Single> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Single>(path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Single>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Single> GetOrAdd<T>(WatchReference<T> parent, string path, Func<Single> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Single, T>(parent, path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Single>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Single> Setup(WatchReference<Single> wr)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return RC.TrySetupAs(wr, WatchValueType.Float);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Single> Push(WatchReference<Single> wr, Single value, int depth = 10)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
if (depth <= 0 || !Watch.IsLive || RC.IsInvalidType(wr))
|
||||
return wr;
|
||||
|
||||
Setup(wr);
|
||||
RC.PushFloat(wr, value);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Single> Push(string path, Single value, int depth = 10)
|
||||
{
|
||||
return Push(RC.GetOrAdd<Single>(path), value, depth);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Int32
|
||||
|
||||
public static WatchReference<Int32> GetOrAdd(string path, Func<Int32> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Int32>(path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Int32>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Int32> GetOrAdd<T>(WatchReference<T> parent, string path, Func<Int32> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Int32, T>(parent, path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Int32>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Int32> Setup(WatchReference<Int32> wr)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return RC.TrySetupAs(wr, WatchValueType.Int);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Int32> Push(WatchReference<Int32> wr, Int32 value, int depth = 10)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
if (depth <= 0 || !Watch.IsLive || RC.IsInvalidType(wr))
|
||||
return wr;
|
||||
|
||||
Setup(wr);
|
||||
RC.PushInt(wr, value);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Int32> Push(string path, Int32 value, int depth = 10)
|
||||
{
|
||||
return Push(RC.GetOrAdd<Int32>(path), value, depth);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region String
|
||||
|
||||
public static WatchReference<String> GetOrAdd(string path, Func<String> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<String>(path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<String>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<String> GetOrAdd<T>(WatchReference<T> parent, string path, Func<String> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<String, T>(parent, path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<String>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<String> Setup(WatchReference<String> wr)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return RC.TrySetupAs(wr, WatchValueType.String);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<String> Push(WatchReference<String> wr, String value, int depth = 10)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
if (depth <= 0 || !Watch.IsLive || RC.IsInvalidType(wr))
|
||||
return wr;
|
||||
|
||||
Setup(wr);
|
||||
if (value == null)
|
||||
return RC.PushNull(wr, depth - 1);
|
||||
|
||||
RC.PushString(wr, value);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<String> Push(string path, String value, int depth = 10)
|
||||
{
|
||||
return Push(RC.GetOrAdd<String>(path), value, depth);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Boolean
|
||||
|
||||
public static WatchReference<Boolean> GetOrAdd(string path, Func<Boolean> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Boolean>(path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Boolean>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Boolean> GetOrAdd<T>(WatchReference<T> parent, string path, Func<Boolean> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Boolean, T>(parent, path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Boolean>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Boolean> Setup(WatchReference<Boolean> wr)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return RC.TrySetupAs(wr, WatchValueType.Bool);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Boolean> Push(WatchReference<Boolean> wr, Boolean value, int depth = 10)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
if (depth <= 0 || !Watch.IsLive || RC.IsInvalidType(wr))
|
||||
return wr;
|
||||
|
||||
Setup(wr);
|
||||
RC.PushBool(wr, value);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Boolean> Push(string path, Boolean value, int depth = 10)
|
||||
{
|
||||
return Push(RC.GetOrAdd<Boolean>(path), value, depth);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Decimal
|
||||
|
||||
public static WatchReference<Decimal> GetOrAdd(string path, Func<Decimal> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Decimal>(path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Decimal>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Decimal> GetOrAdd<T>(WatchReference<T> parent, string path, Func<Decimal> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Decimal, T>(parent, path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Decimal>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Decimal> Setup(WatchReference<Decimal> wr)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return RC.TrySetupAs(wr, WatchValueType.Double);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Decimal> Push(WatchReference<Decimal> wr, Decimal value, int depth = 10)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
if (depth <= 0 || !Watch.IsLive || RC.IsInvalidType(wr))
|
||||
return wr;
|
||||
|
||||
Setup(wr);
|
||||
RC.PushDecimal(wr, value);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Decimal> Push(string path, Decimal value, int depth = 10)
|
||||
{
|
||||
return Push(RC.GetOrAdd<Decimal>(path), value, depth);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Int64
|
||||
|
||||
public static WatchReference<Int64> GetOrAdd(string path, Func<Int64> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Int64>(path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Int64>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Int64> GetOrAdd<T>(WatchReference<T> parent, string path, Func<Int64> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Int64, T>(parent, path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Int64>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Int64> Setup(WatchReference<Int64> wr)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return RC.TrySetupAs(wr, WatchValueType.Double);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Int64> Push(WatchReference<Int64> wr, Int64 value, int depth = 10)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
if (depth <= 0 || !Watch.IsLive || RC.IsInvalidType(wr))
|
||||
return wr;
|
||||
|
||||
Setup(wr);
|
||||
RC.PushLong(wr, value);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Int64> Push(string path, Int64 value, int depth = 10)
|
||||
{
|
||||
return Push(RC.GetOrAdd<Int64>(path), value, depth);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Int16
|
||||
|
||||
public static WatchReference<Int16> GetOrAdd(string path, Func<Int16> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Int16>(path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Int16>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Int16> GetOrAdd<T>(WatchReference<T> parent, string path, Func<Int16> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Int16, T>(parent, path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Int16>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Int16> Setup(WatchReference<Int16> wr)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return RC.TrySetupAs(wr, WatchValueType.Int);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Int16> Push(WatchReference<Int16> wr, Int16 value, int depth = 10)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
if (depth <= 0 || !Watch.IsLive || RC.IsInvalidType(wr))
|
||||
return wr;
|
||||
|
||||
Setup(wr);
|
||||
RC.PushShort(wr, value);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Int16> Push(string path, Int16 value, int depth = 10)
|
||||
{
|
||||
return Push(RC.GetOrAdd<Int16>(path), value, depth);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Byte
|
||||
|
||||
public static WatchReference<Byte> GetOrAdd(string path, Func<Byte> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Byte>(path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Byte>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Byte> GetOrAdd<T>(WatchReference<T> parent, string path, Func<Byte> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Byte, T>(parent, path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Byte>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Byte> Setup(WatchReference<Byte> wr)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return RC.TrySetupAs(wr, WatchValueType.Int);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Byte> Push(WatchReference<Byte> wr, Byte value, int depth = 10)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
if (depth <= 0 || !Watch.IsLive || RC.IsInvalidType(wr))
|
||||
return wr;
|
||||
|
||||
Setup(wr);
|
||||
RC.PushByte(wr, value);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Byte> Push(string path, Byte value, int depth = 10)
|
||||
{
|
||||
return Push(RC.GetOrAdd<Byte>(path), value, depth);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region UInt64
|
||||
|
||||
public static WatchReference<UInt64> GetOrAdd(string path, Func<UInt64> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<UInt64>(path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<UInt64>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<UInt64> GetOrAdd<T>(WatchReference<T> parent, string path, Func<UInt64> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<UInt64, T>(parent, path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<UInt64>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<UInt64> Setup(WatchReference<UInt64> wr)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return RC.TrySetupAs(wr, WatchValueType.Double);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<UInt64> Push(WatchReference<UInt64> wr, UInt64 value, int depth = 10)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
if (depth <= 0 || !Watch.IsLive || RC.IsInvalidType(wr))
|
||||
return wr;
|
||||
|
||||
Setup(wr);
|
||||
RC.PushULong(wr, value);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<UInt64> Push(string path, UInt64 value, int depth = 10)
|
||||
{
|
||||
return Push(RC.GetOrAdd<UInt64>(path), value, depth);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region UInt16
|
||||
|
||||
public static WatchReference<UInt16> GetOrAdd(string path, Func<UInt16> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<UInt16>(path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<UInt16>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<UInt16> GetOrAdd<T>(WatchReference<T> parent, string path, Func<UInt16> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<UInt16, T>(parent, path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<UInt16>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<UInt16> Setup(WatchReference<UInt16> wr)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return RC.TrySetupAs(wr, WatchValueType.Int);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<UInt16> Push(WatchReference<UInt16> wr, UInt16 value, int depth = 10)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
if (depth <= 0 || !Watch.IsLive || RC.IsInvalidType(wr))
|
||||
return wr;
|
||||
|
||||
Setup(wr);
|
||||
RC.PushUShort(wr, value);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<UInt16> Push(string path, UInt16 value, int depth = 10)
|
||||
{
|
||||
return Push(RC.GetOrAdd<UInt16>(path), value, depth);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region SByte
|
||||
|
||||
public static WatchReference<SByte> GetOrAdd(string path, Func<SByte> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<SByte>(path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<SByte>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<SByte> GetOrAdd<T>(WatchReference<T> parent, string path, Func<SByte> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<SByte, T>(parent, path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<SByte>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<SByte> Setup(WatchReference<SByte> wr)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return RC.TrySetupAs(wr, WatchValueType.Int);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<SByte> Push(WatchReference<SByte> wr, SByte value, int depth = 10)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
if (depth <= 0 || !Watch.IsLive || RC.IsInvalidType(wr))
|
||||
return wr;
|
||||
|
||||
Setup(wr);
|
||||
RC.PushSByte(wr, value);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<SByte> Push(string path, SByte value, int depth = 10)
|
||||
{
|
||||
return Push(RC.GetOrAdd<SByte>(path), value, depth);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Char
|
||||
|
||||
public static WatchReference<Char> GetOrAdd(string path, Func<Char> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Char>(path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Char>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Char> GetOrAdd<T>(WatchReference<T> parent, string path, Func<Char> valueGetter)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
var wr = Setup(RC.GetOrAdd<Char, T>(parent, path));
|
||||
|
||||
RC.SetUpdateCall(wr, () =>
|
||||
{
|
||||
var value = valueGetter();
|
||||
Push(wr, value);
|
||||
});
|
||||
|
||||
return wr;
|
||||
#else
|
||||
return RC.Empty<Char>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static WatchReference<Char> Setup(WatchReference<Char> wr)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
return RC.TrySetupAs(wr, WatchValueType.String);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Char> Push(WatchReference<Char> wr, Char value, int depth = 10)
|
||||
{
|
||||
#if UNITY_EDITOR || LIVE_WATCH_BUILD
|
||||
if (depth <= 0 || !Watch.IsLive || RC.IsInvalidType(wr))
|
||||
return wr;
|
||||
|
||||
Setup(wr);
|
||||
RC.PushChar(wr, value);
|
||||
#endif
|
||||
return wr;
|
||||
}
|
||||
|
||||
public static WatchReference<Char> Push(string path, Char value, int depth = 10)
|
||||
{
|
||||
return Push(RC.GetOrAdd<Char>(path), value, depth);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c1a460e3212a4e6f8328f8e396c05609
|
||||
timeCreated: 1652647985
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 324001
|
||||
packageName: LiveWatch Lite | Debug with full history of changes
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/LiveWatchLite/Scripts/API/Watch_BaseTypes.cs
|
||||
uploadId: 770587
|
||||
1065
Assets/Plugins/LiveWatchLite/Scripts/API/Watch_UnityTypes.cs
Normal file
1065
Assets/Plugins/LiveWatchLite/Scripts/API/Watch_UnityTypes.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: faafb2df84004a18b24814642303ad28
|
||||
timeCreated: 1652628751
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 324001
|
||||
packageName: LiveWatch Lite | Debug with full history of changes
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/LiveWatchLite/Scripts/API/Watch_UnityTypes.cs
|
||||
uploadId: 770587
|
||||
Reference in New Issue
Block a user