Example #1
0
    public void CoreValueAdded()
    {
        Material MT = SC2.GetComponent <MaterialInventory>().materials[0];

        if (MT.materialID == 32)
        {
            SC1.GetComponent <CoreInventory>().cores[0].Originalfire += 2;
        }
        if (MT.materialID == 33)
        {
            SC1.GetComponent <CoreInventory>().cores[0].Originalice += 2;
        }
        if (MT.materialID == 34)
        {
            SC1.GetComponent <CoreInventory>().cores[0].Originallight += 2;
        }
        if (MT.materialID == 35)
        {
            SC1.GetComponent <CoreInventory>().cores[0].Originaldark += 2;
        }
        if (MT.materialID == 31)
        {
            SC1.GetComponent <CoreInventory>().cores[0].INTOri += 2;
            SC1.GetComponent <CoreInventory>().cores[0].STROri += 2;
        }

        if (MT.materialID == 29)
        {
            SC1.GetComponent <CoreInventory>().cores[0].INTOri += 2;
        }


        if (MT.materialID == 27)
        {
            SC1.GetComponent <CoreInventory>().cores[0].STROri += 2;
        }



        if (MT.materialID == 23)
        {
            SC1.GetComponent <CoreInventory>().cores[0].INTOri += 1;
            SC1.GetComponent <CoreInventory>().cores[0].STROri += 1;
        }

        if (MT.materialID == 38)
        {
            SC1.GetComponent <CoreInventory>().cores[0].LUKOri += 1;
            SC1.GetComponent <CoreInventory>().cores[0].DEXOri += 1;
        }
        if (MT.materialID == 39)
        {
            SC1.GetComponent <CoreInventory>().cores[0].LUKOri += 3;
            SC1.GetComponent <CoreInventory>().cores[0].DEXOri += 3;
        }



        if (MT.materialID == 24)
        {
            SC1.GetComponent <CoreInventory>().cores[0].STROri += 1;
        }

        if (MT.materialID == 25)
        {
            SC1.GetComponent <CoreInventory>().cores[0].INTOri += 1;
        }


        if (MT.materialID == 11)
        {
            SC1.GetComponent <CoreInventory>().cores[0].LUKOri += 1;
        }

        if (MT.materialID == 36)
        {
            SC1.GetComponent <CoreInventory>().cores[0].coreLevel += 1;
        }

        ItemRefactorizing.ChangingCore(SC1.GetComponent <CoreInventory>().cores[0]);
    }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        if (slimeState.Weapon.typeOfAttack.Equals("Magical"))
        {
            slimeState.AttackPoint = slimeState.MagicalATK;
        }
        else
        {
            slimeState.AttackPoint = slimeState.PhysicalATK;
        }
        slimeState.Weapon.IsThisDesc    = false;
        slimeState.Accessory.IsThisDesc = false;
        slimeState.Aura.IsThisDesc      = false;
        slimeState.UsedCore.IsThisDesc  = true;


        if (slimeState != null)
        {
            AuraIndex = slimeState.Aura.EquipmentID;
        }
        if (AuraIndex == 0)
        {
            AuraEquipped = false;
        }
        if (AuraIndex != 0)
        {
            AuraEquipped = true;
        }

        if (AuraEquipped == true)
        {
            if (this.transform.GetChild(3).childCount == 0)
            {
                if (slimeState.Aura.EquipmentID == 109 || slimeState.Aura.EquipmentID == 110 || slimeState.Aura.EquipmentID == 111 || slimeState.Aura.EquipmentID == 113)
                {
                    Instantiate(AuraDBOB.GetComponent <AuraHoldGameOB>().Auras[AuraIndex - 100], this.transform.position + new Vector3(0, 0, 0), new Quaternion(), this.transform.GetChild(3)).transform.localPosition = new Vector3(0, 2, 0);
                }
                else
                {
                    Instantiate(AuraDBOB.GetComponent <AuraHoldGameOB>().Auras[AuraIndex - 100], this.transform.position, new Quaternion(), this.transform.GetChild(3)).transform.localPosition = new Vector3(0, 0, 0);
                }
            }
            if (this.transform.GetChild(3).childCount != 0 && this.transform.GetChild(3).GetChild(0).GetComponent <GetIDAura>().ID != AuraIndex - 100)
            {
                if ((slimeState.Aura.EquipmentID == 109 || slimeState.Aura.EquipmentID == 110 || slimeState.Aura.EquipmentID == 111 || slimeState.Aura.EquipmentID == 113))
                {
                    Destroy(this.transform.GetChild(3).GetChild(0).gameObject);
                    Instantiate(AuraDBOB.GetComponent <AuraHoldGameOB>().Auras[AuraIndex - 100], this.transform.position + new Vector3(0, 0, 0), new Quaternion(), this.transform.GetChild(3)).transform.localPosition = new Vector3(0, 2, 0);
                }

                else
                {
                    Destroy(this.transform.GetChild(3).GetChild(0).gameObject);
                    Instantiate(AuraDBOB.GetComponent <AuraHoldGameOB>().Auras[AuraIndex - 100], this.transform.position, new Quaternion(), this.transform.GetChild(3)).transform.localPosition = new Vector3(0, 0, 0);
                }
            }
        }
        if (AuraEquipped == false)
        {
            if (this.transform.GetChild(3).childCount != 0)
            {
                Destroy(this.transform.GetChild(3).GetChild(0).gameObject);
            }
        }



        if (slimeState.AttackType.Equals("Physical"))
        {
            slimeState.AtimeNeed = ((2 + slimeState.MovementSpeed) / slimeState.MovementSpeed) * 0.5f;
        }
        else if (slimeState.AttackType.Equals("Magical"))
        {
            slimeState.AtimeNeed = (2 + slimeState.MovementSpeed) / slimeState.MovementSpeed;
        }
        else
        {
            slimeState.AtimeNeed = ((2 + slimeState.MovementSpeed) / slimeState.MovementSpeed) * 0.5f;
        }


        if (slimeState.AtimeNow >= slimeState.AtimeNeed)
        {
            slimeState.AttackReady = true;
        }
        else if (slimeState.AtimeNow < slimeState.AtimeNeed)
        {
            slimeState.AttackReady = false;
        }



        if (slimeState.WorkTimeNow >= slimeState.WorkTimeNeed)
        {
            slimeState.WorkDone = true;
        }

        else if (slimeState.WorkTimeNow < slimeState.AtimeNeed)
        {
            slimeState.WorkDone = false;
        }



        slimeState.STR = Mathf.Round(1 + slimeState.UsedCore.STR * slimeState.Level * LevelStateAlpha);
        slimeState.INT = Mathf.Round(1 + slimeState.UsedCore.INT * slimeState.Level * LevelStateAlpha);
        slimeState.DEX = Mathf.Round(1 + slimeState.UsedCore.DEX * slimeState.Level * LevelStateAlpha);
        slimeState.LUK = Mathf.Round(1 + slimeState.UsedCore.LUK * slimeState.Level * LevelStateAlpha);


        if (SkillDatabase.INTBuffer == true)
        {
            slimeState.INT = Mathf.Round(1 + slimeState.UsedCore.INT * slimeState.Level * LevelStateAlpha * SkillDBS.GetComponent <SkillDatabase>().ManaAmplS.IntIncrease);
        }

        if (SkillDatabase.STRBuffer == true)
        {
            slimeState.STR = Mathf.Round(1 + slimeState.UsedCore.STR * slimeState.Level * LevelStateAlpha * SkillDBS.GetComponent <SkillDatabase>().StrengthenS.STRIncrease);
        }



        slimeState.MovementSpeed = Mathf.Round(((slimeState.DEX / (slimeState.DEX + AlphaForMM)) * MovementSpeedAlpha) + 1f + slimeState.Accessory.MovementSpeed);
        slimeState.MiningAbility = Mathf.Round(((slimeState.LUK / (slimeState.LUK + AlphaForMM)) * MiningAbAlpha) + 1f + slimeState.Accessory.WorkingPoint + slimeState.Weapon.WorkingPoint);
        slimeState.CriticalPoint = (slimeState.LUK / (slimeState.LUK + AlphaForMM) + slimeState.Weapon.CriticalPoint + slimeState.Accessory.CriticalPoint + slimeState.Aura.CriticalPoint);

        if (slimeState.CriticalPoint > 1)
        {
            slimeState.CriticalPoint = 1;
        }

        slimeState.Fire  = slimeState.UsedCore.fire + slimeState.Weapon.fire + slimeState.Accessory.fire + slimeState.Aura.fire;
        slimeState.Ice   = slimeState.UsedCore.ice + slimeState.Weapon.ice + slimeState.Accessory.ice + slimeState.Aura.ice;
        slimeState.Light = slimeState.UsedCore.light + slimeState.Weapon.light + slimeState.Accessory.light + slimeState.Aura.light;
        slimeState.Dark  = slimeState.UsedCore.dark + slimeState.Weapon.dark + slimeState.Accessory.dark + slimeState.Aura.dark;


        if (slimeState.Weapon.typeOfAttack.Equals("Magical"))
        {
            slimeState.AttackType = slimeState.Weapon.typeOfAttack;
        }
        else
        {
            slimeState.AttackType = "Physical";
        }

        slimeState.PhysicalATK    = 5 + slimeState.Weapon.PhysicalAttack + slimeState.STR + (slimeState.STR * DamageAlpha) * (slimeState.Accessory.PhysicalAttack + slimeState.Weapon.PhysicalAttack + slimeState.Aura.PhysicalAttack);
        slimeState.MagicalATK     = 5 + slimeState.Weapon.MagicalAttack + slimeState.INT + (slimeState.INT * DamageAlpha) * (slimeState.Accessory.MagicalAttack + slimeState.Weapon.MagicalAttack + slimeState.Aura.MagicalAttack);
        slimeState.PriceToLevelUP = System.Convert.ToInt64(ItemRefactorizing.RankToNumber(slimeState.SlimeRank) * System.Math.Pow(LevelPricePowIndex, slimeState.Level) * LevelPriceAlpha);



        if (slimeState.Weapon.IsItEquipped == false)
        {
            slimeState.Weapon.IsItEquipped = true;
        }
        if (slimeState.Accessory.IsItEquipped == false)
        {
            slimeState.Accessory.IsItEquipped = true;
        }
        if (slimeState.Aura.IsItEquipped == false)
        {
            slimeState.Aura.IsItEquipped = true;
        }
        if (slimeState.UsedCore.IsItEquipped == true)
        {
            slimeState.UsedCore.IsItEquipped = true;
        }

        if (SkillDatabase.INTBuffer == true && SkillDatabase.STRBuffer == true)
        {
            this.transform.GetChild(4).GetChild(2).gameObject.SetActive(true);
            this.transform.GetChild(4).GetChild(1).gameObject.SetActive(false);
            this.transform.GetChild(4).GetChild(0).gameObject.SetActive(false);
        }
        if (SkillDatabase.INTBuffer == true && SkillDatabase.STRBuffer == false)
        {
            this.transform.GetChild(4).GetChild(2).gameObject.SetActive(false);
            this.transform.GetChild(4).GetChild(1).gameObject.SetActive(true);
            this.transform.GetChild(4).GetChild(0).gameObject.SetActive(false);
        }
        if (SkillDatabase.STRBuffer == true && SkillDatabase.INTBuffer == false)
        {
            this.transform.GetChild(4).GetChild(2).gameObject.SetActive(false);
            this.transform.GetChild(4).GetChild(1).gameObject.SetActive(false);
            this.transform.GetChild(4).GetChild(0).gameObject.SetActive(true);
        }
        if (SkillDatabase.INTBuffer == false && SkillDatabase.STRBuffer == false)
        {
            this.transform.GetChild(4).GetChild(2).gameObject.SetActive(false);
            this.transform.GetChild(4).GetChild(1).gameObject.SetActive(false);
            this.transform.GetChild(4).GetChild(0).gameObject.SetActive(false);
        }

        SetTypeOfElement();
    }
