maint: added livewatch asset
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ingvar.LiveWatch
|
||||
{
|
||||
[Serializable]
|
||||
public struct SearchQueryResult
|
||||
{
|
||||
public bool IsPositive;
|
||||
public bool IsWholeSelection;
|
||||
public int SelectionStartIndex;
|
||||
public int SelectionEndIndex;
|
||||
public int IndexOfResultInTotalList;
|
||||
|
||||
public static SearchQueryResult True() => new ()
|
||||
{ IsPositive = true, IsWholeSelection = true};
|
||||
public static SearchQueryResult True(int selectionStart, int selectionEnd) => new ()
|
||||
{ IsPositive = true, SelectionStartIndex = selectionStart, SelectionEndIndex = selectionEnd};
|
||||
public static SearchQueryResult False() => new ()
|
||||
{ IsPositive = false };
|
||||
|
||||
public static SearchQueryResult And(SearchQueryResult left, SearchQueryResult right)
|
||||
{
|
||||
if (!left.IsPositive || !right.IsPositive)
|
||||
{
|
||||
return SearchQueryResult.False();
|
||||
}
|
||||
|
||||
if (left.IsWholeSelection && right.IsWholeSelection)
|
||||
{
|
||||
return SearchQueryResult.True();
|
||||
}
|
||||
|
||||
if (!left.IsWholeSelection && right.IsWholeSelection)
|
||||
{
|
||||
return left;
|
||||
}
|
||||
|
||||
if (left.IsWholeSelection && !right.IsWholeSelection)
|
||||
{
|
||||
return right;
|
||||
}
|
||||
|
||||
if (!left.IsWholeSelection && !right.IsWholeSelection)
|
||||
{
|
||||
var greater = right.SelectionEndIndex >= left.SelectionEndIndex ? right : left;
|
||||
var lesser = greater.Equals(right) ? left : right;
|
||||
|
||||
if (lesser.SelectionEndIndex < greater.SelectionStartIndex)
|
||||
{
|
||||
return SearchQueryResult.False();
|
||||
}
|
||||
else
|
||||
{
|
||||
return SearchQueryResult.True(lesser.SelectionEndIndex, greater.SelectionEndIndex);
|
||||
}
|
||||
}
|
||||
|
||||
return SearchQueryResult.False();
|
||||
}
|
||||
|
||||
public static SearchQueryResult Or(SearchQueryResult left, SearchQueryResult right)
|
||||
{
|
||||
if (!left.IsPositive && !right.IsPositive)
|
||||
{
|
||||
return SearchQueryResult.False();
|
||||
}
|
||||
|
||||
if (left.IsWholeSelection || right.IsWholeSelection)
|
||||
{
|
||||
return SearchQueryResult.True();
|
||||
}
|
||||
|
||||
if (left.IsPositive && !right.IsPositive)
|
||||
{
|
||||
return left;
|
||||
}
|
||||
|
||||
if (!left.IsPositive && right.IsPositive)
|
||||
{
|
||||
return right;
|
||||
}
|
||||
|
||||
var startIndex = Mathf.Min(left.SelectionStartIndex, right.SelectionStartIndex);
|
||||
var endIndex = Mathf.Min(left.SelectionEndIndex, right.SelectionEndIndex);
|
||||
|
||||
return SearchQueryResult.True(startIndex, endIndex);
|
||||
}
|
||||
|
||||
public static SearchQueryResult Inverse(SearchQueryResult result)
|
||||
{
|
||||
return result.IsPositive ? SearchQueryResult.False() : SearchQueryResult.True();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1ae5070b6cc44484ab755658884825c4
|
||||
timeCreated: 1676574950
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 324001
|
||||
packageName: LiveWatch Lite | Debug with full history of changes
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/LiveWatchLite/Scripts/WatchVariable/EditorMeta/SearchQueryResult.cs
|
||||
uploadId: 770587
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace Ingvar.LiveWatch
|
||||
{
|
||||
[Serializable]
|
||||
public class VariableEditorMeta
|
||||
{
|
||||
public bool IsExpanded;
|
||||
|
||||
[NonSerialized] public int LastStringToNumberValue = -1;
|
||||
[NonSerialized] public Dictionary<string, int> StringToNumberValues;
|
||||
[NonSerialized] public VariableSearchResultMeta SearchResult;
|
||||
[NonSerialized] public int LastNonShrinkableIndexOfKey = -1;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da5ca5ec46ce416a8466282e16742c2f
|
||||
timeCreated: 1637094877
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 324001
|
||||
packageName: LiveWatch Lite | Debug with full history of changes
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/LiveWatchLite/Scripts/WatchVariable/EditorMeta/VariableEditorMeta.cs
|
||||
uploadId: 770587
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ingvar.LiveWatch
|
||||
{
|
||||
public struct VariableSearchResultMeta
|
||||
{
|
||||
public bool IsValueResults => ValueResults is { Count: > 0 };
|
||||
public SearchQueryResult NameResult;
|
||||
public Dictionary<int, SearchQueryResult> ValueResults;
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
NameResult.IsPositive = false;
|
||||
ValueResults?.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 965ed9a778a14c5ba3a060daa54f5864
|
||||
timeCreated: 1669563007
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 324001
|
||||
packageName: LiveWatch Lite | Debug with full history of changes
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/LiveWatchLite/Scripts/WatchVariable/EditorMeta/VariableSearchResultMeta.cs
|
||||
uploadId: 770587
|
||||
Reference in New Issue
Block a user