Skip to content

Commit

Permalink
Merge pull request #214 from Kapim/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
Kapim authored Apr 21, 2021
2 parents b28fef2 + 9dd8acc commit f1e2148
Show file tree
Hide file tree
Showing 37 changed files with 3,834 additions and 3,598 deletions.
2 changes: 1 addition & 1 deletion arcor2_AREditor/Assets/BASE/Scripts/Dialogs/Dialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public abstract class Dialog : MonoBehaviour
{
protected ModalWindowManager windowManager;

public virtual void Start() {
public virtual void Awake() {
windowManager = GetComponent<ModalWindowManager>();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ public class NewProjectDialog : Dialog
public GameObject TogglePrefab;
public TMPro.TMP_InputField NewProjectName;
public ButtonWithTooltip OKBtn;
public override void Start()
public void Start()
{
base.Start();
Base.GameManager.Instance.OnSceneListChanged += UpdateScenes;
}

Expand Down
2 changes: 1 addition & 1 deletion arcor2_AREditor/Assets/BASE/Scripts/EndAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public override void Init(IO.Swagger.Model.Action projectAction, Base.ActionMeta
parameters: new List<IO.Swagger.Model.ActionParameter>(),
type: "");
base.Init(prAction, metadata, ap, actionProvider, keySuffix);
transform.localPosition = PlayerPrefsHelper.LoadVector3(playerPrefsKey, new Vector3(-0.5f, 0, 0));
transform.localPosition = PlayerPrefsHelper.LoadVector3(playerPrefsKey, new Vector3(0, 0.1f, 0));
}


Expand Down
13 changes: 9 additions & 4 deletions arcor2_AREditor/Assets/BASE/Scripts/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ public class GameManager : Singleton<GameManager> {
/// </summary>
public event EventHandler OnActionExecutionCanceled;

public LeftMenuScene LeftMenuScene;
public LeftMenuProject LeftMenuProject;

/// <summary>
/// Holds current application state (opened screen)
/// </summary>
Expand Down Expand Up @@ -1129,14 +1126,19 @@ public async void PackageStateUpdated(IO.Swagger.Model.PackageStateData state) {
if (GetGameState() != GameStateEnum.PackageRunning) {
try {
WaitUntilPackageReady(5000);

if (PackageInfo == null)
return;
if (!await SceneManager.Instance.CreateScene(PackageInfo.Scene, false, PackageInfo.CollisionModels)) {
Notifications.Instance.SaveLogs(PackageInfo.Scene, PackageInfo.Project, "Failed to initialize scene");
return;
}
if (PackageInfo == null)
return;
if (!await ProjectManager.Instance.CreateProject(PackageInfo.Project, false)) {
Notifications.Instance.SaveLogs(PackageInfo.Scene, PackageInfo.Project, "Failed to initialize project");
}
if (PackageInfo == null)
return;
openPackageRunningScreenFlag = true;
if (state.State == PackageStateData.StateEnum.Paused) {
OnPausePackage?.Invoke(this, new ProjectMetaEventArgs(PackageInfo.PackageId, PackageInfo.PackageName));
Expand Down Expand Up @@ -1699,6 +1701,9 @@ public async void OpenPackageRunningScreen() {
#else
Scene.SetActive(true);
#endif

if (PackageInfo == null)
return;
OnRunPackage?.Invoke(this, new ProjectMetaEventArgs(PackageInfo.PackageId, PackageInfo.PackageName));
} catch (TimeoutException ex) {
Debug.LogError(ex);
Expand Down
2 changes: 1 addition & 1 deletion arcor2_AREditor/Assets/BASE/Scripts/RobotEE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public override string GetName() {
}

public override string GetId() {
return EEId;
return RobotId + "/" + EEId;
}

public override void OpenMenu() {
Expand Down
4 changes: 4 additions & 0 deletions arcor2_AREditor/Assets/BASE/Scripts/SceneManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ private async void RobotJointsUpdated(object sender, RobotJointsUpdatedEventArgs
return;
try {
IRobot robot = GetRobot(args.Data.RobotId);

robot.SetJointValue(args.Data.Joints);
} catch (ItemNotFoundException) {

Expand Down Expand Up @@ -474,6 +475,7 @@ public void HideRobotsEE() {
/// </summary>
internal void LoadSettings() {
ActionObjectsVisibility = PlayerPrefsHelper.LoadFloat("AOVisibility" + (VRModeManager.Instance.VRModeON ? "VR" : "AR"), (VRModeManager.Instance.VRModeON ? 1f : 0f));
Debug.LogError("load float " + ActionObjectsVisibility);
ActionObjectsInteractive = PlayerPrefsHelper.LoadBool("scene/" + SceneMeta.Id + "/AOInteractivity", true);
RobotsEEVisible = PlayerPrefsHelper.LoadBool("scene/" + SceneMeta.Id + "/RobotsEEVisibility", true);
}
Expand Down Expand Up @@ -568,6 +570,7 @@ public ActionObject SpawnActionObject(string id, string type, CollisionModels cu

// Add the Action Object into scene reference
ActionObjects.Add(id, actionObject);
actionObject.SetVisibility(ActionObjectsVisibility);
return actionObject;
}

Expand Down Expand Up @@ -815,6 +818,7 @@ public void SetVisibilityActionObjects(float value) {
actionObject.SetVisibility(value);
}
PlayerPrefsHelper.SaveFloat("AOVisibility" + (VRModeManager.Instance.VRModeON ? "VR" : "AR"), value);
Debug.LogError("save float " + value.ToString());
ActionObjectsVisibility = value;
}

Expand Down
2 changes: 1 addition & 1 deletion arcor2_AREditor/Assets/BASE/Scripts/StartAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public override void Init(IO.Swagger.Model.Action projectAction, Base.ActionMeta
parameters: new List<IO.Swagger.Model.ActionParameter>(),
type: "");
base.Init(prAction, metadata, ap, actionProvider, actionType);
transform.localPosition = PlayerPrefsHelper.LoadVector3(playerPrefsKey, new Vector3(0.5f, 0, 0));
transform.localPosition = PlayerPrefsHelper.LoadVector3(playerPrefsKey, new Vector3(0, 0.15f, 0));
}


Expand Down
Binary file modified arcor2_AREditor/Assets/BASE/Scripts/Swagger/IO.Swagger.dll
Binary file not shown.
Loading

0 comments on commit f1e2148

Please sign in to comment.