Esempio n. 1
0
 void Awake()
 {
     ReInput.ControllerConnectedEvent += OnControllerConnected;
     currentScene.ChangeState(SceneManager.GetActiveScene().name);
     inputs    = inputs.FindAllPlayersWithJoystick();
     trasition = GetComponent <CoreView>();
 }
Esempio n. 2
0
        //! 查找指定Tag的图形对象ID
        public int FindShapeByTag(int tag)
        {
            int doc = CoreView.acquireFrontDoc();
            int sid = CoreView.findShapeByTag(doc, tag);

            GiCoreView.releaseDoc(doc);
            return(sid);
        }
Esempio n. 3
0
        //! 视图坐标转为模型坐标
        public bool DisplayToModel(Point pt)
        {
            Floats p   = new Floats((float)pt.X, (float)pt.Y);
            bool   ret = CoreView.displayToModel(p);

            pt.X = p.get(0);
            pt.Y = p.get(1);
            return(ret);
        }
Esempio n. 4
0
        //! 视图坐标转为模型坐标
        public bool DisplayToModel(Rect rect)
        {
            Floats p = new Floats((float)rect.Left, (float)rect.Top,
                                  (float)rect.Right, (float)rect.Bottom);
            bool ret = CoreView.displayToModel(p);

            rect.X      = p.get(0);
            rect.Y      = p.get(1);
            rect.Width  = p.get(2) - rect.X;
            rect.Height = p.get(3) - rect.Y;

            return(ret);
        }
Esempio n. 5
0
 //! 保存图形到JSON文件
 public bool Save(string vgfile)
 {
     try
     {
         var dir = new DirectoryInfo(vgfile).Parent;
         if (!dir.Exists)
         {
             dir.Create();
         }
     }
     catch (IOException)
     {
         return(false);
     }
     return(CoreView.saveToFile(vgfile));
 }
Esempio n. 6
0
        //! 开始Undo录制
        public bool StartUndoRecord(string path)
        {
            if (CoreView.isUndoRecording())
            {
                return(false);
            }

            try
            {
                var dir = new DirectoryInfo(path);
                if (dir.Exists)
                {
                    dir.Delete(true);
                }
                dir.Create();
            }
            catch (IOException)
            {
                return(false);
            }

            return(CoreView.startRecord(path, CoreView.acquireFrontDoc(),
                                        true, WPFGraphView.getTick()));
        }
Esempio n. 7
0
 //! 放缩显示指定范围到视图区域
 public bool ZoomToModel(float x, float y, float w, float h, float margin)
 {
     return(CoreView.zoomToModel(x, y, w, h, margin));
 }
Esempio n. 8
0
 //! 指定名称和JSON串参数,启动命令
 public bool SetCommand(string name, string param)
 {
     return(CoreView.setCommand(name, param));
 }
Esempio n. 9
0
 //! 重做
 public bool Redo()
 {
     return(CoreView.redo(ViewAdapter));
 }
Esempio n. 10
0
 //! 能否重做
 public bool CanRedo()
 {
     return(CoreView.canRedo());
 }
Esempio n. 11
0
 //! 停止录屏
 public void StopRecord()
 {
     CoreView.stopRecord(false);
 }
Esempio n. 12
0
 //! 返回已录制的相对毫秒数
 public int GetRecordTicks()
 {
     return(CoreView.getRecordTick(false, WPFGraphView.getTick()));
 }
Esempio n. 13
0
 //! 是否正在录屏
 public bool IsRecording()
 {
     return(CoreView.isRecording());
 }
Esempio n. 14
0
 //! 清除当前视图区域内的未锁定的图形
 public void EraseView()
 {
     CoreView.setCommand("erasewnd");
 }
Esempio n. 15
0
 //! 清除所有图形,含锁定的图形
 public void Clear()
 {
     CoreView.clear();
 }
Esempio n. 16
0
 //! 图形向右上平移显示,像素单位
 public bool ZoomPan(float dxPixel, float dyPixel)
 {
     return(CoreView.zoomPan(dxPixel, dyPixel));
 }
Esempio n. 17
0
 //! 从JSON文件中加载图形
 public bool Load(string vgfile)
 {
     return(CoreView.loadFromFile(vgfile));
 }
Esempio n. 18
0
 //! 切换到下一命令
 public bool SwitchCommand()
 {
     return(CoreView.switchCommand());
 }
Esempio n. 19
0
 //! 从JSON文件中只读加载图形
 public bool Load(string vgfile, bool readOnly)
 {
     return(CoreView.loadFromFile(vgfile, readOnly));
 }
Esempio n. 20
0
 //! 当前是否为指定名称的命令
 public bool isCommand(string name)
 {
     return(CoreView.isCommand(name));
 }
Esempio n. 21
0
 //! 清除所有图形
 public void ClearShapes()
 {
     CoreView.clear();
 }
Esempio n. 22
0
 //! 导出静态图形到SVG文件
 public bool ExportSVG(string filename)
 {
     return(CoreView.exportSVG(ViewAdapter, filename) > 0);
 }
Esempio n. 23
0
 //! 停止Undo录制
 public void StopUndoRecord()
 {
     CoreView.stopRecord(true);
 }
Esempio n. 24
0
 //! 放缩显示全部内容到视图区域
 public bool ZoomToExtent()
 {
     return(CoreView.zoomToExtent());
 }
Esempio n. 25
0
 //! 撤销
 public bool Undo()
 {
     return(CoreView.undo(ViewAdapter));
 }
Esempio n. 26
0
 //! 放缩显示全部内容到视图区域
 public bool ZoomToExtent(float margin)
 {
     return(CoreView.zoomToExtent(margin));
 }
Esempio n. 27
0
 //! 返回内核视图的句柄, MgView 指针
 public int CmdViewHandle()
 {
     return(CoreView.viewAdapterHandle());
 }
Esempio n. 28
0
 //! 添加测试图形
 public int AddShapesForTest()
 {
     return(CoreView.addShapesForTest());
 }
Esempio n. 29
0
 //! 放缩显示指定范围到视图区域
 public bool ZoomToModel(float x, float y, float w, float h)
 {
     return(CoreView.zoomToModel(x, y, w, h));
 }
Esempio n. 30
0
 //! 放缩显示指定范围到视图区域
 public bool ZoomToModel(Rect rect)
 {
     return(CoreView.zoomToModel((float)rect.X, (float)rect.Y,
                                 (float)rect.Width, (float)rect.Height));
 }