Ejemplo n.º 1
0
        public async override void Remove()
        {
            IO.Swagger.Model.RemoveFromSceneResponse response =
                await WebsocketManager.Instance.RemoveFromScene(GetId(), false, false);

            if (!response.Result)
            {
                Notifications.Instance.ShowNotification("Failed to remove object " + GetName(), response.Messages[0]);
                return;
            }
        }
Ejemplo n.º 2
0
        public async override Task <RequestResult> Removable()
        {
            if (GameManager.Instance.GetGameState() != GameManager.GameStateEnum.SceneEditor)
            {
                return(new RequestResult(false, "Action object could be removed only in scene editor"));
            }
            else if (SceneManager.Instance.SceneStarted)
            {
                return(new RequestResult(false, "Scene online"));
            }
            else
            {
                IO.Swagger.Model.RemoveFromSceneResponse response = await WebsocketManager.Instance.RemoveFromScene(GetId(), false, true);

                if (response.Result)
                {
                    return(new RequestResult(true));
                }
                else
                {
                    return(new RequestResult(false, response.Messages[0]));
                }
            }
        }