示例#1
0
 public BerryTileData(BerryTile berryTile)
 {
     id                 = berryTile.id;
     berryIsPlanted     = berryTile.berryIsPlanted;
     plantedBerryName   = berryTile.plantedBerryName;
     berryStage         = berryTile.berryStage;
     berryPlantedAtTime = berryTile.berryPlantedAtTime;
     berryGrowthSpeed   = berryTile.berryGrowthSpeed;
     berryGrowthPoints  = berryTile.berryGrowthPoints;
 }
示例#2
0
    public bool TriggerBerryChoice(BerryTile berryTile)
    {
        tileBeingPlanted = berryTile;
        InventoryUI inventoryUI;

        seedsToPlant.Clear();
        berryInfo.Clear();
        if ((inventoryUI = FindObjectOfType <InventoryUI>()) != null)
        {
            seedsToPlant = inventoryUI.GetActiveSeeds();
        }

        if (seedsToPlant.Count == 0)
        {
            return(false);
        }

        firstSeed = true;
        berryPanel.SetActive(true);
        GameObject firstSlot = null;

        foreach (SeedBase seed in seedsToPlant)
        {
            BerryInfo berry;

            if (firstSeed)
            {
                firstSeed = false;
                berry     = Instantiate(firstBerryInfoHolder, berryHolder.transform);
                firstSlot = berry.gameObject;
            }
            else
            {
                berry = Instantiate(additionalBerryInfoHolder, berryHolder.transform);
            }

            berry.BerryInfoSetup(seed.GetSeedSprite(), seed.GetSeedName(), gameObject.GetComponent <BerryChoice>());
            berryInfo.Add(berry);
        }

        StartCoroutine(ShortWait(firstSlot));

        return(true);
    }