Exemplo n.º 1
0
    public void DestroySheep(Script_Sheep p_sheep, Material p_material)
    {
        GameObject sheepObject = p_sheep.GetSheepObject();

        _sheepList.Remove(p_sheep);
        _gameManager.DestroyObject(sheepObject);
        _gameManager.DestroyMaterial(p_material);
    }
 public override void Exit()
 {
     if (_pathObjects.Count > 0)
     {
         foreach (GameObject pathObject in _pathObjects.ToList())
         {
             _manager.DestroyGameObject(pathObject);
             _pathObjects.Remove(pathObject);
         }
     }
     if (_pathObjectsMaterials.Count > 0)
     {
         foreach (Material pathObjectMaterial in _pathObjectsMaterials.ToList())
         {
             _manager.DestroyMaterial(pathObjectMaterial);
             _pathObjectsMaterials.Remove(pathObjectMaterial);
         }
     }
 }
Exemplo n.º 3
0
    public override void DetermineIfDead()
    {
        if (_health <= 0)
        {
            _manager.DestroyMaterial(_objectMaterial);
            _manager.DestroyGameObject(_gameObject);
            _manager.RemoveEnemy(this);

            Vector3Int pos = _behaviourTree.GetBlackBoardElement <Vector3Int> (_locationFlag);
            _grid.AccessGridTile(pos.x, pos.z).SetOccupied(false);

            _behaviourTree.RemoveBlackboardElement(_locationFlag);
            _behaviourTree.RemoveBlackboardElement(_targetEntityFlag);
            _behaviourTree.RemoveBlackboardElement(_entityListFlag);
            _behaviourTree.RemoveBlackboardElement(_forwardSwingFlag);
            _behaviourTree.RemoveBlackboardElement(_getSpaceEntityListFlag);

            _behaviourTree = null;
        }
    }
 public override void DestroyGameObject()
 {
     _gameManager.DestroyMaterial(_meshObjectMaterial);
     _gameManager.DestroyGameObject(_meshObject);
 }
Exemplo n.º 5
0
 private void Destruction()
 {
     _manager.DestroyMaterial(_objectMaterial);
     _manager.DestroyGameObject(_projectileObject);
     _manager.DestroyProjectile(this as Script_IProjectile);
 }
Exemplo n.º 6
0
 public override void Destruction()
 {
     _manager.DestroyMaterial(_meshObjectMaterial);
     _manager.DestroyGameObject(_meshObject);
     _stateManager.Destruction();
 }