Skip to content

Commit 1b4eb51

Browse files
committed
style: all cs files reformatted, removed unused using
1 parent 76612f1 commit 1b4eb51

File tree

100 files changed

+578
-1063
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+578
-1063
lines changed

arcor2_AREditor/Assets/BASE/Scripts/Action.cs

Lines changed: 151 additions & 76 deletions
Large diffs are not rendered by default.

arcor2_AREditor/Assets/BASE/Scripts/ActionObject.cs

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Collections.Generic;
33
using System.Threading.Tasks;
44
using IO.Swagger.Model;
5-
using System;
65

76
namespace Base {
87
public abstract class ActionObject : InteractiveObject, IActionProvider, IActionPointParent {
@@ -44,7 +43,7 @@ public virtual void InitActionObject(IO.Swagger.Model.SceneObject sceneObject, V
4443
}
4544

4645
}
47-
46+
4847
public virtual void UpdateObjectName(string newUserId) {
4948
Data.Name = newUserId;
5049
SelectorItem.SetText(newUserId);
@@ -74,9 +73,9 @@ public virtual void ActionObjectUpdate(IO.Swagger.Model.SceneObject actionObject
7473
} else {
7574
ObjectParameters[p.Name].Value = p.Value;
7675
}
77-
76+
7877
}
79-
78+
8079
}
8180

