Beispiel #1
0
 private void btnStartOrPause_Click(object sender, EventArgs e)
 {
     if (animation == DEFINE.EAnimation.Start)
     {
         double sizeDir = Math.Sqrt(r.Direction.X * r.Direction.X + r.Direction.Y * r.Direction.Y);
         r.Velocity = new Point(DEFINE.Round(tbVelocity.Value * (speedMoveBase * r.Direction.X / sizeDir)),
                                -1 * DEFINE.Round(tbVelocity.Value * (speedMoveBase * r.Direction.Y / sizeDir)));
         timer1.Interval = 30;
         animation       = DEFINE.EAnimation.Running;
         timer1.Start();
         btnStartOrPause.Text   = "Pause";
         btnClearOrStop.Text    = "Stop";
         btnClearOrStop.Enabled = true;
     }
     else if (animation == DEFINE.EAnimation.Running)
     {
         animation            = DEFINE.EAnimation.Pause;
         btnStartOrPause.Text = "Resume";
     }
     else if (animation == DEFINE.EAnimation.Pause)
     {
         animation            = DEFINE.EAnimation.Running;
         btnStartOrPause.Text = "Pause";
     }
 }
        private static void ShadedY(int x1, int y1, int x2, int y2, Color color, ref Bitmap bm)
        {
            int dx = Math.Abs(x2 - x1);
            int dy = Math.Abs(y2 - y1);
            int h  = 2 * dx;
            int w  = h - 2 * dy;
            int d  = h - dy;
            int x  = x1;
            int y  = y1;
            int xend;
            int yend;

            if (y1 > y2)
            {
                x    = x2;
                y    = y2;
                xend = x1;
                yend = y1;
            }
            else
            {
                x    = x1;
                y    = y1;
                xend = x2;
                yend = y2;
            }
            int deltaX = -1;

            if (x < xend)
            {
                deltaX = 1;
            }
            int alpha = 255;
            int y0    = y;

            for (; y < yend; y++)
            {
                double doMo = (yend - y) / (yend - y0 * 1.0);
                if (y1 == yend)
                {
                    doMo = 1 - (yend - y) / (yend - y0 * 1.0);
                }
                SetPixel(x, y, Color.FromArgb(DEFINE.Round(alpha * doMo), color), ref bm);
                if (d < 0)
                {
                    d += h;
                }
                else
                {
                    d += w;
                    x += deltaX;
                }
            }
        }
        private static void ShadedX(int x1, int y1, int x2, int y2, Color color, ref Bitmap bm)
        {
            int dx = Math.Abs(x2 - x1);
            int dy = Math.Abs(y2 - y1);
            int h  = 2 * dy;
            int w  = h - 2 * dx;
            int d  = h - dx;
            int x  = x1;
            int y  = y1;
            int xend;
            int yend;

            if (x1 > x2)
            {
                x    = x2;
                y    = y2;
                xend = x1;
                yend = y1;
            }
            else
            {
                x    = x1;
                y    = y1;
                xend = x2;
                yend = y2;
            }
            int deltaY = -1;

            if (y < yend)
            {
                deltaY = 1;
            }
            int alpha = 255;
            int x0    = x;

            for (; x < xend; x++)
            {
                double doMo = (xend - x) / (xend - x0 * 1.0);
                if (x1 == xend)
                {
                    doMo = 1 - (xend - x) / (xend - x0 * 1.0);
                }
                SetPixel(x, y, Color.FromArgb(DEFINE.Round(alpha * doMo), color), ref bm);
                if (d < 0)
                {
                    d += h;
                }
                else
                {
                    d += w;
                    y += deltaY;
                }
            }
        }
