示例#1
0
    public ItemFish getItemFishByBaseId(string baseId) // creates temporary a new fish based on the baseId
    {
        FishItemData fishItemData = this.GetItemFishDataById(baseId);
        ItemFish     itemFish     = new ItemFish(fishItemData);

        return(itemFish);
    }
示例#2
0
 private void refreshRightPage()
 {
     fishItemData = catalogPageGroup[currentPageGroup].rightPage.fishItemInfo;
     recordIndex  = ItemManager.instance.getFishRecordIndexById(fishItemData.id);
     for (int i = 0; i < rightStarIcon.Count; i++)
     {
         rightStarIcon[i].gameObject.SetActive(false);
     }
     if (recordIndex != -1)
     {
         rightFishName.text               = TranslatorManager.instance.GetTranslationById("fish_name_" + fishItemData.id);
         rightTotalCaught.text            = GameManager.instance.saveItemData.savedFishRecord[recordIndex].totalCaught.ToString();
         rightSmallestCaught.text         = GameManager.instance.saveItemData.savedFishRecord[recordIndex].smallestCaught.ToString() + " " + TranslatorManager.instance.GetTranslationById("measurement_inches");
         rightBiggestCaught.text          = GameManager.instance.saveItemData.savedFishRecord[recordIndex].biggestCaught.ToString() + " " + TranslatorManager.instance.GetTranslationById("measurement_inches");
         rightRarity.text                 = TranslatorManager.instance.GetTranslationById("rarity_" + fishItemData.rarity);
         rightDescription.text            = TranslatorManager.instance.GetTranslationById("fish_description_" + fishItemData.id);
         rightFishPortrait.sprite         = fishItemData.fishPortraitImage;
         rightFishPortrait.preserveAspect = true;
         for (int i = 0; i < GameManager.instance.saveItemData.savedFishRecord[recordIndex].highestStar; i++)
         {
             rightStarIcon[i].gameObject.SetActive(true);
         }
     }
     else
     {
         rightFishName.text               = unknown;
         rightTotalCaught.text            = unknown;
         rightSmallestCaught.text         = unknown;
         rightBiggestCaught.text          = unknown;
         rightRarity.text                 = unknown;
         rightDescription.text            = unknown;
         rightFishPortrait.sprite         = fishItemData.fishHiddenPortraitImage;
         rightFishPortrait.preserveAspect = true;
     }
 }
示例#3
0
    public ItemFish createItemFish(string baseId)
    {
        FishItemData fishItemData = this.GetItemFishDataById(baseId);
        ItemFish     itemFish     = new ItemFish(fishItemData);

        GameManager.instance.saveItemData.savedFish.Add(itemFish);
        return(itemFish);
    }
示例#4
0
 public ItemFish(string id, string baseId, double length, double weight, int star)
 {
     this.baseId  = baseId;
     this.length  = length;
     this.weight  = weight;
     this.star    = star;
     this.id      = id;
     fishItemData = ItemManager.instance.GetItemFishDataById(baseId);
 }// Used when first saving data from JSON to the GameManager List
示例#5
0
 public ItemFish(string id, FishItemData fishItemData)// Used when first saving data from JSON to the UI
 {
     this.fishItemData = fishItemData;
     this.baseId       = fishItemData.id;
     this.randomRange  = Random.Range(0.5f, 2f);
     this.length       = System.Math.Round(fishItemData.length * randomRange, 2); // rounding the values to have a maximum of 2 decimal numbers
     this.weight       = System.Math.Round(fishItemData.weight * randomRange, 2); // rounding the values to have a maximum of 2 decimal numbers
     this.star         = starLevel(randomRange);
     this.id           = id;
 }
示例#6
0
 public ItemFish(FishItemData fishItemData)
 {
     this.fishItemData = fishItemData;
     this.baseId       = fishItemData.id;
     this.randomRange  = Random.Range(0.5f, 2f);
     this.length       = System.Math.Round(fishItemData.length * randomRange, 2); // rounding the values to have a maximum of 2 decimal numbers
     this.weight       = System.Math.Round(fishItemData.weight * randomRange, 2); // rounding the values to have a maximum of 2 decimal numbers
     this.star         = starLevel(randomRange);
     this.id           = System.Guid.NewGuid().ToString();
 }
示例#7
0
 // Use this for initialization
 void Start()
 {
     selectedFish     = UIGameManager.instance.selectedFish;
     selectedFishData = ItemManager.instance.GetItemFishDataById(selectedFish.itemFish.baseId);
     tm                       = TranslatorManager.instance;
     itemName.text            = tm.GetTranslationById("fish_name_" + selectedFishData.id); //selectedFishData.fishName;
     itemLength.text          = selectedFish.itemFish.length.ToString() + " " + tm.GetTranslationById("measurement_inches");
     itemWeight.text          = selectedFish.itemFish.weight.ToString() + " " + tm.GetTranslationById("measurement_pounds");
     itemRarity.text          = tm.GetTranslationById("rarity_" + selectedFishData.rarity);
     itemImage.sprite         = selectedFishData.fishPortraitImage;
     itemImage.preserveAspect = true;
     imageHeight              = selectedFish.transform.parent.gameObject.GetComponent <RectTransform>().rect.height;
     transform.position       = new Vector3(selectedFish.transform.position.x, selectedFish.transform.position.y + (Screen.height / 100) * 5, 0);
 }
    // Use this for initialization
    void Start()
    {
        obtainedFish     = ItemManager.instance.obtainedFish;
        obtainedFishData = ItemManager.instance.GetItemFishDataById(obtainedFish.baseId);

        itemName.text            = TranslatorManager.instance.GetTranslationById("fish_name_" + obtainedFishData.id);
        itemLength.text          = obtainedFish.length.ToString() + " " + TranslatorManager.instance.GetTranslationById("measurement_inches");
        itemWeight.text          = obtainedFish.weight.ToString() + " " + TranslatorManager.instance.GetTranslationById("measurement_pounds");
        itemRarity.text          = TranslatorManager.instance.GetTranslationById("rarity_" + obtainedFishData.rarity);
        itemImage.preserveAspect = true;
        itemImage.sprite         = obtainedFishData.fishPortraitImage;
        newRecordText.gameObject.SetActive(false);
        gameObject.SetActive(true);
    }