123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- //
- // IOSPlatformSDK.h
- // OYGameSKD
- //
- // Created by leon on 2021/1/21.
- // Copyright © 2021 Oujia. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- #import <UIKit/UIKit.h>
- @interface IOSPlatformSDK : NSObject
- //****************** public Method ******************//
- +(instancetype)sharedInstance;
- -(void)startWithUrl:(NSURL*)url;
- //****************** ios call unity start ******************//
- /**
- * cusid:主/副设备
- * left:左鞋动作代码
- * right:右鞋动作代码
- */
- -(void)bridgingMotionAction:(int)cusid
- left:(int)left
- right:(int)right;
- /**
- * 踏步状态,频率
- * cusid:主/副设备
- * leftStatus:左鞋步频(0:停止, 1:慢,2:快)
- * rightStatus:右鞋步频(0:停止, 1:慢,2:快)
- * leftFrag:左鞋步数
- * rightFrag:左鞋步数
- */
- -(void)bridgingStepAction:(int)cusid
- leftStatus:(int)leftStatus
- rightStatus:(int)rightStatus
- leftFrag:(int)leftFrag
- rightFrag:(int)rightFrag;
- /**
- * 返回蓝牙设备的基本信息,用于界面上显示当前的设备状况,, app 跳转的时候传过来的
- * cusid:主/副设备
- * name:蓝牙设备名称
- * address:蓝牙设备mac地址
- * status:链接状态
- * electricity:蓝牙设备电量 取值范围[0 - 100] 对比左右鞋 handler较低的电量
- */
- -(void)bridgingDeviceAction:(int)cusid
- name:(NSString*)name
- address:(NSString*)address
- status:(int)status
- electricity:(int)electricity;
- /**
- *游戏首页交互动作的回调
- * cusid: 主副设备
- * code: 交互代码
- */
- -(void)bridgingInteraction:(int)cusid
- code:(int)code;
- /**
- *趣动通知好友邀请事件
- * code:
- * userChar:
- * infoChar:
- */
- -(void)bridgingInvite:(int)code
- userChar:(const char *)userChar
- infoChar:(const char *)infoChar;
- @end
- //****************** unity call ios start ******************//
- /**
- * unity获取用户信息 -->> 解析从Spotr App的传过来的RL_Seme ios返回json数据给游戏
- */
- extern "C" {
- extern char * GetUserInfoJson();
- }
- /**
- * unity获取用户好友 -->> ios端根据用户token值请求http好友列表 ios将列表json的数组数据传给unity
- */
- extern "C" {
- extern void GetUserFriends();
- }
- /**
- * Unity call ios 获取游戏榜单数据
- *if (type == 0) "world" else "friend"
- *ios 请求完数据后用 PointerGetRankHandler 回调数据给unity
- */
- extern "C" {
- void GetRank(int type);
- }
- /**
- * 主动邀请好友
- * friendid: 游戏好友ID
- */
- extern "C" {
- extern void InviteFriend(int friendid,char * info);
- }
- /**
- * unity界面准备好后可以申请邀请信息,回调在inviteFriendHandler
- * friendid: 游戏好友ID
- */
- extern "C" {
- extern void GetInviteInfo();
- }
- /**
- * Unity call ios 弹出邀请好友弹窗
- * 旧版游戏暂未用到
- */
- extern "C" {
- void ShowInviteFriend(int code, char * info);
- }
- /**
- * 游戏开始
- */
- extern "C" {
- extern void GameStart();
- }
- /**
- * 游戏结束
- * level: level
- * score: score
- * record: record
- * mode: mode
- * opponentId: opponentId
- */
- extern "C" {
- extern void GameEnd(int level, double score, int record, int mode, int opponentId);
- }
- /**
- * 搜索设备
- * type: 设备ID
- */
- extern "C" {
- extern void SearchDevice(int type);
- }
- /**
- * 链接设备
- * type: 设备ID
- */
- extern "C" {
- extern void ConnectDevice(int type);
- }
- /**
- * 链接设备
- * type: 设备ID
- */
- extern "C" {
- extern void DisConnectDevice(int type);
- }
- /**
- * 震动
- * type: 设备ID
- * duration: 时长 ms [100 .. 1000]
- leftOrRight:针对三轮车
- */
- extern "C" {
- extern void Vibrate(int type,int duration);
- }
- /**
- * 震动
- * type:设备ID
- * duration: 时长 ms [100 .. 1000]
- * leftOrRight: 左右鞋 针对三轮车
- */
- extern "C" {
- void VibrateS(int type,int duration,int leftOrRight);
- }
- /**
- * Unity call ios 获取鞋子角度
- */
- extern "C" {
- int NativeGetAttX(int cusId);
- }
- /**
- * 投屏
- */
- extern "C" {
- extern void ScreenProjection();
- }
- /**
- * Unity call ios 返回app
- */
- extern "C" {
- void OnBackPressed();
- }
|