Пример #1
0
        /// <summary>
        /// 注册所有工具的相应部分上下文
        /// </summary>
        private void Init()
        {
            _cursor = new Dictionary <string, Cursor>();
            _cursor["Tool_Drag"]      = Cursors.Arrow;
            _cursor["Tool_Rectangle"] = Cursors.Cross;
            _cursor["Tool_Triangle"]  = Cursors.Cross;
            _cursor["Tool_Image"]     = Cursors.Cross;
            _cursor["Tool_QRCode"]    = Cursors.Cross;
            _cursor["Tool_Circle"]    = Cursors.Cross;
            _cursor["Tool_Text"]      = Cursors.IBeam;
            _cursor["Tool_Line"]      = Cursors.Cross;

            _toolType = new Dictionary <string, ToolType>();
            _toolType["Tool_Drag"]      = ToolType.Drag;
            _toolType["Tool_Rectangle"] = ToolType.Rectangle;
            _toolType["Tool_Triangle"]  = ToolType.Triangle;
            _toolType["Tool_Image"]     = ToolType.Image;
            _toolType["Tool_QRCode"]    = ToolType.QRCode;
            _toolType["Tool_Circle"]    = ToolType.Circle;
            _toolType["Tool_Text"]      = ToolType.Text;
            _toolType["Tool_Line"]      = ToolType.Line;

            _paintTool = new Dictionary <string, PaintToolBase>();
            _paintTool["Tool_Line"]      = new LineTool();
            _paintTool["Tool_Drag"]      = new DragTool();
            _paintTool["Tool_Triangle"]  = new TriangleTool();
            _paintTool["Tool_Circle"]    = new CircleTool();
            _paintTool["Tool_Rectangle"] = new RectangleTool();
            _paintTool["Tool_Image"]     = new ImageTool();
            _paintTool["Tool_Text"]      = new TextTool();
        }
Пример #2
0
 public TriangleCommand(string id, TriangleTool tool, List <Vector3> verts, List <int> tris, List <Vector2> uvs, Transform parent, Material mat)
 {
     _id     = id;
     _tool   = tool;
     _verts  = verts;
     _tris   = tris;
     _uvs    = uvs;
     _parent = parent;
     _mat    = new Material(mat);
 }