Exemplo n.º 1
0
    private void BerryDialogue()
    {
        if (genericTextManager == null)
        {
            genericTextManager = FindObjectOfType <GenericTextManager>();
        }

        if (berryStage == 0)
        {
            genericTextManager.DisplayText("A seed could be planted here.");
        }

        if (berryStage == 1)
        {
            genericTextManager.DisplayText("A <color=#BCB845>" + plantedBerry.GetSeedName() + "</color>" + " was planted recently.");
        }

        else if (berryStage == 2)
        {
            genericTextManager.DisplayText("The <color=#BCB845>" + plantedBerry.GetSeedName() + "</color>" + " is just starting to grow.");
        }

        else if (berryStage == 3)
        {
            genericTextManager.DisplayText("The <color=#BCB845>" + plantedBerry.GetSeedName() + "</color>" + " is growing rapidly.");
        }

        else if (berryStage == 4)
        {
            genericTextManager.DisplayText("The <color=#BCB845>" + plantedBerry.GetBerryName() + "</color>" + " looks almost ready for harvest.");
        }
    }
Exemplo n.º 2
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);
 }
Exemplo n.º 3
0
    public InventorySeed GetInventorySeed(SeedBase seed)
    {
        foreach (InventorySlot i in seedSlots)
        {
            SeedBase seed2 = i.GetChildHolder().GetComponentInChildren <SeedBase>();
            if (seed2 != null)
            {
                if (seed.GetSeedName() == seed2.GetSeedName())
                {
                    return(i.GetChildHolder().GetComponentInChildren <InventorySeed>());
                }
            }
        }

        return(null);
    }
Exemplo n.º 4
0
    public void Created()
    {
        if (created)
        {
            return;
        }

        if (GetComponentInChildren <SeedBase>() != null)
        {
            SeedBase seed = GetComponentInChildren <SeedBase>();

            seedName    = seed.GetSeedName();
            berryName   = seed.GetBerryName();
            seedText    = seed.GetInfo();
            seedSprite  = seed.GetSeedSprite();
            berrySprite = seed.GetBerrySprite();
            timeText    = seed.GetGrowthTimeString();
            clockSprite = clock;

            created = true;
        }
    }
Exemplo n.º 5
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;
    }