Skip to content

Commit

Permalink
UI update, minor refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
Fritz Huie authored and Fritz Huie committed Feb 1, 2016
1 parent 40202a0 commit 82e0735
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
2 changes: 2 additions & 0 deletions SpaceAdsSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = SpaceAdsSwift/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_SWIFT_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = unity.SpaceAdsSwift;
Expand All @@ -409,6 +410,7 @@
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = SpaceAdsSwift/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_SWIFT_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = unity.SpaceAdsSwift;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {
Expand Down
4 changes: 2 additions & 2 deletions SpaceAdsSwift/GameViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class GameViewController: UIViewController, UnityAdsDelegate {

//initialize Unity Ads
UnityAds.sharedInstance().delegate = self
UnityAds.sharedInstance().setTestMode(true)
UnityAds.sharedInstance().startWithGameId("1016671", andViewController: self)

spaceScene = SpaceScene(size: view.bounds.size)
Expand All @@ -34,8 +35,7 @@ class GameViewController: UIViewController, UnityAdsDelegate {
func playAd(placement: String, sender: SKScene) {
scene = sender
playerIsWatchingRewardedVideo = (placement == "rewardedVideo")
UnityAds.sharedInstance().setZone(placement);

UnityAds.sharedInstance().setZone(placement)
if (UnityAds.sharedInstance().canShowZone(placement)) {
UnityAds.sharedInstance().show()
}else{
Expand Down
17 changes: 16 additions & 1 deletion SpaceAdsSwift/SpaceScene.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ class SpaceScene: SKScene {
fuelIcon.size.height = 50
fuelIcon.alpha = 0.6
fuelIcon.size.width = 42
if (deviceIsAniPad) {
fuelIcon.position = CGPointMake(self.frame.midX + 200, self.frame.midY - 250)
fuelIcon.size.width*=1.5
fuelIcon.size.height*=1.5
}else{
fuelIcon.position = CGPointMake(self.frame.midX + 190, self.frame.midY - 120)
}
fuelIcon.zPosition = 3
rootNode.addChild(fuelIcon)

Expand All @@ -102,9 +109,16 @@ class SpaceScene: SKScene {
rootNode.addChild(fuelPercentage)

adButton.name = "adButton"
adButton.position = CGPointMake(self.frame.midX - 180, self.frame.midY - 120)
adButton.size = buttonSize
adButton.zPosition = 4
adButton.size = buttonSize
if (deviceIsAniPad) {
adButton.position = CGPointMake(self.frame.midX - 300, self.frame.midY - 250)
adButton.size.height*=1.5
adButton.size.width*=1.5
}else{
adButton.position = CGPointMake(self.frame.midX - 180, self.frame.midY - 120)
}
rootNode.addChild(adButton)

searchButton.name = "search"
Expand Down Expand Up @@ -279,6 +293,7 @@ class SpaceScene: SKScene {
let adButton = SKSpriteNode(imageNamed: "playadbutton.png")
let tapArrow = SKSpriteNode(imageNamed: "arrow.png")
let buttonSize = CGSizeMake(200, 100)
var deviceIsAniPad: Bool = UIDevice.currentDevice().userInterfaceIdiom == .Pad
}


Expand Down

0 comments on commit 82e0735

Please sign in to comment.