Skip to content
This repository has been archived by the owner on Jan 18, 2019. It is now read-only.

JamesMcMahon/example-ios-unity

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity Example Project

This repo contains an example of a very simple Unity "game" with Skillz integration. The purpose of this example is to show the bare minimum of code needed to use Skillz correctly. This project supports being built into either landscape mode or portrait mode.

Details

The game starts at a "main menu" screen and moves to a "gameplay" screen when a tournament starts (though the "gameplay" is really just a couple of buttons allowing the player to choose what his score will be).

In the MainMenu.unity scene are two different objects:

  • "Main Menu" -- the behavior for the game's main menu
  • "SkillzDelegate" -- the object generated by Skillz when you follow the integration instructions on the Developer Portal.

In order to set the orientation for the game, you must do the following two things:

  • Set the orientation value in the "SkillzDelegate" object dropdown.
  • Set the orientation enum value in the "SkillzDelegate" object's "MySkillzDelegateBase" script.
  • Go into Unity's Player Settings, under the iOS tab inside the Resolution and Presentation block, and set the Default Orientation to either Portrait or Landscape Left.

There are three different "gameplay" scenes. Each one is identical with the exception of a single field in the "GameLogic" component of the "Game Scene Player" object that determines the type of gameplay:

  • NormalMatch.unity -- the gameplay for a standard Head-to-Head Skillz tournament.
  • TurnBasedMatch.unity -- the gameplay for a turn-based Skillz tournament.
  • TurnBasedReview.unity -- a scene for turn-based tournaments where the player can view the state of the game while waiting for an opponent to take their turn.

Build

Building this project uses the standard Unity build process. When buildling to XCode, Unity/Skillz will show a pop-up asking which orientation your game uses.

File -> Build Settings -> Set Platform to iOS (if needed) -> Build This will create the XCode project for iOS.

Once the Xcode project is generated, it should build without any extra work!

Run

Running the project through XCode as you would any other project. Please note: you should run this project directly on a physical device, as XCode's simulator may not work as expected with the SDK.

About

Example project for Skillz iOS integration with a Unity application

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 82.1%
  • Objective-C++ 17.9%