protected override void StartExecutionImpl() { if (source.GetToolCount(toolType) < 1) { throw new InvalidOperationException("not enough tools"); } else if (subject.CurrentTool != ToolType.None) { throw new InvalidOperationException("already carying another tool"); } else { subject.MoveTo(source.transform.position); Status = ExecutionStatus.InProgress; } }
protected override void UpdateImpl() { if (Status == ExecutionStatus.InProgress && subject.ReachedDestination) { this.subject.CurrentTool = ToolType.None; target.SetToolCount(toolType, target.GetToolCount(toolType) + 1); Status = ExecutionStatus.Complete; } }