public void ActionAdded(IO.Swagger.Model.Action projectAction, string parentId) { ActionPoint actionPoint = GetActionPoint(parentId); IActionProvider actionProvider = GetActionProvider(Action.ParseActionType(projectAction.Type).Item1); Base.Action action = SpawnAction(projectAction.Id, projectAction.Name, Action.ParseActionType(projectAction.Type).Item2, actionPoint, actionProvider); // updates name of the action action.ActionUpdateBaseData(projectAction); // updates parameters of the action action.ActionUpdate(projectAction); OnProjectChanged?.Invoke(this, EventArgs.Empty); }
public void ActionPointOrientationBaseUpdated(NamedOrientation orientation) { try { ActionPoint actionPoint = ProjectManager.Instance.GetActionPointWithOrientation(orientation.Id); actionPoint.BaseUpdateOrientation(orientation); OnActionPointUpdated?.Invoke(this, new ActionPointUpdatedEventArgs(actionPoint)); OnProjectChanged?.Invoke(this, EventArgs.Empty); } catch (KeyNotFoundException ex) { Debug.LogError(ex); Notifications.Instance.ShowNotification("Failed to update action point orientation", ex.Message); return; } }
public void ActionPointJointsRemoved(ProjectRobotJoints joints) { try { ActionPoint actionPoint = GetActionPointWithJoints(joints.Id); actionPoint.RemoveJoints(joints); OnActionPointUpdated?.Invoke(this, new ActionPointUpdatedEventArgs(actionPoint)); OnProjectChanged?.Invoke(this, EventArgs.Empty); } catch (KeyNotFoundException ex) { Debug.LogError(ex); Notifications.Instance.ShowNotification("Failed to remove action point joints", ex.Message); return; } }
public void ActionPointOrientationAdded(NamedOrientation orientation, string actionPointIt) { try { ActionPoint actionPoint = GetActionPoint(actionPointIt); actionPoint.AddOrientation(orientation); OnActionPointUpdated?.Invoke(this, new ActionPointUpdatedEventArgs(actionPoint)); OnProjectChanged?.Invoke(this, EventArgs.Empty); } catch (KeyNotFoundException ex) { Debug.LogError(ex); Notifications.Instance.ShowNotification("Failed to add action point orientation", ex.Message); return; } }
public void ActionPointBaseUpdated(ProjectActionPoint projectActionPoint) { try { ActionPoint actionPoint = GetActionPoint(projectActionPoint.Id); actionPoint.ActionPointBaseUpdate(projectActionPoint); OnActionPointsChanged?.Invoke(this, EventArgs.Empty); OnActionPointUpdated?.Invoke(this, new ActionPointUpdatedEventArgs(actionPoint)); OnProjectChanged?.Invoke(this, EventArgs.Empty); } catch (KeyNotFoundException ex) { Debug.Log("Action point " + projectActionPoint.Id + " not found!"); Notifications.Instance.ShowNotification("", "Action point " + projectActionPoint.Id + " not found!"); return; } }
public async void ProjectBaseUpdated(Project data) { if (GameManager.Instance.GetGameState() == GameManager.GameStateEnum.ProjectEditor) { Project.Desc = data.Desc; Project.HasLogic = data.HasLogic; Project.Modified = data.Modified; Project.Name = data.Name; OnProjectChanged?.Invoke(this, EventArgs.Empty); } else if (GameManager.Instance.GetGameState() == GameManager.GameStateEnum.MainScreen) { await GameManager.Instance.LoadProjects(); } }
public void ActionPointAdded(ProjectActionPoint projectActionPoint) { if (projectActionPoint.Parent == null || projectActionPoint.Parent == "") { SpawnActionPoint(projectActionPoint, null); } else { try { IActionPointParent actionPointParent = GetActionPointParent(projectActionPoint.Parent); SpawnActionPoint(projectActionPoint, actionPointParent); } catch (KeyNotFoundException ex) { Debug.LogError(ex); } } OnActionPointsChanged?.Invoke(this, EventArgs.Empty); OnProjectChanged?.Invoke(this, EventArgs.Empty); }
public void ActionPointRemoved(ProjectActionPoint projectActionPoint) { RemoveActionPoint(projectActionPoint.Id); OnActionPointsChanged?.Invoke(this, EventArgs.Empty); OnProjectChanged?.Invoke(this, EventArgs.Empty); }
public void ActionRemoved(IO.Swagger.Model.Action action) { ProjectManager.Instance.RemoveAction(action.Id); OnProjectChanged?.Invoke(this, EventArgs.Empty); }