示例#1
0
    public void SetColor(StarColorEnum color)
    {
        m_color = color;

        /*  switch (m_color)
         * {
         *    case StarColorEnum.BLUE:
         *        m_image.color = ColorUtils.GetColorByRGBA(68, 190, 255);
         *        break;
         *    case StarColorEnum.GREEN:
         *        m_image.color = ColorUtils.GetColorByRGBA(102, 202, 27);
         *        break;
         *    case StarColorEnum.PURPLE:
         *        m_image.color = ColorUtils.GetColorByRGBA(192, 60, 255);
         *        break;
         *    case StarColorEnum.RED:
         *        m_image.color = ColorUtils.GetColorByRGBA(225, 69, 110);
         *        break;
         *    case StarColorEnum.YELLOW:
         *        m_image.color = ColorUtils.GetColorByRGBA(253, 181, 13);
         *        break;
         * }*/
        switch (m_color)
        {
        case StarColorEnum.GREEN:
            GUIHelper.ChangeUIImage(m_image, ResoucesPathEnum.starImagePath, "kuai_01");
            break;

        case StarColorEnum.YELLOW:
            GUIHelper.ChangeUIImage(m_image, ResoucesPathEnum.starImagePath, "kuai_02");
            break;

        case StarColorEnum.BLUE:
            GUIHelper.ChangeUIImage(m_image, ResoucesPathEnum.starImagePath, "kuai_03");
            break;

        case StarColorEnum.PURPLE:
            GUIHelper.ChangeUIImage(m_image, ResoucesPathEnum.starImagePath, "kuai_04");
            break;

        case StarColorEnum.RED:
            GUIHelper.ChangeUIImage(m_image, ResoucesPathEnum.starImagePath, "kuai_05");
            break;
        }
    }