示例#1
0
 public void PlantBerry(SeedBase berry) //Stage 1
 {
     berryPlantedAtTime = timeManager.GetTimeSeconds();
     berryIsPlanted     = true;
     berryGrowthPoints  = 0;
     berryStage         = 1;
     plantSprite.sprite = plantStageOne;
     plantedBerry       = berry;
     plantedBerryName   = berry.GetSeedName();
     berryGrowthSpeed   = berry.GetGrowthMultiplier();
     plantStageFive     = berry.GetBerryTileFinishedSprite();
     berry.SetInactiveStatus(true);
 }
示例#2
0
    public void LoadTile()
    {
        BerryTileData data = SaveData.current.berryTiles.Find(x => x.id == id);

        if (data != default && data.berryIsPlanted)
        {
            id             = data.id;
            berryIsPlanted = data.berryIsPlanted;

            berryStage         = data.berryStage;
            berryPlantedAtTime = data.berryPlantedAtTime;
            berryGrowthSpeed   = data.berryGrowthSpeed;
            berryGrowthPoints  = data.berryGrowthPoints;

            Item itemSeed = Resources.Load("ScriptableObjects/Seeds/" + data.plantedBerryName) as Item;
            plantedBerry = FindObjectOfType <InventoryUI>().GetSeed(itemSeed.prefab.GetComponent <SeedBase>());

            plantStageFive   = plantedBerry.GetBerryTileFinishedSprite();
            plantedBerryName = plantedBerry.GetSeedName();
            ReloadBerries();
        }
        FindObjectOfType <InventoryUI>().onInventoryFinishedLoadingCallback -= LoadTile;
    }