public void CleanUp()
 {
     if (filterable != null)
     {
         filterable.OnFilterChanged -= new Action <Tag[]>(OnFilterChanged);
     }
     if (fetchList == null)
     {
         return;
     }
     fetchList.Cancel("Parent destroyed");
 }
 public void CleanUp()
 {
     if ((UnityEngine.Object)filterable != (UnityEngine.Object)null)
     {
         TreeFilterable treeFilterable = filterable;
         treeFilterable.OnFilterChanged = (Action <Tag[]>)Delegate.Remove(treeFilterable.OnFilterChanged, new Action <Tag[]>(OnFilterChanged));
     }
     if (fetchList != null)
     {
         fetchList.Cancel("Parent destroyed");
     }
 }
 public void AbortDelivery(string reason)
 {
     if (this.fetchList != null)
     {
         FetchList2 fetchList = this.fetchList;
         this.fetchList = null;
         fetchList.Cancel(reason);
     }
 }
Пример #4
0
 //Cancel the current activity
 private void OnCancel()
 {
     if (chore == null && fetchList == null)
     {
         return;
     }
     if (fetchList != null)
     {
         fetchList.Cancel("Cancelled by user");
         fetchList = null;
         DropStorage();
         MaterialNeeds.Instance.UpdateNeed(ElementLoader.FindElementByHash(SimHashes.SuperInsulator).tag, 0 - MassToInsulate);
     }
     if (chore != null)
     {
         this.chore.Cancel("Cancelled by user");
         this.chore = null;
         this.ShowProgressBar(false);
         this.workTimeRemaining = this.workTime;
         DropStorage();
     }
     Prioritizable.RemoveRef(gameObject);
     isMarkedForWork = false;
 }
Пример #5
0
    protected override void OnCleanUp()
    {
        if (IsReplacementTile && building.Def.isKAnimTile)
        {
            int        cell       = Grid.PosToCell(base.transform.GetPosition());
            GameObject gameObject = Grid.Objects[cell, (int)building.Def.ReplacementLayer];
            if ((UnityEngine.Object)gameObject == (UnityEngine.Object)base.gameObject && (UnityEngine.Object)gameObject.GetComponent <SimCellOccupier>() != (UnityEngine.Object)null)
            {
                World.Instance.blockTileRenderer.RemoveBlock(building.Def, IsReplacementTile, SimHashes.Void, cell);
            }
        }
        GameScenePartitioner.Instance.Free(ref solidPartitionerEntry);
        GameScenePartitioner.Instance.Free(ref digPartitionerEntry);
        GameScenePartitioner.Instance.Free(ref ladderParititonerEntry);
        SaveLoadRoot component = GetComponent <SaveLoadRoot>();

        if ((UnityEngine.Object)component != (UnityEngine.Object)null)
        {
            SaveLoader.Instance.saveManager.Unregister(component);
        }
        if (fetchList != null)
        {
            fetchList.Cancel("Constructable destroyed");
        }
        UnmarkArea();
        int[] placementCells = building.PlacementCells;
        foreach (int cell2 in placementCells)
        {
            Diggable diggable = Diggable.GetDiggable(cell2);
            if ((UnityEngine.Object)diggable != (UnityEngine.Object)null)
            {
                diggable.gameObject.DeleteObject();
            }
        }
        base.OnCleanUp();
    }