Exemplo n.º 1
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 <BoneSpriteInfluenceTool>();
                tool.Initialize(layoutOverlay);
                tool.skeletonTool = skeletonTool;
                m_ToolMap.Add(Tools.SpriteInfluence, 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);
            }
        }