This Unity package provides integration with the Crowd Control platform, allowing developers to easily add interactive features to their Unity games.
This package is intended for Unity developers who want to integrate Crowd Control functionality into their games. It is suitable for both beginners and experienced developers looking to enhance player engagement through interactive features.
Crowd Control support is available for a variety of platforms. If you are working on a non-Unity project, please contact Warp World for code samples and support for your platform of choice.
To install the Crowd Control Unity package, follow these steps:
- Open your Unity project.
- Go to
Window>Package Manager. - Click on the
+button in the top left corner and selectAdd package from git URL.... - Enter the following URL:
https://github.com/WarpWorld/CrowdControl.Client.Unity.Package.git. - Click
Addto install the package. - Once installed, you can find the Crowd Control components in the
Packagessection of the Package Manager.
To use the Crowd Control package in your Unity project, follow these steps:
- Create a new GameObject in your scene.
- Add the
CrowdControlBehaviorcomponent to the GameObject. - Configure the
CrowdControlBehaviorwith your Crowd Control game ID, display name, app ID, and app secret. - Create a script that inherits from
GameStateManagerand assign it to a GameObject in your scene. - Assign the
GameStateManagerinstance to theCrowdControlBehaviorcomponent. - Create a new GameObject and add the
UnityEffectLoadercomponent to it. - Assign the
UnityEffectLoaderinstance to theCrowdControlBehaviorcomponent.
To create custom Crowd Control effects in your Unity project, follow these steps:
- Create a new C# script that inherits from
UnityEffectBase. - Override the necessary methods to define the behavior of your effect.
- Create a new GameObject as a child of the
UnityEffectLoaderGameObject. - Add the new effect script to the GameObject.
- Configure the effect parameters as needed.
- Repeat the process for each effect you want to add to your game.
To create an overlay to display running effects in your Unity project, follow these steps:
- Create a new C# script that inherits from
MonoBehaviour. - Create an OnEffectRequest(EffectRequest request) method to listen for incoming effect requests.
- Create an OnEffectUpdate(EffectState state) method to listen for effect status updates.
- Implement a layout that makes sense for your game. a. The Crowd Control Unity demo project contains a basic example. b. It is not recommended to use the demo example overlay in a production game. The overlay should ideally match the aesthetic and theme of your game.