///////////////////////////////////////////////////////////////////////////////////////////////// // Notifications from base class ///////////////////////////////////////////////////////////////////////////////////////////////// protected override void OnTriggerEnter_TargetStorage(S_Storage_Base _targetStorage) { switch (currentTask.subTasks.Peek().subTaskType) { case SubTaskType.TAKE_PRODUCT: int amountTaken = _targetStorage.RemoveStock(currentTask.subTasks.Peek().scheduledExchangeAmount); AddItemToInventory(_targetStorage.ProductName, amountTaken); break; case SubTaskType.GIVE_PRODUCT: int amountAdded = _targetStorage.AddStock(currentTask.subTasks.Peek().scheduledExchangeAmount); RmoveItemFromInventory(_targetStorage.ProductName, amountAdded); break; } FinishSubTask(); }
///////////////////////////////////////////////////////////////////////////////////////////////// // Overrideable Notifications ///////////////////////////////////////////////////////////////////////////////////////////////// protected virtual void OnTriggerEnter_TargetStorage(S_Storage_Base _targetStorage) { }
// Constructors public S_AI_SubTask(SubTaskType newSubTaskType, S_Storage_Base newTargetStorage) { subTaskType = newSubTaskType; targetStorage = newTargetStorage; }