Example #1
0
    //string  cameraParamsByte;


    //private Customer markData;

    //public Customer MarkData
    //{
    //    set
    //    {
    //        markData = value;
    //        _id = markData._id;
    //        nameText.text = markData.bookmarkName;
    //        // DebugLog.DebugLogInfo(markData.btnState+" btnState:"+btnState);
    //        // DebugLog.DebugLogInfo(" markData.cameraParams:"+markData.cameraParams);
    //        // DebugLog.DebugLogInfo("markData.BookmarkPicture :"+markData.BookmarkPicture.Length);
    //        //类对象反序列化
    //        btnState = (SceneBtnState)BookMarkManager.DeserializeObject<SceneBtnState>(markData.btnState);
    //        modelState = (SceneModelState)BookMarkManager.DeserializeObject<SceneModelState>(markData.modelState);
    //        cameraParams = (CameraParams)BookMarkManager.DeserializeObject<CameraParams>(markData.cameraParams);
    //        ImageMark = markData.BookmarkPicture;
    //        ShowUI();
    //    }
    //}

    //书签的构造函数
    //public BookMark(string _id,string _name,byte[] _ImageMark,string  _modelState,string  _btnState,string  _cameraParams)
    //{
    //    id = _id;
    //    ImageMarkByte = _ImageMark;
    //    modelStateByte = _modelState;
    //    btnStateByte = _btnState;
    //    cameraParamsByte = _cameraParams;

    //}


    public void SetMarkData(BookMarkInfo mark_data, bool pc_image)
    {
        markInfo      = mark_data;
        id            = markInfo.id;
        nameText.text = markInfo.bookmarkName;
        //类对象反序列化
        btnState      = (SceneBtnState)Vesal_DirFiles.Bytes2Object(markInfo.btnState);
        modelState    = (SceneModelState)Vesal_DirFiles.Bytes2Object(markInfo.modelState);
        cameraParams  = (CameraParams)Vesal_DirFiles.Bytes2Object(markInfo.cameraParams);
        ImageMarkByte = markInfo.bookmarkPicture;
        is_fix        = (markInfo.type == "0") ?true:false;
        playRecord    = new PlayerCommand(modelState, btnState, cameraParams);
        ShowUI(pc_image);
    }
Example #2
0
    /// <summary>
    /// 撤销上一个命令
    /// </summary>
    public void RevocationCommand()
    {
        if (CloseCommandCompent)
        {
            return;
        }
        if (indexId >= 0)
        {
            local_db.DataService("Command.db");

            CommandList popDocument = local_db.SelectOne <CommandList>((temp_command) =>
            {
                if (indexId == temp_command.id)
                {
                    DebugLog.DebugLogInfo("查询数据:" + indexId);
                    return(true);
                }
                else
                {
                    return(false);
                }
            });

            try
            {
                SceneModelState modelstaste = (SceneModelState)Vesal_DirFiles.Bytes2Object(popDocument.modelInfo);
                PlayerCommand   command     = new PlayerCommand(modelstaste);
                command.RevocationCommand();
            }
            catch
            {
                // Debug.LogError("命令记录不存在 id :"+id);
            }
            DebugLog.DebugLogInfo("删除数据:" + indexId);
            local_db.Delete(popDocument);
            local_db.Close();
            indexId--;
            this.CanOperaCommand(indexId != 0);
        }
    }
Example #3
0
    public void SetMarkData(string path)
    {
        StreamReader sr = null;

        try
        {
            sr = File.OpenText(path);
        }
        catch (Exception e)
        {
        }
        ma = sr.ReadToEnd();
        //关闭流
        sr.Close();
        //销毁流
        sr.Dispose();
        //将数组链表容器返回



        //StateData.Instance.isReturn = false;

        Debug.Log(ma);

        //  string ma = StateData.Instance.StatePath[StateData.Instance.StatePath.Count - 1];
        BookMarkInfo mark = JsonConvert.DeserializeObject <BookMarkInfo>(ma);
        // mark = book[book.Count - 1];
        BookMarkInfo markInfo = mark;

        Debug.Log(markInfo.ToString());
        //类对象反序列化
        btnState     = (SceneBtnState)Vesal_DirFiles.Bytes2Object(markInfo.btnState);
        modelState   = (SceneModelState)Vesal_DirFiles.Bytes2Object(markInfo.modelState);
        cameraParams = (CameraParams)Vesal_DirFiles.Bytes2Object(markInfo.cameraParams);
        playRecord   = new PlayerCommand(modelState, btnState, cameraParams);
        LoadBookMark();
    }