Example #3
0
    // Update is called once per frame
    void Update()
    {
        if (CoreUI.SwitchCoreUI == true)
        {
            ItemRefactorizing.ChangingCore(selectedCore);
            CoreContent.transform.GetChild(0).GetChild(0).GetComponent <TextMeshProUGUI>().text             = selectedCore.fire.ToString() + " (+" + (selectedCore.fire - selectedCore.Originalfire).ToString() + ")";
            CoreContent.transform.GetChild(0).GetChild(1).GetComponent <TextMeshProUGUI>().text             = selectedCore.ice.ToString() + " (+" + (selectedCore.ice - selectedCore.Originalice).ToString() + ")";
            CoreContent.transform.GetChild(0).GetChild(3).GetComponent <TextMeshProUGUI>().text             = selectedCore.dark.ToString() + " (+" + (selectedCore.dark - selectedCore.Originaldark).ToString() + ")";
            CoreContent.transform.GetChild(0).GetChild(2).GetComponent <TextMeshProUGUI>().text             = selectedCore.light.ToString() + " (+" + (selectedCore.light - selectedCore.Originallight).ToString() + ")";
            CoreContent.transform.GetChild(1).GetChild(0).GetComponent <TextMeshProUGUI>().text             = selectedCore.coreName + " (+" + selectedCore.coreLevel + ")";
            CoreContent.transform.GetChild(1).GetChild(1).GetComponent <TextMeshProUGUI>().text             = selectedCore.corePower.ToString();
            CoreContent.transform.GetChild(1).GetChild(2).GetChild(0).GetComponent <Image>().sprite         = selectedCore.itemImage;
            CoreContent.transform.GetChild(1).GetChild(2).GetChild(1).GetComponent <TextMeshProUGUI>().text = selectedCore.coreRank;
            CoreContent.transform.GetChild(1).GetChild(2).GetChild(2).GetComponent <TextMeshProUGUI>().text = "+" + selectedCore.coreLevel.ToString();
            CoreContent.transform.GetChild(1).GetChild(3).GetComponent <TextMeshProUGUI>().text             = selectedCore.coreRank;
            CoreContent.transform.GetChild(1).GetChild(4).GetComponent <TextMeshProUGUI>().text             = selectedCore.price.ToString();
            CoreContent.transform.GetChild(1).GetChild(5).GetChild(0).GetComponent <TextMeshProUGUI>().text = selectedCore.CoreDescription;

            if (selectedCore.coreRank.Equals("D"))
            {
                CoreContent.transform.GetChild(1).GetChild(0).GetComponent <TextMeshProUGUI>().color             = D;
                CoreContent.transform.GetChild(1).GetChild(2).GetChild(1).GetComponent <TextMeshProUGUI>().color = D;
                CoreContent.transform.GetChild(1).GetChild(3).GetComponent <TextMeshProUGUI>().color             = D;
            }
            else if (selectedCore.coreRank.Equals("C"))
            {
                CoreContent.transform.GetChild(1).GetChild(0).GetComponent <TextMeshProUGUI>().color             = C;
                CoreContent.transform.GetChild(1).GetChild(2).GetChild(1).GetComponent <TextMeshProUGUI>().color = C;
                CoreContent.transform.GetChild(1).GetChild(3).GetComponent <TextMeshProUGUI>().color             = C;
            }
            else if (selectedCore.coreRank.Equals("B"))
            {
                CoreContent.transform.GetChild(1).GetChild(0).GetComponent <TextMeshProUGUI>().color             = B;
                CoreContent.transform.GetChild(1).GetChild(2).GetChild(1).GetComponent <TextMeshProUGUI>().color = B;
                CoreContent.transform.GetChild(1).GetChild(3).GetComponent <TextMeshProUGUI>().color             = B;
            }
            else if (selectedCore.coreRank.Equals("A"))
            {
                CoreContent.transform.GetChild(1).GetChild(0).GetComponent <TextMeshProUGUI>().color             = A;
                CoreContent.transform.GetChild(1).GetChild(2).GetChild(1).GetComponent <TextMeshProUGUI>().color = A;
                CoreContent.transform.GetChild(1).GetChild(3).GetComponent <TextMeshProUGUI>().color             = A;
            }
            else if (selectedCore.coreRank.Equals("S"))
            {
                CoreContent.transform.GetChild(1).GetChild(0).GetComponent <TextMeshProUGUI>().color             = S;
                CoreContent.transform.GetChild(1).GetChild(2).GetChild(1).GetComponent <TextMeshProUGUI>().color = S;
                CoreContent.transform.GetChild(1).GetChild(3).GetComponent <TextMeshProUGUI>().color             = S;
            }

            CoreContent.transform.GetChild(2).GetChild(0).GetComponent <TextMeshProUGUI>().text = Mathf.RoundToInt(selectedCore.STR).ToString() + " (+" + Mathf.RoundToInt(selectedCore.STR - selectedCore.STROri).ToString() + ")";
            CoreContent.transform.GetChild(2).GetChild(1).GetComponent <TextMeshProUGUI>().text = Mathf.RoundToInt(selectedCore.INT).ToString() + " (+" + Mathf.RoundToInt(selectedCore.INT - selectedCore.INTOri).ToString() + ")";
            CoreContent.transform.GetChild(2).GetChild(2).GetComponent <TextMeshProUGUI>().text = Mathf.RoundToInt(selectedCore.DEX).ToString() + " (+" + Mathf.RoundToInt(selectedCore.DEX - selectedCore.DEXOri).ToString() + ")";
            CoreContent.transform.GetChild(2).GetChild(3).GetComponent <TextMeshProUGUI>().text = Mathf.RoundToInt(selectedCore.LUK).ToString() + " (+" + Mathf.RoundToInt(selectedCore.LUK - selectedCore.LUKOri).ToString() + ")";

            CoreContent.transform.parent.parent.parent.GetChild(4).GetChild(0).GetComponent <TextMeshProUGUI>().text = MoneyUnitControl.FormatNumber(System.Convert.ToInt64(selectedCore.priceToUpgrade)).ToString();
        }


        if (MaterialUI.SwitchMaterialUI == true)
        {
            MaterialContent.transform.GetChild(0).GetChild(0).GetChild(0).GetComponent <Image>().sprite         = selectedMT.MaterialImage;
            MaterialContent.transform.GetChild(0).GetChild(1).GetComponent <TextMeshProUGUI>().text             = selectedMT.MaterialName;
            MaterialContent.transform.GetChild(0).GetChild(2).GetChild(0).GetComponent <TextMeshProUGUI>().text = selectedMT.MaterialRank;
            MaterialContent.transform.GetChild(0).GetChild(3).GetChild(0).GetComponent <TextMeshProUGUI>().text = selectedMT.Description;
            MaterialContent.transform.GetChild(0).GetChild(4).GetComponent <TextMeshProUGUI>().text             = selectedMT.Price.ToString();

            if (selectedMT.MaterialRank.Equals("D"))
            {
                MaterialContent.transform.GetChild(0).GetChild(1).GetComponent <TextMeshProUGUI>().color             = D;
                MaterialContent.transform.GetChild(0).GetChild(2).GetChild(0).GetComponent <TextMeshProUGUI>().color = D;
            }
            else if (selectedMT.MaterialRank.Equals("C"))
            {
                MaterialContent.transform.GetChild(0).GetChild(1).GetComponent <TextMeshProUGUI>().color             = C;
                MaterialContent.transform.GetChild(0).GetChild(2).GetChild(0).GetComponent <TextMeshProUGUI>().color = C;
            }
            else if (selectedMT.MaterialRank.Equals("B"))
            {
                MaterialContent.transform.GetChild(0).GetChild(1).GetComponent <TextMeshProUGUI>().color             = B;
                MaterialContent.transform.GetChild(0).GetChild(2).GetChild(0).GetComponent <TextMeshProUGUI>().color = B;
            }
            else if (selectedMT.MaterialRank.Equals("A"))
            {
                MaterialContent.transform.GetChild(0).GetChild(1).GetComponent <TextMeshProUGUI>().color             = A;
                MaterialContent.transform.GetChild(0).GetChild(2).GetChild(0).GetComponent <TextMeshProUGUI>().color = A;
            }
            else if (selectedMT.MaterialRank.Equals("S"))
            {
                MaterialContent.transform.GetChild(0).GetChild(1).GetComponent <TextMeshProUGUI>().color             = S;
                MaterialContent.transform.GetChild(0).GetChild(2).GetChild(0).GetComponent <TextMeshProUGUI>().color = S;
            }
        }

        if (EquipmentUI.SwitchEQUI == true)
        {
            ItemRefactorizing.ChaningEQ(selectedEQ);
            EQContent.transform.GetChild(0).GetChild(0).GetComponent <TextMeshProUGUI>().text = selectedEQ.fire.ToString() + " (+" + (selectedEQ.fire - selectedEQ.originalfire).ToString() + ")";
            EQContent.transform.GetChild(0).GetChild(1).GetComponent <TextMeshProUGUI>().text = selectedEQ.ice.ToString() + " (+" + (selectedEQ.ice - selectedEQ.originalice).ToString() + ")";
            EQContent.transform.GetChild(0).GetChild(2).GetComponent <TextMeshProUGUI>().text = selectedEQ.light.ToString() + " (+" + (selectedEQ.light - selectedEQ.originallight).ToString() + ")";
            EQContent.transform.GetChild(0).GetChild(3).GetComponent <TextMeshProUGUI>().text = selectedEQ.dark.ToString() + " (+" + (selectedEQ.dark - selectedEQ.originaldark).ToString() + ")";

            EQContent.transform.GetChild(1).GetChild(0).GetComponent <TextMeshProUGUI>().text             = selectedEQ.EquipmentName + " (+" + selectedEQ.EqLevel + ")";
            EQContent.transform.GetChild(1).GetChild(1).GetComponent <TextMeshProUGUI>().text             = selectedEQ.typeOfEQ;
            EQContent.transform.GetChild(1).GetChild(2).GetComponent <TextMeshProUGUI>().text             = Mathf.RoundToInt(selectedEQ.PhysicalAttack).ToString() + " (+" + Mathf.RoundToInt((selectedEQ.PhysicalAttack - selectedEQ.PhysicalAttackOrigin)).ToString() + ")";
            EQContent.transform.GetChild(1).GetChild(3).GetComponent <TextMeshProUGUI>().text             = Mathf.RoundToInt(selectedEQ.MagicalAttack).ToString() + " (+" + Mathf.RoundToInt((selectedEQ.MagicalAttack - selectedEQ.MagicalAttackOrigin)).ToString() + ")";
            EQContent.transform.GetChild(1).GetChild(4).GetChild(0).GetComponent <Image>().sprite         = selectedEQ.EquipmentImage;
            EQContent.transform.GetChild(1).GetChild(4).GetChild(1).GetComponent <TextMeshProUGUI>().text = selectedEQ.EquipmentRank;
            EQContent.transform.GetChild(1).GetChild(4).GetChild(2).GetComponent <TextMeshProUGUI>().text = "+" + selectedEQ.EqLevel.ToString();
            EQContent.transform.GetChild(1).GetChild(5).GetComponent <TextMeshProUGUI>().text             = selectedEQ.Price.ToString();
            EQContent.transform.GetChild(1).GetChild(6).GetChild(0).GetComponent <TextMeshProUGUI>().text = selectedEQ.Description;

            EQContent.transform.parent.parent.parent.GetChild(5).GetChild(0).GetComponent <TextMeshProUGUI>().text = MoneyUnitControl.FormatNumber(selectedEQ.PriceToUpgrade);


            if (selectedEQ.EquipmentRank.Equals("D"))
            {
                EQContent.transform.GetChild(1).GetChild(0).GetComponent <TextMeshProUGUI>().color             = D;
                EQContent.transform.GetChild(1).GetChild(4).GetChild(1).GetComponent <TextMeshProUGUI>().color = D;
            }

            else if (selectedEQ.EquipmentRank.Equals("C"))
            {
                EQContent.transform.GetChild(1).GetChild(0).GetComponent <TextMeshProUGUI>().color             = C;
                EQContent.transform.GetChild(1).GetChild(4).GetChild(1).GetComponent <TextMeshProUGUI>().color = C;
            }
            else if (selectedEQ.EquipmentRank.Equals("B"))
            {
                EQContent.transform.GetChild(1).GetChild(0).GetComponent <TextMeshProUGUI>().color             = B;
                EQContent.transform.GetChild(1).GetChild(4).GetChild(1).GetComponent <TextMeshProUGUI>().color = B;
            }
            else if (selectedEQ.EquipmentRank.Equals("A"))
            {
                EQContent.transform.GetChild(1).GetChild(0).GetComponent <TextMeshProUGUI>().color             = A;
                EQContent.transform.GetChild(1).GetChild(4).GetChild(1).GetComponent <TextMeshProUGUI>().color = A;
            }
            else if (selectedEQ.EquipmentRank.Equals("S"))
            {
                EQContent.transform.GetChild(1).GetChild(0).GetComponent <TextMeshProUGUI>().color             = S;
                EQContent.transform.GetChild(1).GetChild(4).GetChild(1).GetComponent <TextMeshProUGUI>().color = S;
            }



            if (selectedEQ.IsItEquipped == false)
            {
                EQContent.transform.parent.parent.parent.GetChild(2).gameObject.SetActive(true);
                EQContent.transform.parent.parent.parent.GetChild(3).gameObject.SetActive(false);
            }
            else if (selectedEQ.IsItEquipped == true)
            {
                EQContent.transform.parent.parent.parent.GetChild(2).gameObject.SetActive(false);
                EQContent.transform.parent.parent.parent.GetChild(3).gameObject.SetActive(true);
            }
        }


        if (ReinforceUI.SwitchReinUI == true)
        {
            ReinforceUIA.transform.GetChild(2).GetChild(0).GetComponent <Image>().sprite = selectedEQ.EquipmentImage;
            ReinforceUIA.transform.GetChild(3).GetComponent <TextMeshProUGUI>().text     = selectedEQ.EquipmentName + " (+" + selectedEQ.EqLevel.ToString() + ")";
            ReinforceUIA.transform.GetChild(4).GetComponent <TextMeshProUGUI>().text     = "+" + selectedEQ.EqLevel.ToString();
            ReinforceUIA.transform.GetChild(5).GetComponent <TextMeshProUGUI>().text     = "+" + (selectedEQ.EqLevel + 1).ToString();
            ReinforceUIA.transform.GetChild(6).GetComponent <TextMeshProUGUI>().text     = (MoneyUnitControl.ReturnProbForRein(selectedEQ.EqLevel) * 100).ToString() + " %";
            ReinforceUIA.transform.GetChild(8).GetComponent <TextMeshProUGUI>().text     = MoneyUnitControl.FormatNumber(selectedEQ.PriceToUpgrade);
        }
        if (ReinforceCoreUI.SwitchReinCoreUI == true)
        {
            ReinforceUICore.transform.GetChild(2).GetChild(0).GetComponent <Image>().sprite = selectedCore.itemImage;

            ReinforceUICore.transform.GetChild(3).GetComponent <TextMeshProUGUI>().text = selectedCore.coreName + " (+" + selectedCore.coreLevel.ToString() + ")";
            ReinforceUICore.transform.GetChild(4).GetComponent <TextMeshProUGUI>().text = "+" + selectedCore.coreLevel.ToString();
            ReinforceUICore.transform.GetChild(5).GetComponent <TextMeshProUGUI>().text = "+" + (selectedCore.coreLevel + 1).ToString();
            ReinforceUICore.transform.GetChild(6).GetComponent <TextMeshProUGUI>().text = (MoneyUnitControl.ReturnProbForRein(selectedCore.coreLevel) * 100).ToString() + " %";
            ReinforceUICore.transform.GetChild(8).GetComponent <TextMeshProUGUI>().text = MoneyUnitControl.FormatNumber(System.Convert.ToInt64(selectedCore.priceToUpgrade));
        }
    }
    public void OnClickLoadButton()
    {
        string realPath = Application.persistentDataPath + "/save.dat";


        if (SaveSystem.Load(realPath) != null)
        {
            PD = SaveSystem.Load(realPath);

            Destroy(SlimeDBOB.transform.GetChild(0).gameObject);
            Destroy(SlimeDBOB.transform.GetChild(1).gameObject);


            for (int i = 0; i < GateWay.GetComponent <GateWayHP>().GateWayStat.Count; i++)
            {
                GateWay.GetComponent <GateWayHP>().GateWayStat[i] = PD.LevelOfGates[i].Level;
            }


            for (int i = 0; i < PD.NumberOfSlime; i++)
            {
                Instant = Instantiate(SlimeDBOB.GetComponent <SlimeDB>().InstantSlime, new Vector3(0, 0, 0), new Quaternion(), SlimeDBOB.transform);
                Instant.transform.GetChild(0).gameObject.SetActive(false);
                Instant.transform.localScale = new Vector3(0.5f, 0.5f, 1);
                Instant.gameObject.GetComponent <SlimeState>().slimeState = SlimeSet(PD.SlimeStates[i]);

                Instant.gameObject.GetComponent <SlimeState>().slimeState.Weapon    = EQSet(PD.SlimeWeapon[i]);
                Instant.gameObject.GetComponent <SlimeState>().slimeState.Aura      = EQSet(PD.SlimeAura[i]);
                Instant.gameObject.GetComponent <SlimeState>().slimeState.Accessory = EQSet(PD.SlimeAcc[i]);
                Instant.gameObject.GetComponent <SlimeState>().slimeState.UsedCore  = CoreSet(PD.SlimeCore[i]);

                Instant.gameObject.GetComponent <SlimeState>().slimeState.UsedCore.itemImage       = OriginalCoreDB.GetComponent <CoreInventory>().cores[Instant.gameObject.GetComponent <SlimeState>().slimeState.UsedCore.coreID].itemImage;
                Instant.gameObject.GetComponent <SlimeState>().slimeState.Weapon.EquipmentImage    = OriginalEQDB.GetComponent <EquipmentInventory>().eqs[Instant.gameObject.GetComponent <SlimeState>().slimeState.Weapon.EquipmentID].EquipmentImage;
                Instant.gameObject.GetComponent <SlimeState>().slimeState.Accessory.EquipmentImage = OriginalEQDB.GetComponent <EquipmentInventory>().eqs[Instant.gameObject.GetComponent <SlimeState>().slimeState.Accessory.EquipmentID].EquipmentImage;
                Instant.gameObject.GetComponent <SlimeState>().slimeState.Aura.EquipmentImage      = OriginalEQDB.GetComponent <EquipmentInventory>().eqs[Instant.gameObject.GetComponent <SlimeState>().slimeState.Aura.EquipmentID].EquipmentImage;

                Instant.gameObject.transform.position = new Vector3(PD.PositionsOfSlime[i].x, PD.PositionsOfSlime[i].y, PD.PositionsOfSlime[i].z);
                Instant.gameObject.GetComponent <SlimeState>().slimeState.SlimeSprite = SlimeDBOB.GetComponent <SlimeDB>().InstantSlime.GetComponent <SlimeState>().slimeState.SlimeSprite;

                Instant.gameObject.GetComponent <SlimeState>().AuraIndex    = PD.SLimeOtherStates[i].AuraIndex;
                Instant.gameObject.GetComponent <SlimeState>().AuraEquipped = PD.SLimeOtherStates[i].AuraEquipped;
                Instant.gameObject.GetComponent <SlimeWork>().WorkIndex     = PD.SLimeOtherStates[i].WorkIndex;

                if (Instant.gameObject.GetComponent <SlimeState>().slimeState.SlimePlaceIndex != -1)
                {
                    CasUICOPY.GetComponent <SlimeInventoryCopy>().SlimeList1[Instant.gameObject.GetComponent <SlimeState>().slimeState.SlimePlaceIndex] = Instant;
                    CasUI.GetComponent <SlimeInventory>().SlimeList[Instant.gameObject.GetComponent <SlimeState>().slimeState.SlimePlaceIndex]          = Instant;
                }
            }



            PlayerInfor.Money   = PD.Money;
            PlayerInfor.Diamond = PD.Dia;
            PlayerInfor.Stage   = PD.StageLevel;


            for (int i = 0; i < MaterialInv.GetComponent <MaterialInventory>().materials.Count; i++)
            {
                MaterialInv.GetComponent <MaterialInventory>().materials[i].materialID = PD.Material[i].MaterialID;
                MaterialInv.GetComponent <MaterialInventory>().materials[i].Amount     = PD.Material[i].Amount;
            }

            for (int i = 0; i < EquipmentInv.GetComponent <EquipmentInventory>().eqs.Count; i++)
            {
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].EquipmentID          = PD.Equipment[i].EquipmentID;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].AttackPoint          = PD.Equipment[i].AttackPoint;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].CriticalPoint        = PD.Equipment[i].CriticalPoint;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].dark                 = PD.Equipment[i].dark;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].Description          = PD.Equipment[i].Description;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].EqLevel              = PD.Equipment[i].EqLevel;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].EQPositionIndex      = PD.Equipment[i].EQPositionIndex;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].EquipmentName        = PD.Equipment[i].EquipmentName;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].EquipmentRank        = PD.Equipment[i].EquipmentRank;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].fire                 = PD.Equipment[i].fire;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].ice                  = PD.Equipment[i].ice;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].IsItDescOnly         = PD.Equipment[i].IsItDescOnly;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].IsItEquipped         = PD.Equipment[i].IsItEquipped;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].IsThisDesc           = PD.Equipment[i].IsThisDesc;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].light                = PD.Equipment[i].light;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].MagicalAttack        = PD.Equipment[i].MagicalAttack;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].MagicalAttackOrigin  = PD.Equipment[i].MagicalAttackOrigin;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].MovementSpeed        = PD.Equipment[i].MovementSpeed;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].originaldark         = PD.Equipment[i].originaldark;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].originalfire         = PD.Equipment[i].originalfire;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].originalice          = PD.Equipment[i].originalice;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].originallight        = PD.Equipment[i].originallight;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].PhysicalAttack       = PD.Equipment[i].PhysicalAttack;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].PhysicalAttackOrigin = PD.Equipment[i].PhysicalAttackOrigin;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].Price                = PD.Equipment[i].Price;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].PriceToUpgrade       = PD.Equipment[i].PriceToUpgrade;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].typeOfAttack         = PD.Equipment[i].typeOfAttack;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].typeOfEQ             = PD.Equipment[i].typeOfEQ;
                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].WorkingPoint         = PD.Equipment[i].WorkingPoint;


                EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].EquipmentImage = OriginalEQDB.GetComponent <EquipmentInventory>().eqs[EquipmentInv.GetComponent <EquipmentInventory>().eqs[i].EquipmentID].EquipmentImage;
            }

            for (int i = 0; i < CoreInv.GetComponent <CoreInventory>().cores.Count; i++)
            {
                CoreInv.GetComponent <CoreInventory>().cores[i].CoreDescription   = PD.Core[i].CoreDescription;
                CoreInv.GetComponent <CoreInventory>().cores[i].coreID            = PD.Core[i].coreID;
                CoreInv.GetComponent <CoreInventory>().cores[i].coreLevel         = PD.Core[i].coreLevel;
                CoreInv.GetComponent <CoreInventory>().cores[i].coreName          = PD.Core[i].coreName;
                CoreInv.GetComponent <CoreInventory>().cores[i].corePower         = PD.Core[i].corePower;
                CoreInv.GetComponent <CoreInventory>().cores[i].coreRank          = PD.Core[i].coreRank;
                CoreInv.GetComponent <CoreInventory>().cores[i].dark              = PD.Core[i].dark;
                CoreInv.GetComponent <CoreInventory>().cores[i].DEX               = PD.Core[i].DEX;
                CoreInv.GetComponent <CoreInventory>().cores[i].DEXOri            = PD.Core[i].DEXOri;
                CoreInv.GetComponent <CoreInventory>().cores[i].fire              = PD.Core[i].fire;
                CoreInv.GetComponent <CoreInventory>().cores[i].ice               = PD.Core[i].ice;
                CoreInv.GetComponent <CoreInventory>().cores[i].INT               = PD.Core[i].INT;
                CoreInv.GetComponent <CoreInventory>().cores[i].INTOri            = PD.Core[i].INTOri;
                CoreInv.GetComponent <CoreInventory>().cores[i].IsItDescOnly      = PD.Core[i].IsItDescOnly;
                CoreInv.GetComponent <CoreInventory>().cores[i].IsItEquipped      = PD.Core[i].IsItEquipped;
                CoreInv.GetComponent <CoreInventory>().cores[i].IsThisDesc        = PD.Core[i].IsThisDesc;
                CoreInv.GetComponent <CoreInventory>().cores[i].light             = PD.Core[i].light;
                CoreInv.GetComponent <CoreInventory>().cores[i].LUK               = PD.Core[i].LUK;
                CoreInv.GetComponent <CoreInventory>().cores[i].LUKOri            = PD.Core[i].LUKOri;
                CoreInv.GetComponent <CoreInventory>().cores[i].OriginalcorePower = PD.Core[i].OriginalcorePower;
                CoreInv.GetComponent <CoreInventory>().cores[i].Originaldark      = PD.Core[i].Originaldark;
                CoreInv.GetComponent <CoreInventory>().cores[i].Originalfire      = PD.Core[i].Originalfire;
                CoreInv.GetComponent <CoreInventory>().cores[i].Originalice       = PD.Core[i].Originalice;
                CoreInv.GetComponent <CoreInventory>().cores[i].Originallight     = PD.Core[i].Originallight;
                CoreInv.GetComponent <CoreInventory>().cores[i].price             = PD.Core[i].price;
                CoreInv.GetComponent <CoreInventory>().cores[i].priceToUpgrade    = PD.Core[i].priceToUpgrade;
                CoreInv.GetComponent <CoreInventory>().cores[i].STR               = PD.Core[i].STR;
                CoreInv.GetComponent <CoreInventory>().cores[i].STROri            = PD.Core[i].STROri;

                CoreInv.GetComponent <CoreInventory>().cores[i].itemImage = OriginalCoreDB.GetComponent <CoreInventory>().cores[CoreInv.GetComponent <CoreInventory>().cores[i].coreID].itemImage;
            }


            for (int i = 0; i < Skills.GetComponent <SkillDatabase>().SkillDB.Count; i++)
            {
                Skills.GetComponent <SkillDatabase>().SkillDB[i].SkillLevel = PD.LevelOfSkills[i].Level;
            }
        }

        if (SaveSystem.Load(realPath) == null)
        {
            PlayerInfor.Money   = 0;
            PlayerInfor.Diamond = 0;
            PlayerInfor.Stage   = 1;


            SlimeDBOB.transform.GetChild(0).GetComponent <SlimeState>().slimeState.UsedCore = OriginalCoreDB.GetComponent <CoreInventory>().DeepCopyCore(OriginalCoreDB.GetComponent <CoreInventory>().cores[1]);
            SlimeDBOB.transform.GetChild(1).GetComponent <SlimeState>().slimeState.UsedCore = OriginalCoreDB.GetComponent <CoreInventory>().DeepCopyCore(OriginalCoreDB.GetComponent <CoreInventory>().cores[1]);
            SlimeDBOB.transform.GetChild(0).GetComponent <SlimeState>().slimeState.Weapon   = OriginalEQDB.GetComponent <EquipmentInventory>().DeepCopyEQ(OriginalEQDB.GetComponent <EquipmentInventory>().eqs[1]);
            SlimeDBOB.transform.GetChild(1).GetComponent <SlimeState>().slimeState.Weapon   = OriginalEQDB.GetComponent <EquipmentInventory>().DeepCopyEQ(OriginalEQDB.GetComponent <EquipmentInventory>().eqs[50]);
            SlimeDBOB.transform.GetChild(1).GetComponent <SlimeState>().slimeState.Aura     = OriginalEQDB.GetComponent <EquipmentInventory>().DeepCopyEQ(OriginalEQDB.GetComponent <EquipmentInventory>().eqs[106]);

            SlimeDBOB.transform.GetChild(1).GetComponent <SlimeState>().slimeState.Weapon.EqLevel = 7;
            ItemRefactorizing.ChangingCore(SlimeDBOB.transform.GetChild(0).GetComponent <SlimeState>().slimeState.UsedCore);
            ItemRefactorizing.ChangingCore(SlimeDBOB.transform.GetChild(1).GetComponent <SlimeState>().slimeState.UsedCore);
            ItemRefactorizing.ChaningEQ(SlimeDBOB.transform.GetChild(0).GetComponent <SlimeState>().slimeState.Weapon);
            ItemRefactorizing.ChaningEQ(SlimeDBOB.transform.GetChild(1).GetComponent <SlimeState>().slimeState.Weapon);
            ItemRefactorizing.ChaningEQ(SlimeDBOB.transform.GetChild(1).GetComponent <SlimeState>().slimeState.Aura);


            for (int i = 0; i < GateWay.GetComponent <GateWayHP>().GateWayStat.Count; i++)
            {
                GateWay.GetComponent <GateWayHP>().GateWayStat[i] = 1;
            }

            for (int i = 0; i < Skills.GetComponent <SkillDatabase>().SkillDB.Count; i++)
            {
                Skills.GetComponent <SkillDatabase>().SkillDB[i].SkillLevel = 0;
            }
            Skills.GetComponent <SkillDatabase>().SkillDB[0].SkillLevel = 1;
        }
    }