Ejemplo n.º 1
0
        private T CreateSkeletonTool <T>(SkeletonTool skeletonTool, SkeletonMode mode, bool editBindPose, LayoutOverlay layoutOverlay) where T : SkeletonToolWrapper
        {
            var tool = CreateTool <T>();

            tool.skeletonTool = skeletonTool;
            tool.mode         = mode;
            tool.editBindPose = editBindPose;
            tool.Initialize(layoutOverlay);
            return(tool);
        }
Ejemplo n.º 2
0
        private T CreateMeshTool <T>(SkeletonTool skeletonTool, MeshTool meshTool, SpriteMeshViewMode meshViewMode, SkeletonMode skeletonMode, LayoutOverlay layoutOverlay) where T : MeshToolWrapper
        {
            var tool = CreateTool <T>();

            tool.skeletonTool = skeletonTool;
            tool.meshTool     = meshTool;
            tool.meshMode     = meshViewMode;
            tool.skeletonMode = skeletonMode;
            tool.Initialize(layoutOverlay);
            return(tool);
        }
Ejemplo n.º 3
0
        private void CreateWeightTools(SkeletonTool skeletonTool, MeshTool meshTool, LayoutOverlay layoutOverlay)
        {
            var weightPainterTool = CreateCache <WeightPainterTool>();

            weightPainterTool.Initialize(layoutOverlay);
            weightPainterTool.skeletonTool = skeletonTool;
            weightPainterTool.meshTool     = meshTool;

            {
                var tool = CreateTool <SpriteBoneInfluenceTool>();
                tool.Initialize(layoutOverlay);
                tool.skeletonTool = skeletonTool;
                m_ToolMap.Add(Tools.BoneInfluence, tool);
            }

            {
                var tool = CreateTool <WeightPainterToolWrapper>();

                tool.weightPainterTool = weightPainterTool;
                tool.paintMode         = WeightPainterMode.Slider;
                tool.title             = TextContent.weightSlider;
                tool.Initialize(layoutOverlay);
                m_ToolMap.Add(Tools.WeightSlider, tool);
            }

            {
                var tool = CreateTool <WeightPainterToolWrapper>();

                tool.weightPainterTool = weightPainterTool;
                tool.paintMode         = WeightPainterMode.Brush;
                tool.title             = TextContent.weightBrush;
                tool.Initialize(layoutOverlay);
                m_ToolMap.Add(Tools.WeightBrush, tool);
            }

            {
                var tool = CreateTool <GenerateWeightsTool>();
                tool.Initialize(layoutOverlay);
                tool.meshTool     = meshTool;
                tool.skeletonTool = skeletonTool;
                m_ToolMap.Add(Tools.GenerateWeights, tool);
            }
        }