This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fill out your copyright notice in the Description page of Project Settings. | |
#include "EnvQueryGenerator_GridOffset.h" | |
#include "AI/Navigation/NavigationTypes.h" | |
#include "EnvironmentQuery/Contexts/EnvQueryContext_Querier.h" | |
#define LOCTEXT_NAMESPACE "EnvQueryGenerator" | |
UEnvQueryGenerator_GridOffset::UEnvQueryGenerator_GridOffset() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "AIControllerTeam.h" | |
// A Tutorial for this code is available here: | |
// https://www.thinkandbuild.it/ue4-ai-perception-system/ | |
AAIControllerTeam::AAIControllerTeam() | |
{ | |
SetGenericTeamId(FGenericTeamId(5)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "MyAIController.h" | |
#include "EnvironmentQuery/EnvQueryManager.h" | |
void AMyAIController::FindHidingSpot() | |
{ | |
FEnvQueryRequest HidingSpotQueryRequest = FEnvQueryRequest(FindHidingSpotEQS, this); | |
HidingSpotQueryRequest.Execute(EEnvQueryRunMode::SingleResult, this, &AMyAIController::MoveToQueryResult); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (NSArray*)allEntriesInContext:(NSManagedObjectContext*)context fromDate:(NSDate*)fromDate toDate:(NSDate*)toDate{ | |
// Create the request | |
NSFetchRequest *request = [[NSFetchRequest alloc]initWithEntityName:@"Entry"]; | |
// Build the predicate | |
NSPredicate *predicate = [NSPredicate predicateWithFormat: @"date >= %@ && date <= %@ ", fromDate, toDate]; | |
request.predicate = predicate; | |
// Define sorting | |
NSSortDescriptor *sortDesc = [NSSortDescriptor sortDescriptorWithKey:@"date" ascending:YES]; | |
request.sortDescriptors = @[sortDesc]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Return an array: | |
// Index 0: NSDate for the First day of the month | |
// Index 1: NSDate for the Last day of the month | |
+ (NSArray *)dateRangeForYear:(NSInteger)year Month:(NSInteger)month{ | |
// Build calendar and date components | |
NSCalendar* calendar = [NSCalendar currentCalendar]; | |
NSDateComponents* dateComps = [[NSDateComponents alloc] init]; | |
// Set the month |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add Remove child controllers to a custom container controller with Animations | |
// ADD THE CHILD CONTROLLER | |
self.childController = theChildController; | |
self.childController.view.frame = setupInitialChildControllerFrame(); | |
[self addChildViewController:self.childController]; | |
[self.view addSubview:self.childController.view]; | |
[self.childController didMoveToParentViewController:self]; | |
[UIView animateWithDuration:1.0 | |
delay:0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension NSBundle { | |
class var versionNumber: String { | |
if let version = NSBundle.mainBundle().infoDictionary?["CFBundleShortVersionString"] as? String { | |
return version | |
} | |
return "N.D." | |
} | |
class var buildNumber: String { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString * L(NSString * translation_key, NSString * lang) { | |
NSString * s = NSLocalizedString(translation_key, nil); | |
// Force translation as "Lang" language if no translations are found | |
if ([s isEqualToString:translation_key]) { | |
NSString * path = [[NSBundle mainBundle] pathForResource:lang ofType:@"lproj"]; | |
NSBundle * languageBundle = [NSBundle bundleWithPath:path]; | |
s = [languageBundle localizedStringForKey:translation_key value:@"" table:nil]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"opacity"]; | |
anim.fromValue = @(0.0); | |
anim.toValue = @(1.0); | |
CGPoint point = [self createPosition] | |
CABasicAnimation *anim2 = [CABasicAnimation animationWithKeyPath:@"position"]; | |
anim2.fromValue = [NSValue valueWithCGPoint:label.position]; | |
anim2.toValue = [NSValue valueWithCGPoint:point]; | |
CAAnimationGroup *group = [CAAnimationGroup animation]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@dynamic theProperty; //The property should set as dynamic | |
- (id)initWithLayer:(id)layer { | |
if (self = [super initWithLayer:layer]) { | |
if ([layer isKindOfClass:[PieMask class]]) { | |
YourLayer *currentPresentation = (YourLayer *)layer; | |
self.theProperty = currentPresentation.theProperty; |
NewerOlder