Ejemplo n.º 1
0
        void Update()
        {
            if ((lManage != null) && (!BlockTypeIsSolid(lManage.ReturnAdjacentUp(bData))))
            {
                currTimer -= Time.deltaTime;

                if (currTimer <= 0)
                {
                    currTimer = checkDelay;

                    if ((lManage.ReturnAdjacentRight(bData) == BLOCK_WATER) ||
                        (lManage.ReturnAdjacentLeft(bData) == BLOCK_WATER) ||
                        (lManage.ReturnAdjacentForward(bData) == BLOCK_WATER) ||
                        (lManage.ReturnAdjacentBack(bData) == BLOCK_WATER))
                    {
                        lManage.ReplaceBlock(bData, fertilizedForm);
                    }

                    if ((lManage.ReturnAdjacentRight(bData) == BLOCK_GRASS) ||
                        (lManage.ReturnAdjacentLeft(bData) == BLOCK_GRASS) ||
                        (lManage.ReturnAdjacentForward(bData) == BLOCK_GRASS) ||
                        (lManage.ReturnAdjacentBack(bData) == BLOCK_GRASS))
                    {
                        lManage.ReplaceBlock(bData, fertilizedForm);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 void Update()
 {
     currTimer -= Time.deltaTime;
     if (currTimer < 0)
     {
         if (!requiresABlock)
         {
             lManage.ReplaceBlock(bData, targetEntity);
         }
         else if (lManage.ReturnAdjacentDown(bData) == requiredBlock)
         {
             lManage.ReplaceBlock(bData, targetEntity);
         }
     }
 }