Ejemplo n.º 1
0
 public override void OnClick(Click type)
 {
     if (!enabled)
     {
         return;
     }
     if (GameManager.Instance.GetEditorState() == GameManager.EditorStateEnum.SelectingActionPoint ||
         GameManager.Instance.GetEditorState() == GameManager.EditorStateEnum.SelectingActionPointParent)
     {
         GameManager.Instance.ObjectSelected(this);
         return;
     }
     if (GameManager.Instance.GetEditorState() != GameManager.EditorStateEnum.Normal)
     {
         return;
     }
     if (GameManager.Instance.GetGameState() != GameManager.GameStateEnum.ProjectEditor)
     {
         Notifications.Instance.ShowNotification("Not allowed", "Editation of action point only allowed in project editor");
         return;
     }
     // HANDLE MOUSE
     if (type == Click.MOUSE_LEFT_BUTTON || type == Click.LONG_TOUCH)
     {
         StartManipulation();
     }
     else if (type == Click.MOUSE_RIGHT_BUTTON || type == Click.TOUCH)
     {
         ShowMenu(false);
         tfGizmo.ClearTargets();
         outlineOnClick.GizmoUnHighlight();
     }
 }
Ejemplo n.º 2
0
    public override void OnClick(Click type)
    {
        if (GameManager.Instance.GetEditorState() == GameManager.EditorStateEnum.SelectingActionObject)
        {
            GameManager.Instance.ObjectSelected(this);
            return;
        }
        if (GameManager.Instance.GetEditorState() != GameManager.EditorStateEnum.Normal)
        {
            return;
        }
        if (GameManager.Instance.GetGameState() != GameManager.GameStateEnum.SceneEditor &&
            GameManager.Instance.GetGameState() != GameManager.GameStateEnum.ProjectEditor)
        {
            Notifications.Instance.ShowNotification("Not allowed", "Editation of action object only allowed in scene or project editor");
            return;
        }
        // HANDLE MOUSE
        if (type == Click.MOUSE_LEFT_BUTTON)
        {
            // We have clicked with left mouse and started manipulation with object
            manipulationStarted = true;
        }
        else if (type == Click.MOUSE_RIGHT_BUTTON)
        {
            ShowMenu();
            tfGizmo.ClearTargets();
        }

        // HANDLE TOUCH
        else if (type == Click.TOUCH)
        {
            if ((ControlBoxManager.Instance.UseGizmoMove || ControlBoxManager.Instance.UseGizmoRotate))
            {
                // We have clicked with left mouse and started manipulation with object
                manipulationStarted = true;
            }
            else
            {
                ShowMenu();
            }
        }
    }
Ejemplo n.º 3
0
    public async override void OnClick(Click type)
    {
        if (GameManager.Instance.GetEditorState() == GameManager.EditorStateEnum.SelectingActionObject ||
            GameManager.Instance.GetEditorState() == GameManager.EditorStateEnum.SelectingActionPointParent)
        {
            GameManager.Instance.ObjectSelected(this);
            return;
        }
        if (GameManager.Instance.GetEditorState() != GameManager.EditorStateEnum.Normal)
        {
            return;
        }
        if (GameManager.Instance.GetGameState() != GameManager.GameStateEnum.SceneEditor &&
            GameManager.Instance.GetGameState() != GameManager.GameStateEnum.ProjectEditor)
        {
            Notifications.Instance.ShowNotification("Not allowed", "Editation of action object only allowed in scene or project editor");
            return;
        }

        // HANDLE MOUSE
        if (type == Click.MOUSE_LEFT_BUTTON || type == Click.LONG_TOUCH)
        {
            // We have clicked with left mouse and started manipulation with object
            if (GameManager.Instance.GetGameState() == GameManager.GameStateEnum.SceneEditor)
            {
                try {
                    await WebsocketManager.Instance.UpdateActionObjectPose(Data.Id, new IO.Swagger.Model.Pose(new Orientation(), new Position()), true);

                    manipulationStarted = true;
                    tfGizmo.AddTarget(Model.transform);
                    outlineOnClick.GizmoHighlight();
                } catch (RequestFailedException ex) {
                    Notifications.Instance.ShowNotification("Object pose could not be changed", ex.Message);
                }
            }
        }
        else if (type == Click.MOUSE_RIGHT_BUTTON || type == Click.TOUCH)
        {
            ShowMenu();
            tfGizmo.ClearTargets();
            outlineOnClick.GizmoUnHighlight();
        }
    }
Ejemplo n.º 4
0
    public override void OnClick(Click type)
    {
        if (GameManager.Instance.GetEditorState() == GameManager.EditorStateEnum.SelectingActionPoint)
        {
            GameManager.Instance.ObjectSelected(this);
            return;
        }
        if (GameManager.Instance.GetEditorState() != GameManager.EditorStateEnum.Normal)
        {
            return;
        }
        if (GameManager.Instance.GetGameState() != GameManager.GameStateEnum.ProjectEditor)
        {
            Notifications.Instance.ShowNotification("Not allowed", "Editation of action point only allowed in project editor");
            return;
        }
        // HANDLE MOUSE
        if (type == Click.MOUSE_LEFT_BUTTON)
        {
            StartManipulation();
        }
        else if (type == Click.MOUSE_RIGHT_BUTTON)
        {
            ShowMenu(false);
            tfGizmo.ClearTargets();
        }

        // HANDLE TOUCH
        else if (type == Click.TOUCH)
        {
            if (ControlBoxManager.Instance.UseGizmoMove || ControlBoxManager.Instance.UseGizmoRotate)
            {
                StartManipulation();
            }
            else
            {
                ShowMenu(false);
            }
        }
    }