fix(playground): fixed minor UI/UX issues with specklePlayground

This commit is contained in:
JR-Morgan
2022-10-27 17:22:58 +01:00
parent 065d4c0fd5
commit 698513da48
5 changed files with 54 additions and 28 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ using UnityEngine;
public class CameraOperate : MonoBehaviour
{
[Tooltip("Mouse wheel rolling control lens please enter, the speed of the back")]
[Range(0.5f, 10f)] public float scrollSpeed = 10f;
[Range(0f, 10f)] public float scrollSpeed = 10f;
[Tooltip("Right mouse button control lens X axis rotation speed")]
[Range(0.5f, 2f)] public float rotateXSpeed = 1f;
[Tooltip("Right mouse button control lens Y axis rotation speed")]
+7 -5
View File
@@ -32,9 +32,11 @@ namespace Speckle.ConnectorUnity
//populate branches
branchesDropdown.options.Clear();
foreach (var branch in receiver.Stream.branches.items)
List<Branch> branches = receiver.Stream.branches.items;
branches.Reverse();
foreach (Branch branch in branches)
{
branchesDropdown.options.Add(new Dropdown.OptionData(branch.name));
branchesDropdown.options.Add(new Dropdown.OptionData(branch.name.Replace(' ', '\u00A0')));
}
//trigger ui refresh, maybe there's a better method
@@ -45,7 +47,7 @@ namespace Speckle.ConnectorUnity
if (index == -1)
return;
receiver.BranchName = receiver.Stream.branches.items[index].name;
receiver.BranchName = branches[index].name;
});
receiver.Init(stream.id, autoReceive, true,
@@ -159,13 +161,13 @@ namespace Speckle.ConnectorUnity
sendProgress.gameObject.SetActive(false); //hide
});
},
onErrorAction: (id, e) =>
onErrorAction: (message, e) =>
{
Debug.LogError("Send operation Failed!", this);
Dispatcher.Instance().Enqueue(() =>
{
MakeButtonsInteractable(true);
statusText.text = $"Error {id}";
statusText.text = $"Error {message}";
sendProgress.gameObject.SetActive(false); //hide
Debug.LogError(e, this);
});
+3 -3
View File
@@ -4111,11 +4111,11 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
SelectedAccountIndex: 0
SelectedStreamIndex: 15
SelectedBranchIndex: 0
SelectedStreamIndex: 8
SelectedBranchIndex: 1
SelectedCommitIndex: 0
OldSelectedAccountIndex: 0
OldSelectedStreamIndex: 15
OldSelectedStreamIndex: 8
--- !u!114 &2060322469
MonoBehaviour:
m_ObjectHideFlags: 0
+28 -4
View File
@@ -28,6 +28,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3452469119923756171}
m_RootOrder: 0
@@ -103,6 +104,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1187114122788282811}
m_RootOrder: 3
@@ -183,6 +185,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6020342713586502030}
m_Father: {fileID: 7556766085298809888}
@@ -308,6 +311,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3140626913919314916}
m_RootOrder: 1
@@ -383,6 +387,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 102303468818191937}
m_RootOrder: 0
@@ -463,6 +468,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 603356138192389748}
m_Father: {fileID: 7556766085298809888}
@@ -552,6 +558,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3140626913919314916}
m_RootOrder: 0
@@ -629,6 +636,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3452469119923756171}
m_Father: {fileID: 2443777670835029483}
@@ -667,6 +675,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8259817509940803332}
m_RootOrder: 0
@@ -726,7 +735,7 @@ GameObject:
- component: {fileID: 2100176054962759916}
- component: {fileID: 254853880357269643}
m_Layer: 5
m_Name: StreamPanel 1
m_Name: StreamPanel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -742,6 +751,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 102303468818191937}
- {fileID: 3140626913919314916}
@@ -823,6 +833,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2443777670835029483}
- {fileID: 4467957676443937226}
@@ -931,6 +942,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 7392037013616821269}
- {fileID: 8259817509940803332}
@@ -1063,6 +1075,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 5702098015768582807}
- {fileID: 6679144287931550080}
@@ -1153,6 +1166,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3452469119923756171}
m_RootOrder: 2
@@ -1233,6 +1247,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2052973192117566328}
m_Father: {fileID: 1187114122788282811}
@@ -1321,7 +1336,7 @@ MonoBehaviour:
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 0}
m_TargetGraphic: {fileID: 7169743734853655954}
m_OnClick:
m_PersistentCalls:
m_Calls: []
@@ -1353,6 +1368,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2617971973288675133}
m_RootOrder: 0
@@ -1432,6 +1448,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3452469119923756171}
m_RootOrder: 1
@@ -1507,6 +1524,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6679144287931550080}
m_RootOrder: 0
@@ -1580,6 +1598,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4127142461058788395}
m_Father: {fileID: 8259817509940803332}
@@ -1618,6 +1637,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1187114122788282811}
m_RootOrder: 2
@@ -1698,6 +1718,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4559588495107889264}
m_Father: {fileID: 4467957676443937226}
@@ -1735,6 +1756,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 5904362841980777272}
- {fileID: 4621970763822558170}
@@ -1823,6 +1845,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6020342713586502030}
m_RootOrder: 0
@@ -1899,6 +1922,7 @@ RectTransform:
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 817718653825013287}
- {fileID: 8018867261834699774}
@@ -1908,8 +1932,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 146.5, y: -62.2}
m_SizeDelta: {x: 122.9, y: 30}
m_AnchoredPosition: {x: 128.64221, y: -62.2}
m_SizeDelta: {x: 158.6156, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8298570900796106430
CanvasRenderer:
+15 -15
View File
@@ -47,21 +47,21 @@ public class PerformanceTest
Assert.That(stopwatch.ElapsedMilliseconds, Is.Zero);
}
[UnityTest, TestCaseSource(nameof(dataSource))]
public IEnumerable Receive_Coroutine(string stream)
{
var stopwatch = Stopwatch.StartNew();
Task t = Helpers.Receive(stream);
t.Start();
yield return new WaitUntil(() => !t.IsCompleted || stopwatch.ElapsedMilliseconds >= 100000);
stopwatch.Stop();
Console.WriteLine(stopwatch.ElapsedMilliseconds);
Assert.That(stopwatch.ElapsedMilliseconds, Is.Zero);
Assert.True(t.IsCompletedSuccessfully);
}
// [UnityTest, TestCaseSource(nameof(dataSource))]
// public IEnumerable Receive_Coroutine(string stream)
// {
// var stopwatch = Stopwatch.StartNew();
//
// Task t = Helpers.Receive(stream);
// t.Start();
//
// yield return new WaitUntil(() => !t.IsCompleted || stopwatch.ElapsedMilliseconds >= 100000);
//
// stopwatch.Stop();
// Console.WriteLine(stopwatch.ElapsedMilliseconds);
// Assert.That(stopwatch.ElapsedMilliseconds, Is.Zero);
// Assert.True(t.IsCompletedSuccessfully);
// }
}