Beispiel #4
0
        private void tbAlpha_Scroll(object sender, EventArgs e)
        {
            if (tbAlpha.Value > 360)
            {
                tbAlpha.Value = 0;
            }
            if (tbAlpha.Value < 0)
            {
                tbAlpha.Value = 360;
            }
            double theta  = tbAlpha.Value * Math.PI / 180;
            double alpha2 = DEFINE.DirToRad(r.Direction);
            double alpha  = theta - alpha2;

            r.Rotate(r.Position, alpha);

            Oxy.Draw();
            pbDraw.Image = bm;
        }
Beispiel #5
0
        private static void Decac(int xI, int yI, int r, Color color, ref Bitmap bm)
        {
            double y_real;
            int    x;
            int    y;

            for (x = 0; x <= r * Math.Cos(45 * Math.PI / 180.0) + 0.5; x++)
            {
                y_real = Math.Sqrt(1.0 * r * r - x * x);
                y      = DEFINE.Round(y_real);
                SetPixel(x + xI, y + yI, color, ref bm);
                SetPixel(y + xI, x + yI, color, ref bm);
                SetPixel(y + xI, -x + yI, color, ref bm);
                SetPixel(x + xI, -y + yI, color, ref bm);
                SetPixel(-x + xI, -y + yI, color, ref bm);
                SetPixel(-y + xI, -x + yI, color, ref bm);
                SetPixel(-y + xI, x + yI, color, ref bm);
                SetPixel(-x + xI, y + yI, color, ref bm);
            }
        }
Beispiel #6
0
        private static void ToaDoCuc(int xI, int yI, int r, Color color, ref Bitmap bm)
        {
            double scale = r / 60.0;
            int    alpha0 = DEFINE.Round(90 * scale);
            int    alphaEnd = DEFINE.Round(45 * scale);
            int    x, y;

            for (; alpha0 >= alphaEnd; alpha0--)
            {
                x = DEFINE.Round(r * Math.Cos(alpha0 * Math.PI / 180 / scale));
                y = DEFINE.Round(r * Math.Sin(alpha0 * Math.PI / 180 / scale));
                SetPixel(x + xI, y + yI, color, ref bm);
                SetPixel(y + xI, x + yI, color, ref bm);
                SetPixel(y + xI, -x + yI, color, ref bm);
                SetPixel(x + xI, -y + yI, color, ref bm);
                SetPixel(-x + xI, -y + yI, color, ref bm);
                SetPixel(-y + xI, -x + yI, color, ref bm);
                SetPixel(-y + xI, x + yI, color, ref bm);
                SetPixel(-x + xI, y + yI, color, ref bm);
            }
        }
Beispiel #7
0
        private static void Elip(int xI, int yI, int a, int b, Color color, ref Bitmap bm)
        {
            int x = 0;
            int y = b;
            int d = DEFINE.Round(b * b - a * a * b + a * a * 0.25);

            for (; (2 * b * b * x) < (2 * a * a * y); x++) // y
            {
                SetPixel(x + xI, y + yI, color, ref bm);
                SetPixel(x + xI, -y + yI, color, ref bm);
                SetPixel(-x + xI, -y + yI, color, ref bm);
                SetPixel(-x + xI, y + yI, color, ref bm);
                if (d < 0)
                {
                    d += b * b * (2 * x + 3);
                }
                else
                {
                    d += b * b * (2 * x + 3) + a * a * (-2 * y + 2);
                    y--;
                }
            }
            d = DEFINE.Round(b * b * (x + 0.5) * (x + 0.5) + a * a * (y - 1) * (y - 1) - a * a * b * b);
            for (; y >= 0; y--)
            {
                SetPixel(x + xI, y + yI, color, ref bm);
                SetPixel(x + xI, -y + yI, color, ref bm);
                SetPixel(-x + xI, -y + yI, color, ref bm);
                SetPixel(-x + xI, y + yI, color, ref bm);
                if (d >= 0)
                {
                    d += a * a * (-2 * y + 3);
                }
                else
                {
                    d += b * b * (2 * x + 2) + a * a * (-2 * y + 3);
                    x++;
                }
            }
        }
