Ejemplo n.º 1
0
    public void PlantSeed(Pickable newSeed)
    {
        if (seed != null || newSeed.type != Pickable.TYPE.SEED)
        {
            return;
        }

        seed = newSeed as Seed;
        seed.ChangeState();
        seed.rigidbody.simulated     = false;
        seed.transform.parent        = this.transform;
        seed.transform.localPosition = Vector3.zero;
        ChangeState();
        transform.GetChild(0).gameObject.SetActive(true);
    }
Ejemplo n.º 2
0
    public void PutWater(Pickable newSeed)
    {
        if (seed == null || newSeed.type != Pickable.TYPE.BUCKET)
        {
            return;
        }
        Bucket bucket = newSeed as Bucket;

        if (bucket.fillingRate >= 100)
        {
            StartCoroutine(GrowthRoutine(seed.growthTime));
            bucket.fillingRate = 0;
            tilemap.SetTile(CellPosition, tilesGroups.wateredTile);
            seed.ChangeState();
            transform.GetChild(0).gameObject.SetActive(false);
            transform.GetChild(1).gameObject.SetActive(true);
        }
    }