8281
public void ResetPosition() {
@@ -98,7 +97,7 @@ public bool TryGetParameter(string id, out IO.Swagger.Model.Parameter parameter)
9897
parameter = null;
9998
return false;
10099
}
101-
100+
102101
public bool TryGetParameterMetadata(string id, out IO.Swagger.Model.ParameterMeta parameterMeta) {
103102
foreach (IO.Swagger.Model.ParameterMeta p in ActionObjectMetadata.Settings) {
104103
if (p.Name == id) {
@@ -109,7 +108,7 @@ public bool TryGetParameterMetadata(string id, out IO.Swagger.Model.ParameterMet
109108
parameterMeta = null;
110109
return false;
111110
}
112-
111+
113112
public abstract Vector3 GetScenePosition();
114113

115114
public abstract void SetScenePosition(Vector3 position);
@@ -146,7 +145,7 @@ public bool IsCamera() {
146145
public virtual void DeleteActionObject() {
147146
// Remove all actions of this action point
148147
RemoveActionPoints();
149-
148+
150149
// Remove this ActionObject reference from the scene ActionObject list
151150
SceneManager.Instance.ActionObjects.Remove(this.Data.Id);
152151

@@ -206,7 +205,7 @@ public override string GetName() {
206205
return Data.Name;
207206
}
208207

209-
208+
210209
public bool IsActionObject() {
211210
return true;
212211
}
@@ -245,45 +244,45 @@ public async override Task<RequestResult> Movable() {
245244
public abstract void CreateModel(IO.Swagger.Model.CollisionModels customCollisionModels = null);
246245
public abstract GameObject GetModelCopy();
247246

248-
public IO.Swagger.Model.Pose GetPose() {
249-
if (ActionObjectMetadata.HasPose)
250-
return new IO.Swagger.Model.Pose(position: DataHelper.Vector3ToPosition(TransformConvertor.UnityToROS(transform.localPosition)),
251-
orientation: DataHelper.QuaternionToOrientation(TransformConvertor.UnityToROS(transform.localRotation)));
252-
else
253-
return new IO.Swagger.Model.Pose(orientation: new IO.Swagger.Model.Orientation(), position: new IO.Swagger.Model.Position());
254-
}
255-
public async override Task Rename(string name) {
256-
try {
257-
await WebsocketManager.Instance.RenameObject(GetId(), name);
258-
Notifications.Instance.ShowToastMessage("Action object renamed");
259-
} catch (RequestFailedException e) {
260-
Notifications.Instance.ShowNotification("Failed to rename action object", e.Message);
261-
throw;
247+
public IO.Swagger.Model.Pose GetPose() {
248+
if (ActionObjectMetadata.HasPose)
249+
return new IO.Swagger.Model.Pose(position: DataHelper.Vector3ToPosition(TransformConvertor.UnityToROS(transform.localPosition)),
250+
orientation: DataHelper.QuaternionToOrientation(TransformConvertor.UnityToROS(transform.localRotation)));
251+
else
252+
return new IO.Swagger.Model.Pose(orientation: new IO.Swagger.Model.Orientation(), position: new IO.Swagger.Model.Position());
253+
}
254+
public async override Task Rename(string name) {
255+
try {
256+
await WebsocketManager.Instance.RenameObject(GetId(), name);
257+
Notifications.Instance.ShowToastMessage("Action object renamed");
258+
} catch (RequestFailedException e) {
259+
Notifications.Instance.ShowNotification("Failed to rename action object", e.Message);
260+
throw;
261+
}
262262
}
263-
}
264-
public async override Task<RequestResult> Removable() {
265-
if (GameManager.Instance.GetGameState() != GameManager.GameStateEnum.SceneEditor) {
266-
return new RequestResult(false, "Action object could be removed only in scene editor");
267-
} else if (SceneManager.Instance.SceneStarted) {
268-
return new RequestResult(false, "Scene online");
269-
} else {
263+
public async override Task<RequestResult> Removable() {
264+
if (GameManager.Instance.GetGameState() != GameManager.GameStateEnum.SceneEditor) {
265+
return new RequestResult(false, "Action object could be removed only in scene editor");
266+
} else if (SceneManager.Instance.SceneStarted) {
267+
return new RequestResult(false, "Scene online");
268+
} else {
270269
IO.Swagger.Model.RemoveFromSceneResponse response = await WebsocketManager.Instance.RemoveFromScene(GetId(), false, true);
271-
if (response.Result)
272-
return new RequestResult(true);
273-
else
274-
return new RequestResult(false, response.Messages[0]);
270+
if (response.Result)
271+
return new RequestResult(true);
272+
else
273+
return new RequestResult(false, response.Messages[0]);
274+
}
275275
}
276-
}
277276

278277

279-
public async override void Remove() {
278+
public async override void Remove() {
280279
IO.Swagger.Model.RemoveFromSceneResponse response =
281280
await WebsocketManager.Instance.RemoveFromScene(GetId(), false, false);
282-
if (!response.Result) {
283-
Notifications.Instance.ShowNotification("Failed to remove object " + GetName(), response.Messages[0]);
284-
return;
281+
if (!response.Result) {
282+
Notifications.Instance.ShowNotification("Failed to remove object " + GetName(), response.Messages[0]);
283+
return;
284+
}
285285
}
286-
}
287286

288287
public Transform GetSpawnPoint() {
289288
return transform;
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
using System;
21
using UnityEngine;
32

4-
namespace Base
5-
{
6-
public abstract class Clickable : MonoBehaviour
7-
{
3+
namespace Base {
4+
public abstract class Clickable : MonoBehaviour {
85
public enum Click {
96
MOUSE_LEFT_BUTTON = 0,
107
MOUSE_RIGHT_BUTTON = 1,
@@ -13,7 +10,7 @@ public enum Click {
1310
TOUCH = 4,
1411
LONG_TOUCH = 5,
1512
TOUCH_ENDED = 6,
16-
13+
1714
}
1815

1916
public bool Enabled = true;
@@ -24,6 +21,6 @@ public enum Click {
2421

2522
public abstract void OnHoverEnd();
2623

27-
24+
2825
}
2926
}

arcor2_AREditor/Assets/BASE/Scripts/CollisionObject.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
using System;
21
using System.Threading.Tasks;
32
using Base;
4-
using UnityEngine;
5-
public class CollisionObject : ActionObject3D
6-
{
3+
public class CollisionObject : ActionObject3D {
74
public override string GetObjectTypeName() {
85
return "Collision object";
96
}

arcor2_AREditor/Assets/BASE/Scripts/DataHelper.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System;
2-
using System.Collections;
31
using System.Collections.Generic;
42
using UnityEngine;
53

arcor2_AREditor/Assets/BASE/Scripts/DropdownEndEffectors.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Collections;
21
using System.Collections.Generic;
32
using UnityEngine;
43
using Michsky.UI.ModernUIPack;
@@ -24,8 +23,8 @@ public async Task Init(string robotId, string arm_id, UnityAction<string> onChan
2423
Debug.LogError(ex);
2524
Base.NotificationsModernUI.Instance.ShowNotification("End effector load failed", "Failed to load end effectors, try again later");
2625
}
27-
28-
26+
27+
2928
}
3029

3130
public void PutData(List<string> data, UnityAction<string> onChangeCallback) {

arcor2_AREditor/Assets/BASE/Scripts/DropdownRobots.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
using System.Collections;
21
using System.Collections.Generic;
32
using UnityEngine;
43
using UnityEngine.Events;
54
using Michsky.UI.ModernUIPack;
6-
using System.Linq;
75
using System.Threading.Tasks;
86
using Base;
9-
using System;
107

11-
public class DropdownRobots : MonoBehaviour
12-
{
8+
public class DropdownRobots : MonoBehaviour {
139
public DropdownParameter Dropdown;
1410

1511
/// <summary>
@@ -27,7 +23,7 @@ internal async Task Init(UnityAction<string> callback, bool withEEOnly, string s
2723
if (!withEEOnly) {
2824
foreach (IRobot robot in Base.SceneManager.Instance.GetRobots()) {
2925
robotNames.Add(robot.GetName());
30-
26+
3127
}
3228
} else if (withEEOnly && SceneManager.Instance.SceneStarted) {
3329
foreach (IRobot robot in Base.SceneManager.Instance.GetRobots()) {
@@ -47,7 +43,7 @@ public void Init(List<string> robotNames, UnityAction<string> callback, string s
4743
int selectedItemIndex = 0;
4844
foreach (string robotName in robotNames) {
4945
CustomDropdown.Item item = new CustomDropdown.Item {
50-
itemName = robotName
46+
itemName = robotName
5147
};
5248
if (robotName == selectedRobotName)
5349
selectedItemIndex = Dropdown.Dropdown.dropdownItems.Count;

arcor2_AREditor/Assets/BASE/Scripts/ManualTooltip.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
using System.Collections;
2-
using System.Collections.Generic;
31
using UnityEngine;
42
using Michsky.UI.ModernUIPack;
5-
using UnityEngine.EventSystems;
6-
using RuntimeInspectorNamespace;
7-
using TMPro;
83

94
[RequireComponent(typeof(TooltipContent))]
105
public class ManualTooltip : MonoBehaviour {
@@ -42,7 +37,7 @@ private void Start() {
4237
tooltipContent.enabled = false;
4338
return;
4439
}
45-
40+
4641

4742
if (DisplayAlternativeDescription) {
4843
ShowAlternativeDescription();

arcor2_AREditor/Assets/BASE/Scripts/MeshImporter.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using System.Net;
77
using Base;
88
using TriLibCore;
9-
using TriLibCore.General;
109
using UnityEngine;
1110
using UnityEngine.Networking;
1211

@@ -50,14 +49,16 @@ private void ImportMesh(string path, string aoId) {
5049

5150
GameObject loadedObject = new GameObject("ImportedMeshObject");
5251
if (Path.GetExtension(path).ToLower() == ".dae") {
53-
//Debug.LogError("importing dae mesh name: " + path);
52+
//Debug.LogError("importing dae mesh name: " + path);
5453
StreamReader reader = File.OpenText(path);
5554
string daeFile = reader.ReadToEnd();
5655

5756
// Requires Simple Collada asset from Unity Asset Store: https://assetstore.unity.com/packages/tools/input-management/simple-collada-19579
5857
// Supports: DAE
5958
StartCoroutine(ColladaImporter.Instance.ImportAsync(daeFile, Quaternion.identity, Vector3.one, Vector3.zero,
60-
onModelImported: delegate (GameObject loadedGameObject) { OnMeshImported?.Invoke(this, new ImportedMeshEventArgs(loadedGameObject, aoId));},
59+
onModelImported: delegate (GameObject loadedGameObject) {
60+
OnMeshImported?.Invoke(this, new ImportedMeshEventArgs(loadedGameObject, aoId));
61+
},
6162
wrapperGameObject: loadedObject));
6263

6364
} else {
@@ -97,7 +98,7 @@ private IEnumerator DownloadMesh(string meshId, string fileName, string aoId) {
9798
string savePath = string.Format("{0}/{1}", meshDirectory, fileName);
9899
System.IO.File.WriteAllBytes(savePath, www.downloadHandler.data);
99100
meshSources[fileName] = false;
100-
101+
101102
//Debug.LogError("MESH: download finished");
102103
//if the mesh is zipped, extract it
103104
if (Path.GetExtension(savePath).ToLower() == ".zip") {
@@ -147,7 +148,7 @@ private void OnMeshDownloaded(string meshID, string path, string aoId) {
147148
private string GetPathToMesh(string meshId) {
148149
if (Path.GetExtension(meshId).ToLower() == ".zip") {
149150
string path = string.Format("{0}/meshes/{1}/mesh/", Application.persistentDataPath, meshId);
150-
string[] extensions = { "dae", "fbx", "obj", "gltf2", "stl", "ply", "3mf"};
151+
string[] extensions = { "dae", "fbx", "obj", "gltf2", "stl", "ply", "3mf" };
151152
string[] files = { };
152153
foreach (var extension in extensions) {
153154
files = System.IO.Directory.GetFiles(path, "*." + extension);
@@ -198,7 +199,7 @@ public bool CheckIfNewerRobotModelExists(string meshId, string fileName) {
198199
// Check whether downloading can be started and start it, if so.
199200
return CanIDownload(meshId);
200201
}
201-
202+
202203
string uri = MainSettingsMenu.Instance.GetProjectServiceURI() + fileName;
203204
DateTime downloadedZipLastModified = meshFileInfo.LastWriteTime;
204205
try {
@@ -259,7 +260,7 @@ public GameObject RootGameObject {
259260
}
260261

261262
public string Name {
262-
get;set;
263+
get; set;
263264
}
264265

265266
public ImportedMeshEventArgs(GameObject gameObject, string name) {
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
using System.Collections;
2-
using System.Collections.Generic;
31
using UnityEngine;
42

5-
public class NotificationEntry : MonoBehaviour
6-
{
3+
public class NotificationEntry : MonoBehaviour {
74
public TMPro.TMP_Text Title, Description, Timestamp;
85
}

0 commit comments

Comments
 (0)