Beispiel #8
0
 public ucRectangleMove()
 {
     InitializeComponent();
     bm  = new Bitmap(pbDraw.Size.Width, pbDraw.Size.Height);
     Oxy = new Model.Oxy(ref bm)
     {
         Position = new Point(DEFINE.Round(pbDraw.Width / 2), DEFINE.Round(pbDraw.Height / 2)),
         Color    = Color.Red
     };
     r = new Model.Rectangle(ref bm)
     {
         Position  = new Point(Oxy.Position.X, Oxy.Position.Y),
         Color     = Color.Red,
         Direction = new Point(100, 0),
         Height    = 60,
         Width     = 30,
         Velocity  = new Point(speedMoveBase * tbVelocity.Value, 0)
     };
     r.Draw();
     Oxy.Draw();
     pbDraw.Image = bm;
 }
        private static void DDA(int x1, int y1, int x2, int y2, Color color, ref Bitmap bm)
        {
            //get board
            //calculating

            double m        = -3;
            int    infinity = 0;

            if (x1 != x2)
            {
                infinity = 1;
                m        = (y2 - y1) / (x2 - x1 * 1.0); // hệ số m
            }
            // tăng theo x
            if (((m <= 1 && m >= 0) || (m >= -1 && m < 0)) && x2 > x1)
            {
                double y = y1;
                int    iy;
                for (int x = x1; x <= x2; x++)
                {
                    iy = DEFINE.Round(y);
                    //putPixel(x, iy);
                    SetPixel(x, iy, color, ref bm);
                    y += m;
                }
            }
            //tăng theo y
            else if ((m > 1 || m < -1) && y2 > y1)
            {
                double x = x1;
                int    ix;
                for (int y = y1; y <= y2; y++)
                {
                    ix = DEFINE.Round(x);
                    //putPixel(x, iy);
                    SetPixel(ix, y, color, ref bm);
                    x += (1 * infinity / m);
                }
            }
            // giảm theo x
            else if (((m >= -1 && m <= 0) || (m > 0 && m <= 1)) && x1 > x2)
            {
                double y = y1;
                int    iy;
                for (int x = x1; x >= x2; x--)
                {
                    iy = DEFINE.Round(y);
                    //putPixel(x, iy);
                    SetPixel(x, iy, color, ref bm);
                    y -= m;
                }
            }
            // giảm theo y
            else if ((m > 1 || m < -1) && y1 > y2)
            {
                double x = x1;
                int    ix;
                for (int y = y1; y >= y2; y--)
                {
                    ix = DEFINE.Round(x);
                    SetPixel(ix, y, color, ref bm);
                    x -= (1 * infinity / m);
                }
            }
        }
    public void updateServantInfo(UserServantData s_data)
    {
        //unit_idx = u_idx;
        for (int i = 0; i < buttonEquip.Length; i++)
        {
            buttonEquip[i].gameObject.SetActive(false);
        }
        for (int i = 0; i < 3; i++)
        {
            buttonEquip[i].gameObject.SetActive(true);
        }

        UserServantData unit_data = s_data;// UserDataManager.Inst.GetServantInfo(unit_idx);

        if (unit_data == null)
        {
            DebugLog.Log(false, "Invalid Servant data By ServantInfoManager");
        }
        DBServantData db_unit_data = CSVData.Inst.GetServantData(unit_data.id);

        if (db_unit_data == null)
        {
            DebugLog.Log(false, "Invalid DB_Servant data By ServantInfoManager");
        }

        textUnitName.text = db_unit_data.name;
        textLevel.text    = string.Format("{0}", unit_data.level);


        for (EQUIPMENT_TYPE type = EQUIPMENT_TYPE.WEAPON; type < EQUIPMENT_TYPE.MAX; type++)
        {
            if (unit_data.equipmentDic[type] != 0)
            {
                UserEquipmentData equip_info = UserDataManager.Inst.GetEquipmentInfo(unit_data.equipmentDic[type]);
                if (equip_info == null)
                {
                    DebugLog.Log(true, "Invalid Index : " + unit_data.equipmentDic[type]);
                    return;
                }

                buttonEquip[(int)type].image.sprite = CSVData.Inst.GetSpriteGrade((GRADE_TYPE)equip_info.grade);
                buttonEquip[(int)type].transform.GetChild(0).GetComponent <Image>().enabled = false;
                buttonEquip[(int)type].transform.GetChild(1).GetComponent <Image>().enabled = true;
                buttonEquip[(int)type].transform.GetChild(1).GetComponent <Image>().sprite  = CSVData.Inst.GetEquipmentData(equip_info.id).equipmentIcon;
            }
            else
            {
                buttonEquip[(int)type].image.sprite = spriteEmptySlot;
                buttonEquip[(int)type].transform.GetChild(0).GetComponent <Image>().enabled = true;
                buttonEquip[(int)type].transform.GetChild(1).GetComponent <Image>().enabled = false;
            }
        }

        if (unit_data.level >= DEFINE.MAX_LEVEL)
        {
            textExp.text        = "MAX";
            imageExp.fillAmount = 1f;
        }
        else
        {
            DBExpData dbExpData = CSVData.Inst.GetExpData(unit_data.level);
            if (dbExpData == null)
            {
                DebugLog.Log(false, "Invalid Level Data");
            }
            else
            {
                int exExp = 0;
                if (unit_data.level - 1 > 0)
                {
                    DBExpData exDBExpData = CSVData.Inst.GetExpData(unit_data.level - 1);
                    if (exDBExpData == null)
                    {
                        DebugLog.Log(false, "Invalid Level Data");
                    }
                    else
                    {
                        exExp = exDBExpData.charExp;
                    }
                }

                textExp.text        = unit_data.exp + " / " + dbExpData.charExp;
                imageExp.fillAmount = (exExp - unit_data.exp) / (float)(exExp - dbExpData.charExp);
            }
        }

        //textGradeText.text;
        textGrade.text  = string.Format("{0}", unit_data.gradeType);
        textGrade.color = DEFINE.GetGradeColor(unit_data.gradeType);
        //textJobText.text;
        imagejob.sprite = CSVData.Inst.GetSpriteServantJob(unit_data.jobType);
        //textStatsText.text;

        int[] stat_by_set_equipment = Calculator.GetServantStatsEquipAllItem(unit_data);

        textStr.text = string.Format("{0}", stat_by_set_equipment[(int)EQUIPMENT_OPTION_TYPE.STR]);
        textDex.text = string.Format("{0}", stat_by_set_equipment[(int)EQUIPMENT_OPTION_TYPE.DEX]);
        textInt.text = string.Format("{0}", stat_by_set_equipment[(int)EQUIPMENT_OPTION_TYPE.INT]);

        textHP.text      = string.Format("{0}", stat_by_set_equipment[(int)EQUIPMENT_OPTION_TYPE.HP]);
        textAvoid.text   = string.Format("{0}", db_unit_data.avoid);
        textPAtk.text    = string.Format("{0}", stat_by_set_equipment[(int)EQUIPMENT_OPTION_TYPE.ATK]);
        textPDef.text    = string.Format("{0}", stat_by_set_equipment[(int)EQUIPMENT_OPTION_TYPE.DEF]);
        textMAtk.text    = string.Format("{0}", stat_by_set_equipment[(int)EQUIPMENT_OPTION_TYPE.MATK]);
        textMDef.text    = string.Format("{0}", stat_by_set_equipment[(int)EQUIPMENT_OPTION_TYPE.MDEF]);
        textPCri.text    = string.Format("{0}", stat_by_set_equipment[(int)EQUIPMENT_OPTION_TYPE.CriDmg]);
        textPCriPer.text = string.Format("{0}", stat_by_set_equipment[(int)EQUIPMENT_OPTION_TYPE.CriPer]);

        /*
         * textStr.text = string.Format("{0}", unit_data.status.basicStr);
         * textDex.text = string.Format("{0}", unit_data.status.basicDex);
         * textInt.text = string.Format("{0}", unit_data.status.basicInt);
         *
         * textHP.text = string.Format("{0}", unit_data.maxHP);
         * textSpeed.text = string.Format("{0}", db_unit_data.speed);
         * textPAtk.text = string.Format("{0}", unit_data.atk);
         * textPDef.text = string.Format("{0}", unit_data.def);
         * textMAtk.text = string.Format("{0}", unit_data.mAtk);
         * textMDef.text = string.Format("{0}", unit_data.mDef);
         * textPCri.text = string.Format("{0}", unit_data.criDmg);
         * textPCriPer.text = string.Format("{0}", unit_data.criPer);
         */

        if (unit_data.activeSkillList.Count > 0)
        {
            imageActive.gameObject.SetActive(true);
            imageActive.sprite = CSVData.Inst.GetSkillActiveData(unit_data.activeSkillList[0].id).activeIcon;
        }
        else
        {
            imageActive.gameObject.SetActive(false);
        }

        if (unit_data.passiveSkillList.Count > 0)
        {
            imagePassive.gameObject.SetActive(true);
            imagePassive.sprite = CSVData.Inst.GetSkillPassiveData(unit_data.passiveSkillList[0].id).passiveIcon;
        }
        else
        {
            imagePassive.gameObject.SetActive(false);
        }
    }
    public void updateMonsterInfo(UserMonsterData m_data)
    {
        //unit_idx = u_idx;

        UserMonsterData unit_data = m_data;// UserDataManager.Inst.GetMonsterInfo(unit_idx);

        if (unit_data == null)
        {
            DebugLog.Log(false, "Invalid Monster data By MonsterInfoManager");
        }
        DBMonsterData db_unit_data = CSVData.Inst.GetMonsterData(unit_data.id);

        if (db_unit_data == null)
        {
            DebugLog.Log(false, "Invalid DB_Monster data By MonsterInfoManager");
        }

        textUnitName.text = db_unit_data.name;
        textLevel.text    = string.Format("{0}", unit_data.level);

        if (unit_data.level >= DEFINE.MAX_LEVEL)
        {
            textExp.text        = "MAX";
            imageExp.fillAmount = 1f;
        }
        else
        {
            DBExpData dbExpData = CSVData.Inst.GetExpData(unit_data.level);
            if (dbExpData == null)
            {
                DebugLog.Log(false, "Invalid Level Data");
            }
            else
            {
                int exExp = 0;
                if (unit_data.level - 1 > 0)
                {
                    DBExpData exDBExpData = CSVData.Inst.GetExpData(unit_data.level - 1);
                    if (exDBExpData == null)
                    {
                        DebugLog.Log(false, "Invalid Level Data");
                    }
                    else
                    {
                        exExp = exDBExpData.charExp;
                    }
                }

                textExp.text        = unit_data.exp + " / " + dbExpData.charExp;
                imageExp.fillAmount = (exExp - unit_data.exp) / (float)(exExp - dbExpData.charExp);
            }
        }


        //textGradeText.text;
        textGrade.text  = string.Format("{0}", unit_data.gradeType);
        textGrade.color = DEFINE.GetGradeColor(unit_data.gradeType);
        //textUpgradeText.text;
        textUpgrade.text = string.Format("+{0}", unit_data.upgrade);
        //textClassText.text;
        imageTribe.sprite = CSVData.Inst.GetSmallSpriteTribeType(db_unit_data.tribeType);
        //textTypeText.text;
        imageType.sprite = CSVData.Inst.GetSpriteElementType(db_unit_data.elementType);

        //textStatsText.text;

        textStr.text = string.Format("{0}", unit_data.status.basicStr);
        textDex.text = string.Format("{0}", unit_data.status.basicDex);
        textInt.text = string.Format("{0}", unit_data.status.basicInt);

        textHP.text      = string.Format("{0}", unit_data.maxHP);
        textAvoid.text   = string.Format("{0}", db_unit_data.avoid);
        textPAtk.text    = string.Format("{0}", unit_data.atk);
        textPDef.text    = string.Format("{0}", unit_data.def);
        textMAtk.text    = string.Format("{0}", unit_data.mAtk);
        textMDef.text    = string.Format("{0}", unit_data.mDef);
        textPCri.text    = string.Format("{0}", unit_data.criDmg);
        textPCriPer.text = string.Format("{0}", unit_data.criPer);

        if (unit_data.passiveSkillList.Count > 0)
        {
            imagePassive.gameObject.SetActive(true);
            imagePassive.sprite = CSVData.Inst.GetSkillPassiveData(unit_data.passiveSkillList[0].id).passiveIcon;
        }
        else
        {
            imagePassive.gameObject.SetActive(false);
        }

        //파티에 등록된 상태인지
        if (unit_data.upgrade >= DEFINE.MAX_MONSTER_UPGRADE_COUNT)
        {
            buttonUpgrade.interactable = false;
            textSetParty.fontSize      = 40;
            textSetParty.text          = "MAX";
        }
        else if (unit_data.partyIndex > 0)
        {
            buttonUpgrade.interactable = false;
            textSetParty.fontSize      = 60;
            textSetParty.text          = "P";
        }
        else
        {
            buttonUpgrade.interactable = true;
            textSetParty.text          = "";
        }
    }
    //상세정보창 Update
    public void updateDetailInfo(int _selected_unit_idx)
    {
        unit_idx = _selected_unit_idx;

        UserEquipmentData equipmentData = UserDataManager.Inst.GetEquipmentInfo(EquipmentList[(int)selectedMenu][unit_idx].index);

        if (equipmentData == null)
        {
            DebugLog.Log(false, "Invalid Equipment Inddex : " + unit_idx);
        }

        DBEquipmentData dBEquipmentData = CSVData.Inst.GetEquipmentData(equipmentData.id);

        if (dBEquipmentData == null)
        {
            DebugLog.Log(false, "Invalid equipment ID : " + equipmentData.id);
        }

        imageEquipment.sprite  = dBEquipmentData.equipmentIcon;
        textEquipmentName.text = dBEquipmentData.name;
        //textCurrentGradeText.text;
        textGrade.text  = string.Format("{0}", ((GRADE_TYPE)equipmentData.grade));
        textGrade.color = DEFINE.GetGradeColor((GRADE_TYPE)equipmentData.grade);
        //textCurrentUpgradeText.text;
        textUpgrade.text = string.Format("+{0}", (equipmentData.upgrade));;
        //textCurrentTierText.text;
        textTier.text = string.Format("{0}T", dBEquipmentData.tier);
        //textCurrentJobText.text;

        Color temp_color = imageJobIcon[0].color;

        for (int i = 0; i < 5; i++)
        {
            imageJobIcon[i].color = new Color(temp_color.r, temp_color.g, temp_color.b, 0.2f);
        }

        if (dBEquipmentData.jobLimit == SERVANT_JOB_FLAG.All)
        {
            for (int i = 0; i < 5; i++)
            {
                imageJobIcon[i].color = new Color(temp_color.r, temp_color.g, temp_color.b, 1f);
            }
        }
        else
        {
            for (int i = 0; i < 5; i++)
            {
                SERVANT_JOB_FLAG checkJob = (SERVANT_JOB_FLAG)Math.Pow(2, (double)(i + 1));
                if (dBEquipmentData.isEquipAble(checkJob) == true)
                {
                    imageJobIcon[i].color = new Color(temp_color.r, temp_color.g, temp_color.b, 1f);
                }
            }
        }

        imageStatsIcon.sprite = CSVData.Inst.GetSpriteOptionType(dBEquipmentData.optionType);
        textStats.text        = string.Format("{0}", equipmentData.value);

        //장착 중인 장비인지.
        if (equipmentData.upgrade >= DEFINE.MAX_EQUIPMENT_UPGRADE_COUNT)
        {
            buttonUpgrade.interactable = false;
            textEquipItem.fontSize     = 40;
            textEquipItem.text         = "MAX";
        }
        else if (equipmentData.equipServantIndex > 0)
        {
            buttonUpgrade.interactable = false;
            textEquipItem.fontSize     = 60;
            textEquipItem.text         = "E";
        }
        else
        {
            buttonUpgrade.interactable = true;
            textEquipItem.text         = "";
        }
    }
    public void updateChangeItemInfo(int selectedChangeItemIdx)
    {
        if (selectedChangeItemIdx >= 0)
        {
            selectedItemIdx = selectedChangeItemIdx;
            int change_item_idx = EquipmentList[selectedItemIdx].index;

            FrameChangeItemInfo.SetActive(true);
            FrameChangeItemNone.SetActive(false);
            UserEquipmentData changeEquipmentData = UserDataManager.Inst.GetEquipmentInfo(change_item_idx);

            if (changeEquipmentData == null)
            {
                DebugLog.Log(false, "Invalid Equipment data");
            }


            DBEquipmentData dBChangeEquipment = CSVData.Inst.GetEquipmentData(changeEquipmentData.id);
            if (dBChangeEquipment == null)
            {
                DebugLog.Log(false, "Invalid equipmentData ID : " + changeEquipmentData.id);
            }


            imageChangeItem.sprite  = dBChangeEquipment.equipmentIcon;
            textChangeItemName.text = dBChangeEquipment.name;
            //textCurrentGradeText.text;
            textChangeGrade.text  = string.Format("{0}", ((GRADE_TYPE)changeEquipmentData.grade));
            textChangeGrade.color = DEFINE.GetGradeColor((GRADE_TYPE)changeEquipmentData.grade);
            //textCurrentUpgradeText.text;
            textChangeUpgrade.text = string.Format("+{0}", (changeEquipmentData.upgrade));;
            //textCurrentTierText.text;
            textChangeTier.text = string.Format("{0}T", dBChangeEquipment.tier);
            //textCurrentJobText.text;

            Color temp_color = imageChangeJob[0].color;
            for (int i = 0; i < 5; i++)
            {
                imageChangeJob[i].color = new Color(temp_color.r, temp_color.g, temp_color.b, 0.2f);
            }
            if (dBChangeEquipment.jobLimit == SERVANT_JOB_FLAG.All)
            {
                for (int i = 0; i < 5; i++)
                {
                    imageChangeJob[i].color = new Color(temp_color.r, temp_color.g, temp_color.b, 1f);
                }
            }
            else
            {
                for (int i = 0; i < 5; i++)
                {
                    SERVANT_JOB_FLAG checkJob = (SERVANT_JOB_FLAG)Math.Pow(2, (double)(i + 1));
                    if (dBChangeEquipment.isEquipAble(checkJob) == true)
                    {
                        imageChangeJob[i].color = new Color(temp_color.r, temp_color.g, temp_color.b, 1f);
                    }
                }
            }

            //초기화
            for (int i = 0; i < 10; i++)
            {
                change_stat[i] = 0;
            }

            imageChangeStat[0].sprite = CSVData.Inst.GetSpriteOptionType(changeEquipmentData.optionType);
            textChangeStat[0].text    = string.Format("{0}", changeEquipmentData.value);
            change_stat[(int)changeEquipmentData.optionType] = changeEquipmentData.value;

            buttonChange.interactable = true;
        }
        else
        {
            DebugLog.Log(false, "change item none");
            FrameChangeItemInfo.SetActive(false);
            FrameChangeItemNone.SetActive(true);

            buttonChange.interactable = false;
        }

        SetChangeAllValue();
    }
    void updateAllView()
    {
        //Current Item
        UserServantData servantData = partyInfo.ServantList[partyInfo.selected_unit_idx];

        if (servantData == null)
        {
            DebugLog.Log(false, "Invalid Servant Index : " + partyInfo.selected_unit_idx);
        }

        UserEquipmentData currentEquipmentData = null;

        if (partyInfo.getSelectedEquipType() == EQUIPMENT_TYPE.MAX)
        {
            DebugLog.Log(false, "Invalid Equipment type 'MAX'");
            return;
        }

        int current_item_idx = servantData.equipmentDic[partyInfo.getSelectedEquipType()];

        if (current_item_idx > 0)
        {
            FrameCurrentItemInfo.SetActive(true);
            FrameCurrentItemNone.SetActive(false);
            currentEquipmentData = UserDataManager.Inst.GetEquipmentInfo(current_item_idx);

            if (currentEquipmentData == null)
            {
                DebugLog.Log(false, "Invalid Equipment data");
            }


            DBEquipmentData dBEquipment = CSVData.Inst.GetEquipmentData(currentEquipmentData.id);
            if (dBEquipment == null)
            {
                DebugLog.Log(false, "Invalid equipmentData ID : " + currentEquipmentData.id);
            }

            imageCurrentItem.sprite  = dBEquipment.equipmentIcon;
            textCurrentItemName.text = dBEquipment.name;
            //textCurrentGradeText.text;
            textCurrentGrade.text  = string.Format("{0}", ((GRADE_TYPE)currentEquipmentData.grade));
            textCurrentGrade.color = DEFINE.GetGradeColor((GRADE_TYPE)currentEquipmentData.grade);
            //textCurrentUpgradeText.text;
            textCurrentUpgrade.text = string.Format("+{0}", (currentEquipmentData.upgrade));;
            //textCurrentTierText.text;
            textCurrentTier.text = string.Format("{0}T", dBEquipment.tier);
            //textCurrentJobText.text;

            Color temp_color = imageCurrentJob[0].color;
            for (int i = 0; i < 5; i++)
            {
                imageCurrentJob[i].color = new Color(temp_color.r, temp_color.g, temp_color.b, 0.2f);
            }

            if (dBEquipment.jobLimit == SERVANT_JOB_FLAG.All)
            {
                for (int i = 0; i < 5; i++)
                {
                    imageCurrentJob[i].color = new Color(temp_color.r, temp_color.g, temp_color.b, 1f);
                }
            }
            else
            {
                for (int i = 0; i < 5; i++)
                {
                    SERVANT_JOB_FLAG checkJob = (SERVANT_JOB_FLAG)Math.Pow(2, (double)(i + 1));
                    if (dBEquipment.isEquipAble(checkJob) == true)
                    {
                        imageCurrentJob[i].color = new Color(temp_color.r, temp_color.g, temp_color.b, 1f);
                    }
                }
            }

            //초기화
            for (int i = 0; i < 10; i++)
            {
                current_stat[i] = 0;
            }

            imageCurrentStat[0].sprite = CSVData.Inst.GetSpriteOptionType(currentEquipmentData.optionType);
            textCurrentStat[0].text    = string.Format("{0}", currentEquipmentData.value);
            current_stat[(int)currentEquipmentData.optionType] = currentEquipmentData.value;

            //장착된 아이템이 있을땐 Clear버튼 활성화
            buttonClear.interactable = true;
        }
        else
        {
            DebugLog.Log(false, "current item none");
            FrameCurrentItemInfo.SetActive(false);
            FrameCurrentItemNone.SetActive(true);

            //장착된 아이템이 없을땐 Clear버튼 비활성화
            buttonClear.interactable = false;
        }

        updateChangeItemInfo(selectedItemIdx);

        SetChangeAllValue();
    }
Beispiel #15
0
 private void playAnimationMove(Vector3 dir)
 {
     DEFINE.DIRECTION DIR = DEFINE.GetDir(dir);
     animMove.Play("animMove" + "_d" + (int)DIR + "_t" + (int)team);
 }