Exemplo n.º 1
0
        protected override void Execute(List <GameEntity> entities)
        {
            foreach (var miner in entities)
            {
                var minerTarget = m_context.game.GetEntityWithId(miner.target.value);

                if (!minerTarget.isOreVein)
                {
                    continue;
                }
                if (minerTarget.isDestroyed)
                {
                    continue;
                }
                var availableBranches = GetVeinAvailableBranches(minerTarget);
                while (availableBranches <= 0)
                {
                    var branchPos = minerTarget.position.value;
                    branchPos.y -= 1f;
                    branchPos.x += Random.Range(-1.5f, 1.5f);
                    OreFactory.CreateOreBranch(m_context.game, minerTarget, branchPos);
                    availableBranches++;
                }
            }
        }
Exemplo n.º 2
0
 protected override void Execute(List <GameEntity> entities)
 {
     foreach (var branch in entities)
     {
         var vein = m_context.GetEntityWithId(branch.parent.value);
         if (vein.isDestroyed)
         {
             continue;
         }
         OreFactory.CreateOreBranch(m_context, vein, branch.position.value);
     }
 }