public void SetItemData(CocoMakeupItemData itemData)
        {
            if (m_CurrItemData == itemData)
            {
                return;
            }

            m_CurrItemData = itemData;
            m_CurrControlExecutor.OnCategoryItemChanged(m_CurrItemData);

            //			m_IsPainting = false;
            //			CocoMakeupPaintType paintType = CocoMakeupPaintType.ChangeTexture;
            //
            //			if (m_CurrItemData != null)
            //			{
            //				CocoMakeupCategoryData categoryData = MakeupData.GetCategoryData(m_CurrItemData.Category);
            //
            //				bool faceToCamera = true;
            //				if (categoryData.PaintData is CocoMakeupCategoryPaintData_PaintTexture)
            //				{
            //					CocoMakeupCategoryPaintData_PaintTexture paintTextureData = (CocoMakeupCategoryPaintData_PaintTexture)categoryData.PaintData;
            //					faceToCamera = paintTextureData.faceToCameraWhenPaint;
            //				}
            //				if (faceToCamera)
            //				{
            ////					MakeCharacterFaceToCamera();
            //				}
            //			}
        }
        protected override void SwitchItem(CocoMakeupItemData oldData, CocoMakeupItemData newData)
        {
            base.SwitchItem(oldData, newData);

//			if (newData != null && newData is MakeupItemData_ToolColor) {
//				MakeupItemData_ToolColor colorData = (MakeupItemData_ToolColor)newData;
//				m_BlendColor = colorData.BlendColor;
//			}
        }
        public void OnCategoryItemChanged(CocoMakeupItemData data)
        {
            if (data == m_ItemData)
            {
                return;
            }

            SwitchItem(m_ItemData, data);
            m_ItemData = data;
        }
        protected override void SwitchItem(CocoMakeupItemData oldData, CocoMakeupItemData newData)
        {
            if (newData != null)
            {
                Texture2D texture;

                CocoMakeupCategoryData categoryData = CocoRoot.GetInstance <ICocoMakeupData>().GetCategoryData(newData.Category);
                if (categoryData == null)
                {
                    return;
                }
                if (oldData == null || oldData.Category != newData.Category)
                {
                    CocoMakeupCategoryPaintData_PaintTexture paintData = (CocoMakeupCategoryPaintData_PaintTexture)categoryData.PaintData;
                    // brush
                    texture = Resources.Load <Texture2D> (paintData.paintBrushPath);
                    m_PaintKit.CurrentBrush = new CocoMakeupBrush(texture);
                    //Resources.UnloadAsset (texture);
                    // mask

                    if (!string.IsNullOrEmpty(paintData.paintMaskPath))
                    {
                        texture = Resources.Load <Texture2D> (paintData.paintMaskPath);
                        m_PaintKit.CurrentPaintMask = new CocoMakeupMask(texture);
                        //Resources.UnloadAsset (texture);
                    }
                    else
                    {
                        m_PaintKit.CurrentPaintMask = new CocoMakeupMask(Texture2D.whiteTexture);
                    }

                    // layer
                    m_PaintKit.SetCurrentCanvasLayer(paintData.paintLayerId);
                    m_PaintKit.CurrentBrush.Size = paintData.BrushSize;
                }

                if (oldData == null || oldData.m_TexturePath != newData.m_TexturePath)
                {
                    // pattern
                    texture = Resources.Load <Texture2D> (newData.m_TexturePath);
                    m_PaintKit.CurrentPattern = new CocoMakeupPattern(texture, CocoMakeupPattern.FillMode.CanvasArea);
                    //Resources.UnloadAsset (texture);
                }

                Resources.UnloadUnusedAssets();
            }
        }
        public void SetCategoryData(CocoMakeupCategoryData categoryData)
        {
//			if (m_CurrCategoryData == pButton.MakeupCategoryData) return;

            m_CurrCategoryData    = categoryData;
            m_CurrItemData        = null;
            m_CurrControlExecutor = null;
            if (m_CurrCategoryData != null)
            {
                if (ControlExecutorDic.ContainsKey(m_CurrCategoryData.PaintLayer))
                {
                    m_CurrControlExecutor = ControlExecutorDic[m_CurrCategoryData.PaintLayer];
                }
            }

            if (m_CurrCategoryData.PaintData is CocoMakeupCategoryPaintData_PaintTexture)
            {
                int layerID = ((CocoMakeupCategoryPaintData_PaintTexture)m_CurrCategoryData.PaintData).paintLayerId;
                m_CurrControlExecutor.PaintKit.SetCurrentCanvasLayer(layerID);
            }
        }
 protected abstract void SwitchItem(CocoMakeupItemData oldData, CocoMakeupItemData newData);
 protected override void SwitchItem(CocoMakeupItemData oldData, CocoMakeupItemData newData)
 {
 }