示例#1
0
 public bool Mine(int handId, WorldPos pos, Block block)
 {
     if (needCheckMinePower)
     {
         if (sceneBlock == null || sceneBlock.blockType != (byte)block.BlockType || sceneBlock.extendId != block.ExtendId ||
             !sceneBlock.pos.EqualOther(pos))
         {
             sceneBlock = new SceneBlock(pos, (byte)block.BlockType, block.ExtendId);
         }
         Item item = ItemManager.Instance.GetItem(handId);
         if (item != null)
         {
             SpecialIDMinePower iDPower = sceneBlock.blockData.GetSpecialIDMinePower(item.id);
             if (iDPower != null)
             {
                 return(MineSceneBlock(pos, iDPower.power));
             }
             SpecialTypeMinePower typePower = sceneBlock.blockData.GetSpecialTypeMinePower(item.type);
             if (typePower != null)
             {
                 return(MineSceneBlock(pos, typePower.power));
             }
         }
         return(MineSceneBlock(pos, sceneBlock.blockData.normalMinePower));
     }
     else
     {
         return(true);
     }
 }
示例#2
0
 public void StartMine()
 {
     sceneBlock = null;
 }
示例#3
0
 public void StopMine()
 {
     sceneBlock = null;
     HideMineSplitObj();
 }