Ejemplo n.º 1
0
        public override void Respond(Unit unit)
        {
            base.Respond(unit);

            ///IF SEED READY TIO BE PLANTED, PLANT
            if ((pusheableType == PUSHEABLE_TYPE.CARROT_SEEDS || pusheableType == PUSHEABLE_TYPE.PUMKIN_SEEDS) &&
                unit.GetComponent <Player>() != null && unit.GetComponent <Player>().equippedTool == Tool.TOOL_TYPE.SHOVEl &&
                block.fertile
                )
            {
                Pusheable pusheable = Instantiate(product).GetComponent <Pusheable>();

                pusheable.transform.position = block.transform.position;

                //  pusheable.block
                pusheable.block         = block;
                block.unit              = pusheable;
                pusheable.block.fertile = false;
                block.walkable          = false;

                Destroy(gameObject);
            }
            else
            if (CanPush(unit.direction))
            {
                direction = unit.direction;
                Push(direction);
            }
        }
Ejemplo n.º 2
0
        public void Harvest()
        {
            Pusheable pusheable = Instantiate(product).GetComponent <Pusheable>();

            pusheable.transform.position = block.transform.position;

            pusheable.block = block;
            block.unit      = pusheable;
            block.walkable  = false;

            //block.SetUnit(pusheable);
            Invoke("NotifyPlayer", 1f);
        }
Ejemplo n.º 3
0
        public void ExpireCrop()
        {
            Pusheable pusheable = Instantiate(basVersion).GetComponent <Pusheable>();

            pusheable.transform.position = block.transform.position;

            //  pusheable.block
            pusheable.block         = block;
            block.unit              = pusheable;
            pusheable.block.fertile = false;
            block.walkable          = false;

            Destroy(gameObject);
        }