Skip to content

Latest commit

 

History

History
62 lines (51 loc) · 2.64 KB

File metadata and controls

62 lines (51 loc) · 2.64 KB

Cohort Unity Client

Getting started

Before starting

  • make sure your platform is set to iOS (Build Settings > select iOS on left > Switch Platform)

Import Cohort Unity client package

  • Assets > Import package > Custom package, select 'cohort-unity-client'

Import (paid) dependencies from Unity Asset Store

Setting up cues

  • look at CohortUnityClient/Scenes/CohortDemoScene for an example
  • create a plain GameObject, name it 'CohortManager'
  • drag CohortUnityClient/Scripts/CHSession.cs onto the CohortManager GameObject
  • for sound cues:
    • create an Audio Source GameObject (name it if you want)
    • select the CohortManager GameObject
      • in the Inspector, under 'CH Session', set the 'Audio Player' field to your Audio Source object
    • import your sound files to /Resources (as Audio Clips)
      • you can set desired transcode / quality settings under your Audio Clips' Import Settings
    • select the CohortManager GameObject
    • under CH Session > Sound Cues, set Size to 1
    • under Element 0:
      • set the Audio Clip field to one of your Audio Clips
      • set Cue Number to 1 (point cue numbers like 10.5 are fine too)
      • if the cue has speech: transcribe it in the 'Accessible Alternative' field
      • if the cue is music or sound effects: provide a description in the 'Accessible Alternative' field

Testing locally

  • start an instance of Cohort Server running locally
    • for this test, make sure you have run the default DB seeds (THIS STEP IS INADEQUATELY DOCUMENTED)

Back in Unity...

  • under CH Session, enter the following values:
Server URL localhost
Http Port 3000
Web Socket Path /sockets
Event Id 4
Client Occasion 1
Client Tag any
  • enter Play mode
  • you should see console messages saying "req 1 complete", "req 1.5 complete", and "req 2 complete", as well as "opened websocket connection"

Playing sound...