Ejemplo n.º 1
0
    public void PlantSeedPlot(Seeds seedType)
    {
        if (mSeed.mType != SEED_TYPE.None)
        {
            return;
        }
        mSeed = seedType.ShallowCopy();
        switch (seedType.mType)
        {
        //Updating UI
        case SEED_TYPE.Corn:
            //gameObject.sprite = cornSprite;
            gameObject.GetComponent <Image>().sprite = cornSprite;
            //gameObject.GetComponent<Image>().transform.localScale = new Vector3(.5f, .5f);
            break;

        case SEED_TYPE.Wheat:
            gameObject.GetComponent <Image>().sprite = wheatSprite;
            break;

        case SEED_TYPE.Potato:
            gameObject.GetComponent <Image>().sprite = potatoSprite;
            break;

        case SEED_TYPE.Hops:
            gameObject.GetComponent <Image>().sprite = hopsSprite;
            break;
        }
        harvestProgressBar.maximum = mSeed.mHarvestTimeCap;
        ToggleButtonsPlanted();
        FarmingController.GetInstance().totalSeededPlots++;
    }